Message ID | 20171130174200.6684-1-srinivas.kandagatla@linaro.org |
---|---|
Headers | show |
Series | Introduce framework for SLIMbus device driver | expand |
On Thu, Nov 30, 2017 at 05:41:57PM +0000, srinivas.kandagatla@linaro.org wrote: > From: Sagar Dharia <sdharia@codeaurora.org> > > This patch add device tree bindings for Qualcomm slimbus controller. > > Signed-off-by: Sagar Dharia <sdharia@codeaurora.org> > Signed-off-by: Srinivas Kandagatla <srinivas.kandagatla@linaro.org> > --- > .../devicetree/bindings/slimbus/slim-qcom-ctrl.txt | 39 ++++++++++++++++++++++ > 1 file changed, 39 insertions(+) > create mode 100644 Documentation/devicetree/bindings/slimbus/slim-qcom-ctrl.txt > > diff --git a/Documentation/devicetree/bindings/slimbus/slim-qcom-ctrl.txt b/Documentation/devicetree/bindings/slimbus/slim-qcom-ctrl.txt > new file mode 100644 > index 000000000000..93a6fdaf09b3 > --- /dev/null > +++ b/Documentation/devicetree/bindings/slimbus/slim-qcom-ctrl.txt > @@ -0,0 +1,39 @@ > +Qualcomm SLIMbus controller > +This controller is used if applications processor driver controls SLIMbus > +master component. > + > +Required properties: > + > + - #address-cells - refer to Documentation/devicetree/bindings/slimbus/bus.txt > + - #size-cells - refer to Documentation/devicetree/bindings/slimbus/bus.txt > + > + - reg : Offset and length of the register region(s) for the device > + - reg-names : Register region name(s) referenced in reg above > + Required register resource entries are: > + "ctrl": Physical address of controller register blocks > + "slew": required for "qcom,apq8064-slim" SOC. > + - compatible : should be "qcom,<SOC-NAME>-slim" for SOC specific compatible > + followed by "qcom,slim" for fallback. > + - interrupts : Interrupt number used by this controller > + - clocks : Interface and core clocks used by this SLIMbus controller > + - clock-names : Required clock-name entries are: > + "iface_clk" : Interface clock for this controller > + "core_clk" : Interrupt for controller core's BAM Doesn't match the example. You should drop the '_clk'. With that, Reviewed-by: Rob Herring <robh@kernel.org> > + > +Example: > + > + slim@28080000 { > + compatible = "qcom,apq8064-slim", "qcom,slim"; > + reg = <0x28080000 0x2000>, <0x80207C 4>; > + reg-names = "ctrl", "slew"; > + interrupts = <0 33 0>; > + clocks = <&lcc SLIMBUS_SRC>, <&lcc AUDIO_SLIMBUS_CLK>; > + clock-names = "iface", "core"; > + #address-cells = <2>; > + #size-cell = <0>; > + > + wcd9310: audio-codec@1,0{ > + compatible = "slim217,60"; > + reg = <1 0>; > + }; > + }; > -- > 2.15.0 > -- To unsubscribe from this list: send the line "unsubscribe devicetree" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
Thanks for the review comments. On 01/12/17 10:27, Jonathan Neuschäfer wrote: > Hi, some small nits below. > > On Thu, Nov 30, 2017 at 05:41:48PM +0000, 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. >> >> The summary of SLIMbus and API is documented in the 'summary' file. >> >> Signed-off-by: Sagar Dharia <sdharia@codeaurora.org> >> Signed-off-by: Srinivas Kandagatla <srinivas.kandagatla@linaro.org> >> --- >> Documentation/driver-api/slimbus/index.rst | 15 ++++ >> Documentation/driver-api/slimbus/summary.rst | 108 +++++++++++++++++++++++++++ >> 2 files changed, 123 insertions(+) >> create mode 100644 Documentation/driver-api/slimbus/index.rst >> create mode 100644 Documentation/driver-api/slimbus/summary.rst > > It would probably make sense to Cc the documentation maintainers/mailing > list on this patch (AFAICS, you didn't do that). > Yep, I will include them while sending next version. > When do you plan to add slimbus to Documentation/driver-api/index.rst? that's good point, I will fix this in next version. > >> +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 device (e.g. power it up and/or >> +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). > > Typo: s/compatbility/compatibility/ Yep, Will fix in next version. > >> +--------------- >> +The framework supports APIs to exchange control-information with a SLIMbus >> +device. APIs can be synchronous or asynchronous. >> +From controller's perspective, multiple buffers can be queued to/from >> +hardware for sending/receiving data using slim_ctrl_buf circular buffer. >> +The header file <linux/slimbus.h> has more documentation about messaging APIs. > > Once the kerneldoc documentation (i.e. the /** ... */ comments in the > source) is included somewhere, I think it would make sense to make > slim_ctrl_buf a clickable link to the struct's documentation. Sure, I will explore this side of it before i send next version. thanks, srini > > > Thanks, > Jonathan Neuschäfer > -- To unsubscribe from this list: send the line "unsubscribe devicetree" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
From: Srinivas Kandagatla <srinivas.kandagatla@linaro.org> Thanks for everyone who reviewed v7 patchset, here is v8 with review comments addressed. 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. Framework is introduced to support multiple instances of the bus (1 controller per bus), and multiple slave devices per controller. SPI and I2C frameworks, and comments from last time when I submitted the patches were referred-to while working on this framework. These patchsets introduce device-management, OF helpers, and messaging APIs, controller driver for Qualcomm's SLIMbus controller, and clock-pause feature for entering/exiting low-power mode for SLIMbus. Framework patches to do channel, port and bandwidth management are work-in-progress and will be sent out once these initial patches are accepted. These patchsets were tested on Qualcomm Snapdragon processor board using the controller driver, and a test slave device. v7: https://lwn.net/Articles/739150/ Changes from v7 to v8: * Fixed few warnings from kerneldoc * Few cosmetic fixes suggested by Vinod * made SLIMbus string usage more consistent with spec * made probe mandatory for slim device * replaced explicit info and value element apis with more generic api * made driver_data aligned * cleaned up qcom controller driver as suggested by Charles and Jonathan Sagar Dharia (9): Documentation: Add SLIMbus summary dt-bindings: Add SLIMbus bindings slimbus: Add SLIMbus bus type slimbus: core: Add slim controllers support slimbus: Add messaging APIs to slimbus framework slimbus: Add support for 'clock-pause' feature dt-bindings: Add qcom slimbus controller bindings slimbus: qcom: Add Qualcomm Slimbus controller driver slimbus: qcom: Add runtime-pm support using clock-pause Srinivas Kandagatla (4): slimbus: core: add support to device tree helper regmap: add SLIMbus support slimbus: core: add common defines required for controllers MAINTAINERS: Add SLIMbus maintainer Documentation/devicetree/bindings/slimbus/bus.txt | 50 ++ .../devicetree/bindings/slimbus/slim-qcom-ctrl.txt | 39 ++ Documentation/driver-api/slimbus/index.rst | 15 + Documentation/driver-api/slimbus/summary.rst | 108 +++ MAINTAINERS | 8 + drivers/Kconfig | 2 + drivers/Makefile | 1 + drivers/base/regmap/Kconfig | 4 + drivers/base/regmap/Makefile | 1 + drivers/base/regmap/regmap-slimbus.c | 89 +++ drivers/slimbus/Kconfig | 22 + drivers/slimbus/Makefile | 9 + drivers/slimbus/core.c | 487 +++++++++++++ drivers/slimbus/messaging.c | 336 +++++++++ drivers/slimbus/qcom-ctrl.c | 756 +++++++++++++++++++++ drivers/slimbus/sched.c | 128 ++++ drivers/slimbus/slimbus.h | 268 ++++++++ include/linux/mod_devicetable.h | 13 + include/linux/regmap.h | 18 + include/linux/slimbus.h | 171 +++++ 20 files changed, 2525 insertions(+) create mode 100644 Documentation/devicetree/bindings/slimbus/bus.txt create mode 100644 Documentation/devicetree/bindings/slimbus/slim-qcom-ctrl.txt create mode 100644 Documentation/driver-api/slimbus/index.rst create mode 100644 Documentation/driver-api/slimbus/summary.rst create mode 100644 drivers/base/regmap/regmap-slimbus.c create mode 100644 drivers/slimbus/Kconfig create mode 100644 drivers/slimbus/Makefile create mode 100644 drivers/slimbus/core.c create mode 100644 drivers/slimbus/messaging.c create mode 100644 drivers/slimbus/qcom-ctrl.c create mode 100644 drivers/slimbus/sched.c create mode 100644 drivers/slimbus/slimbus.h create mode 100644 include/linux/slimbus.h -- 2.15.0 -- To unsubscribe from this list: send the line "unsubscribe devicetree" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html