From: "Jonathan Neuschäfer" <j.neuschaefer@gmx.net>
To: srinivas.kandagatla@linaro.org
Cc: gregkh@linuxfoundation.org, broonie@kernel.org,
alsa-devel@alsa-project.org, sdharia@codeaurora.org, bp@suse.de,
poeschel@lemonage.de, treding@nvidia.com,
gong.chen@linux.intel.com, andreas.noever@gmail.com,
alan@linux.intel.com, mathieu.poirier@linaro.org,
daniel@ffwll.ch, jkosina@suse.cz, sharon.dvir1@mail.huji.ac.il,
joe@perches.com, davem@davemloft.net, james.hogan@imgtec.com,
michael.opdenacker@free-electrons.com, robh+dt@kernel.org,
pawel.moll@arm.com, mark.rutland@arm.com,
devicetree@vger.kernel.org, linux-kernel@vger.kernel.org,
kheitke@audience.com, linux-arm-msm@vger.kernel.org,
arnd@arndb.de
Subject: Re: [Patch v6 1/7] slimbus: Device management on SLIMbus
Date: Sat, 7 Oct 2017 06:14:23 +0200 [thread overview]
Message-ID: <20171007041423.4lyuygxyjgr3cp33@latitude> (raw)
In-Reply-To: <20171006155136.4682-2-srinivas.kandagatla@linaro.org>
[-- Attachment #1: Type: text/plain, Size: 7416 bytes --]
Hi, I have some more or less trivial comments below.
On Fri, Oct 06, 2017 at 05:51:30PM +0200, srinivas.kandagatla@linaro.org wrote:
> From: Sagar Dharia <sdharia@codeaurora.org>
>
> SLIMbus (Serial Low Power Interchip Media Bus) is a specification
> developed by MIPI (Mobile Industry Processor Interface) alliance.
> SLIMbus is a 2-wire implementation, which is used to communicate with
> peripheral components like audio-codec.
> SLIMbus uses Time-Division-Multiplexing to accommodate multiple data
> channels, and control channel. Control channel has messages to do
> device-enumeration, messages to send/receive control-data to/from
> slimbus devices, messages for port/channel management, and messages to
> do bandwidth allocation.
> The framework supports multiple instances of the bus (1 controller per
> bus), and multiple slave devices per controller.
>
> This patch does device enumeration, logical address assignment,
> informing device when the device reports present/absent etc.
> Reporting present may need the driver to do the needful (e.g. turning
> on voltage regulators powering the device). Additionally device is
> probed when it reports present if that device doesn't need any such
> steps mentioned above.
>
> Signed-off-by: Sagar Dharia <sdharia@codeaurora.org>
> Signed-off-by: Srinivas Kandagatla <srinivas.kandagatla@linaro.org>
> ---
[...]
> +SLIMbus example for Qualcomm's slimbus manager component:
> +
> + slim@28080000 {
> + compatible = "qcom,slim-msm";
> + reg = <0x28080000 0x2000>,
> + interrupts = <0 33 0>;
> + clocks = <&lcc SLIMBUS_SRC>, <&lcc AUDIO_SLIMBUS_CLK>;
> + clock-names = "iface_clk", "core_clk";
> + #address-cells = <2>;
> + #size-cells = <0>;
> +
> + codec: wcd9310@1{
> + compatible = "slim217,60"";
^ spurious quote?
> + reg = <1 0>;
> + };
> + };
> diff --git a/Documentation/slimbus/summary b/Documentation/slimbus/summary
> new file mode 100644
> index 0000000..e7f90bb
> --- /dev/null
> +++ b/Documentation/slimbus/summary
Should this file have a .rst extension, like other Restructured Text
files?
> @@ -0,0 +1,109 @@
> +Overview of Linux kernel SLIMbus support
> +========================================
[...]
> +Device notifications to the driver:
> +-----------------------------------
> +Since SLIMbus devices have mechanisms for reporting their presence, the
> +framework allows drivers to bind when corresponding devices report their
> +presence on the bus.
> +However, it is possible that the driver needs to be probed
> +first so that it can enable corresponding SLIMbus devie (e.g. power it up and/or
s/devie/device/ I guess
> +take it out of reset). To support that behavior, the framework allows drivers
> +to probe first as well (e.g. using standard DeviceTree compatbility field).
> +This creates the necessity for the driver to know when the device is functional
> +(i.e. reported present). device_up callback is used for that reason when the
> +device reports present and is assigned a logical address by the controller.
[...]
> +/**
> + * struct slim_addrt: slimbus address used internally by the slimbus framework.
> + * @valid: If the device is present. Valid is set to false when device reports
> + * absent.
> + * @eaddr: Enumeration address
> + * @laddr: It is possible that controller will set a predefined logical address
> + * rather than the one assigned by framework. (i.e. logical address may
> + * not be same as index into this table). This entry will store the
> + * logical address value for this enumeration address.
> + */
> +struct slim_addrt {
> + bool valid;
> + struct slim_eaddr eaddr;
> + u8 laddr;
> +};
I wonder if valid should be moved after eaddr, to reduce the need for
padding. AFAICS, struct slim_eaddr is 6 bytes long and requires 2-byte
alignment, so if valid is one byte long, there would be one byte of
padding after it, slightly bloating struct slim_addrt, unnecessarily.
> +/**
> + * struct slim_controller: Controls every instance of SLIMbus
> + * (similar to 'master' on SPI)
> + * 'Manager device' is responsible for device management, bandwidth
> + * allocation, channel setup, and port associations per channel.
> + * Device management means Logical address assignment/removal based on
> + * enumeration (report-present, report-absent) if a device.
s/if a device/of a device/ ?
> + * Bandwidth allocation is done dynamically by the manager based on active
> + * channels on the bus, message-bandwidth requests made by slimbus devices.
> + * Based on current bandwidth usage, manager chooses a frequency to run
> + * the bus at (in steps of 'clock-gear', 1 through 10, each clock gear
> + * representing twice the frequency than the previous gear).
> + * Manager is also responsible for entering (and exiting) low-power-mode
> + * (known as 'clock pause').
> + * Manager can do handover of framer if there are multiple framers on the
> + * bus and a certain usecase warrants using certain framer to avoid keeping
> + * previous framer being powered-on.
> + *
> + * Controller here performs duties of the manager device, and 'interface
> + * device'. Interface device is responsible for monitoring the bus and
> + * reporting information such as loss-of-synchronization, data
> + * slot-collision.
> + * @dev: Device interface to this driver
> + * @nr: Board-specific number identifier for this controller/bus
> + * @list: Link with other slimbus controllers
I don't see list in the struct.
> + * @name: Name for this controller
> + * @min_cg: Minimum clock gear supported by this controller (default value: 1)
> + * @max_cg: Maximum clock gear supported by this controller (default value: 10)
> + * @clkgear: Current clock gear in which this bus is running
> + * @a_framer: Active framer which is clocking the bus managed by this controller
> + * @m_ctrl: Mutex protecting controller data structures
> + * @addrt: Logical address table
> + * @num_dev: Number of active slimbus slaves on this bus
> + * @wq: Workqueue per controller used to notify devices when they report present
> + * @xfer_msg: Transfer a message on this controller (this can be a broadcast
> + * control/status message like data channel setup, or a unicast message
> + * like value element read/write.
I don't see xfer_msg in the struct.
> + * @set_laddr: Setup logical address at laddr for the slave with elemental
> + * address e_addr. Drivers implementing controller will be expected to
> + * send unicast message to this device with its logical address.
> + * @get_laddr: It is possible that controller needs to set fixed logical
> + * address table and get_laddr can be used in that case so that controller
> + * can do this assignment.
> + */
> +struct slim_controller {
> + struct device dev;
> + unsigned int nr;
> + char name[SLIMBUS_NAME_SIZE];
> + int min_cg;
> + int max_cg;
> + int clkgear;
> + struct slim_framer *a_framer;
> + struct mutex m_ctrl;
> + struct slim_addrt *addrt;
> + u8 num_dev;
> + struct workqueue_struct *wq;
> + int (*set_laddr)(struct slim_controller *ctrl,
> + struct slim_eaddr *ea, u8 laddr);
> + int (*get_laddr)(struct slim_controller *ctrl,
> + struct slim_eaddr *ea, u8 *laddr);
> +};
Thanks,
Jonathan Neuschäfer
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 819 bytes --]
next prev parent reply other threads:[~2017-10-07 4:15 UTC|newest]
Thread overview: 59+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-10-06 15:51 [Patch v6 0/7] Introduce framework for SLIMbus device drivers srinivas.kandagatla
2017-10-06 15:51 ` [Patch v6 1/7] slimbus: Device management on SLIMbus srinivas.kandagatla
2017-10-07 4:14 ` Jonathan Neuschäfer [this message]
2017-10-07 10:24 ` Srinivas Kandagatla
2017-10-10 10:05 ` [alsa-devel] " Charles Keepax
2017-10-10 12:34 ` Srinivas Kandagatla
2017-10-10 12:56 ` Charles Keepax
2017-10-11 10:23 ` Mark Brown
2017-10-10 10:45 ` Vinod Koul
2017-10-10 12:34 ` Srinivas Kandagatla
2017-10-10 16:49 ` Vinod Koul
2017-10-10 17:21 ` Srinivas Kandagatla
2017-10-11 4:07 ` Vinod Koul
2017-10-11 9:42 ` Srinivas Kandagatla
2017-10-11 10:21 ` Vinod Koul
2017-10-11 11:23 ` Srinivas Kandagatla
2017-10-12 11:01 ` Sanyog Kale
2017-10-12 13:26 ` Srinivas Kandagatla
2017-10-13 19:26 ` Rob Herring
2017-10-16 9:28 ` Srinivas Kandagatla
2017-10-17 6:23 ` Bjorn Andersson
2017-10-18 16:38 ` Srinivas Kandagatla
2017-11-01 23:08 ` Bjorn Andersson
2017-10-23 9:06 ` Mark Brown
2017-10-25 0:16 ` Stephen Boyd
2017-10-06 15:51 ` [Patch v6 2/7] slimbus: Add messaging APIs to slimbus framework srinivas.kandagatla
2017-10-07 6:42 ` Jonathan Neuschäfer
2017-10-07 10:24 ` Srinivas Kandagatla
2017-10-07 12:29 ` Jonathan Neuschäfer
2017-10-10 12:19 ` [alsa-devel] " Charles Keepax
2017-10-10 13:01 ` Srinivas Kandagatla
2017-10-11 4:38 ` Vinod Koul
2017-10-11 7:53 ` Arnd Bergmann
2017-10-11 9:42 ` Srinivas Kandagatla
2017-10-11 10:24 ` Vinod Koul
2017-10-11 11:12 ` Srinivas Kandagatla
2017-10-18 6:15 ` Bjorn Andersson
2017-10-18 16:39 ` Srinivas Kandagatla
2017-10-20 5:00 ` Bjorn Andersson
2017-10-06 15:51 ` [Patch v6 3/7] slimbus: qcom: Add Qualcomm Slimbus controller driver srinivas.kandagatla
2017-10-07 7:45 ` Jonathan Neuschäfer
2017-10-07 10:24 ` Srinivas Kandagatla
2017-10-13 19:17 ` Rob Herring
2017-10-16 9:28 ` Srinivas Kandagatla
2017-10-18 7:27 ` Bjorn Andersson
2017-10-18 16:39 ` Srinivas Kandagatla
2017-10-06 15:51 ` [Patch v6 4/7] slimbus: Add support for 'clock-pause' feature srinivas.kandagatla
2017-10-07 8:06 ` Jonathan Neuschäfer
2017-10-07 10:24 ` Srinivas Kandagatla
2017-10-06 15:51 ` [Patch v6 5/7] slimbus: qcom: Add runtime-pm support using clock-pause feature srinivas.kandagatla
2017-10-07 8:22 ` Jonathan Neuschäfer
2017-10-07 10:25 ` Srinivas Kandagatla
2017-10-06 15:51 ` [Patch v6 6/7] regmap: add SLIMBUS support srinivas.kandagatla
2017-10-07 5:02 ` Jonathan Neuschäfer
2017-10-07 10:25 ` Srinivas Kandagatla
2017-10-20 5:00 ` Bjorn Andersson
2017-10-06 15:51 ` [Patch v6 7/7] MAINTAINERS: Add SLIMbus maintainer srinivas.kandagatla
2017-10-20 5:00 ` Bjorn Andersson
2017-10-25 0:43 [Patch v6 1/7] slimbus: Device management on SLIMbus Rishi Bhattacharya
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20171007041423.4lyuygxyjgr3cp33@latitude \
--to=j.neuschaefer@gmx.net \
--cc=alan@linux.intel.com \
--cc=alsa-devel@alsa-project.org \
--cc=andreas.noever@gmail.com \
--cc=arnd@arndb.de \
--cc=bp@suse.de \
--cc=broonie@kernel.org \
--cc=daniel@ffwll.ch \
--cc=davem@davemloft.net \
--cc=devicetree@vger.kernel.org \
--cc=gong.chen@linux.intel.com \
--cc=gregkh@linuxfoundation.org \
--cc=james.hogan@imgtec.com \
--cc=jkosina@suse.cz \
--cc=joe@perches.com \
--cc=kheitke@audience.com \
--cc=linux-arm-msm@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=mark.rutland@arm.com \
--cc=mathieu.poirier@linaro.org \
--cc=michael.opdenacker@free-electrons.com \
--cc=pawel.moll@arm.com \
--cc=poeschel@lemonage.de \
--cc=robh+dt@kernel.org \
--cc=sdharia@codeaurora.org \
--cc=sharon.dvir1@mail.huji.ac.il \
--cc=srinivas.kandagatla@linaro.org \
--cc=treding@nvidia.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®