From patchwork Fri Mar 15 18:49:04 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ayush Singh X-Patchwork-Id: 13593890 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 248A1C54E67 for ; Fri, 15 Mar 2024 18:50:40 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-ID:Date:Subject:Cc:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=UwZDKToJYTArAjX0fn4hHLO9c61f2Pu3C8pp75hQY0s=; b=gkd1jY+AbULfsF 5kwpknmYGo6eowHiyU6vI9nEodsfCYSVwicRQ5Z2WugpmUtiwWtIoq0olqjTG1pNN4XaLDIs3FUH7 8W34UDLdE8FxJ7wRiTgF8WvELKdXGp7xOdlmvukch+nQ/ARXWsSotmSc6hXfFMOB2AllUytDb/HCw byySIJE73MaHmyRH5L+NHA3E36qgvfuSqwvie3HVyaqtfC4mrd7l4nDWF+KrSMAQtBHAQKdogGh7w NTJ6whQnVhB4dT74Jj40ydWbc5O2hXGKAeVtuHrhxmAZsm7aI7dpDenMdM1gT/RERzshL6M6UNIpf 1L2Tmo1CCqBC5qfMb4MA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1rlCdO-00000001Deo-1rj9; Fri, 15 Mar 2024 18:50:26 +0000 Received: from mail-pf1-x42d.google.com ([2607:f8b0:4864:20::42d]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1rlCdI-00000001DaR-4BM9 for linux-arm-kernel@lists.infradead.org; Fri, 15 Mar 2024 18:50:23 +0000 Received: by mail-pf1-x42d.google.com with SMTP id d2e1a72fcca58-6e6082eab17so2237500b3a.1 for ; Fri, 15 Mar 2024 11:50:20 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1710528620; x=1711133420; darn=lists.infradead.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=FJyaNPyqw2IdFqRfIn2kDaXxflGKfLH9sUwkufABDcs=; b=Iw+njkeM7tMNcIChcLgQqanSBWtkd6FAFbWnVyrBTxpkn5j6AyYweZMpuoZkdFudV4 DeaCZEChnmSVoewFonfDgKTb/ec2CM9wX8paPHvRCEDA0NmxAo0y/gVOGxjaXaehhssH iP8+zdPBsH88Z8H5GP7J/mdk6eJPov8QF2/klWdDQqrjquhSkHBKuyazce7EVEi7L3PI SiVNJzHM9EM4F/nvl52o+ZXEnllrgZh3bIH/w2ke/6WBasKNby2ZT/5lsGKY/6vF0nrf HKlpIJqmIsxjcKSdaK31KmO4QnVX03xPr7xIKmQTDlb2Y1xc4EHxhuAfo2hZQ6w5aMEy hCsg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1710528620; x=1711133420; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=FJyaNPyqw2IdFqRfIn2kDaXxflGKfLH9sUwkufABDcs=; b=b2T64RT0zsRhk0URngmUPoUYjLKxyuDj51+XzB3bHB56ktWJbMNuSVFUmoQbXHLMaN Vh9qlskoISVHTGfjS0cdKa3bmqcpJu5LlCoLh6AOnFoFxk9nEmeOKiZOMx5FRuwK5agR /W1z6h8EkG+27thF9mlesgMq5D/Cf3nzBYr9XsJWCxrKUryLuWpfePnS6M4JiZUslbnN G+dFFgU2X4y1J1J355w2A7vg8PIty3Fs2hvH5+jEeAibZSSSTTjBi2NJE8suoN5OufcS 3q7PTzECxk3B54/UGnnEFc8s/FrSpBwz5naA1j14LxO2gCa4BG2PyQTvRcbeY8SZgTL2 kCvQ== X-Forwarded-Encrypted: i=1; AJvYcCXUbreed0aKLmvFoukVz6xiCpEea3XP9sOhxB+czofSLYB43PH8A8lGGxYyCUXLtvDjJQu15GHO7cdPxQ2IcNnLCUjaG5H6bqOc9c4LQTzUIDgs8x4= X-Gm-Message-State: AOJu0YzZ4em2/7GQwXNue2O/s6B/J/R88AboHf/08IQtiqqrBrk2jgZm kp/ZGf1ZwWt3vLhiivgQ9Rrsct9Hm5OcTgIXGYpE0JJhB+Dixbhq X-Google-Smtp-Source: AGHT+IHc7+H5cEGXqrctyaczStsb2ofp2iqgC06SmJk8JFddX4axEu63mOXWmXYSgCe6j/iNGhO5GQ== X-Received: by 2002:a05:6a00:841:b0:6e6:8c49:f2f6 with SMTP id q1-20020a056a00084100b006e68c49f2f6mr6144160pfk.24.1710528619634; Fri, 15 Mar 2024 11:50:19 -0700 (PDT) Received: from toolbox.iitism.net ([103.15.228.94]) by smtp.gmail.com with ESMTPSA id f17-20020a056a0022d100b006e6cc998be8sm3580784pfj.207.2024.03.15.11.50.11 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 15 Mar 2024 11:50:19 -0700 (PDT) From: Ayush Singh To: linux-kernel@vger.kernel.org Cc: Ayush Singh , jkridner@beagleboard.org, robertcnelson@beagleboard.org, Vaishnav M A , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Nishanth Menon , Vignesh Raghavendra , Tero Kristo , Derek Kiernan , Dragan Cvetic , Arnd Bergmann , Greg Kroah-Hartman , Liam Girdwood , Mark Brown , Jiri Slaby , Johan Hovold , Alex Elder , devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-spi@vger.kernel.org, linux-serial@vger.kernel.org, greybus-dev@lists.linaro.org Subject: [PATCH v3 6/8] greybus: Add mikroBUS manifest types Date: Sat, 16 Mar 2024 00:19:04 +0530 Message-ID: <20240315184908.500352-7-ayushdevel1325@gmail.com> X-Mailer: git-send-email 2.44.0 In-Reply-To: <20240315184908.500352-1-ayushdevel1325@gmail.com> References: <20240315184908.500352-1-ayushdevel1325@gmail.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240315_115021_182366_42A5BC5A X-CRM114-Status: GOOD ( 13.74 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org Add data structures for parsing mikroBUS manifests, which are based on greybus manifest. Signed-off-by: Ayush Singh --- include/linux/greybus/greybus_manifest.h | 49 ++++++++++++++++++++++++ 1 file changed, 49 insertions(+) diff --git a/include/linux/greybus/greybus_manifest.h b/include/linux/greybus/greybus_manifest.h index bef9eb2093e9..83241e19d9b3 100644 --- a/include/linux/greybus/greybus_manifest.h +++ b/include/linux/greybus/greybus_manifest.h @@ -23,6 +23,9 @@ enum greybus_descriptor_type { GREYBUS_TYPE_STRING = 0x02, GREYBUS_TYPE_BUNDLE = 0x03, GREYBUS_TYPE_CPORT = 0x04, + GREYBUS_TYPE_MIKROBUS = 0x05, + GREYBUS_TYPE_PROPERTY = 0x06, + GREYBUS_TYPE_DEVICE = 0x07, }; enum greybus_protocol { @@ -151,6 +154,49 @@ struct greybus_descriptor_cport { __u8 protocol_id; /* enum greybus_protocol */ } __packed; +/* + * A mikrobus descriptor is used to describe the details + * about the bus ocnfiguration for the add-on board + * connected to the mikrobus port. + */ +struct greybus_descriptor_mikrobus { + __u8 pin_state[12]; +} __packed; + +/* + * A property descriptor is used to pass named properties + * to device drivers through the unified device properties + * interface under linux/property.h + */ +struct greybus_descriptor_property { + __u8 length; + __u8 id; + __u8 propname_stringid; + __u8 type; + __u8 value[]; +} __packed; + +/* + * A device descriptor is used to describe the + * details required by a add-on board device + * driver. + */ +struct greybus_descriptor_device { + __u8 id; + __u8 driver_stringid; + __u8 protocol; + __u8 reg; + __le32 max_speed_hz; + __u8 irq; + __u8 irq_type; + __u8 mode; + __u8 prop_link; + __u8 gpio_link; + __u8 reg_link; + __u8 clock_link; + __u8 pad[1]; +} __packed; + struct greybus_descriptor_header { __le16 size; __u8 type; /* enum greybus_descriptor_type */ @@ -164,6 +210,9 @@ struct greybus_descriptor { struct greybus_descriptor_interface interface; struct greybus_descriptor_bundle bundle; struct greybus_descriptor_cport cport; + struct greybus_descriptor_mikrobus mikrobus; + struct greybus_descriptor_property property; + struct greybus_descriptor_device device; }; } __packed;