pinctrl: qcom: Add APQ8084 pinctrl support
Subsystems (5)
v2 cover pinctrl: qcom: Add APQ8084 pinctrl support
This set of patches adds pinctrl support for the Qualcomm APQ8084 platform. The first patch adds the pin definitions. The second patch contains the devicetree binding documentation. The last patch adds the DT node.
Tested on IFC6540 board.
Changes since v1:
- Updated the total number of pins (suggested by Bjorn Andersson)
- Added the missing pin info (provided by Andy Gross)
- Updated groups and functions to be consistent with other pinctrls. (suggested by Andy Gross)
- Removed unused functions, qdss and test pins. (suggested by Andy Gross)
- Updated the documentation with the possible functions.
Georgi Djakov (3):
pinctrl: qcom: Add APQ8084 pinctrl support
dt: Document Qualcomm APQ8084 pinctrl binding
ARM: dts: qcom: Add TLMM DT node for APQ8084
.../bindings/pinctrl/qcom,apq8084-pinctrl.txt | 104 ++ arch/arm/boot/dts/qcom-apq8084.dtsi | 10 + drivers/pinctrl/qcom/Kconfig | 8 + drivers/pinctrl/qcom/Makefile | 1 + drivers/pinctrl/qcom/pinctrl-apq8084.c | 1243 ++++++++++++++++++++ 5 files changed, 1366 insertions(+) create mode 100644 Documentation/devicetree/bindings/pinctrl/qcom,apq8084-pinctrl.txt create mode 100644 drivers/pinctrl/qcom/pinctrl-apq8084.c
Signature · 1 line
1.7.9.5
PATCH v2 1/3 pinctrl: qcom: Add APQ8084 pinctrl support
This patchset adds pinctrl support for the Qualcomm APQ8084 platform.
--- drivers/pinctrl/qcom/Kconfig | 8 + drivers/pinctrl/qcom/Makefile | 1 + drivers/pinctrl/qcom/pinctrl-apq8084.c | 1243 ++++++++++++++++++++++++++++++++ 3 files changed, 1252 insertions(+) create mode 100644 drivers/pinctrl/qcom/pinctrl-apq8084.c
drivers/pinctrl/qcom/Kconfig +8 -0
@@ -15,6 +15,14 @@ config PINCTRL_APQ8064 This is the pinctrl, pinmux, pinconf and gpiolib driver for the Qualcomm TLMM block found in the Qualcomm APQ8064 platform. +config PINCTRL_APQ8084 + tristate "Qualcomm APQ8084 pin controller driver" + depends on GPIOLIB && OF + select PINCTRL_MSM + help + This is the pinctrl, pinmux, pinconf and gpiolib driver for the + Qualcomm TLMM block found in the Qualcomm APQ8084 platform. + config PINCTRL_IPQ8064 tristate "Qualcomm IPQ8064 pin controller driver" depends on GPIOLIB && OF
drivers/pinctrl/qcom/Makefile +1 -0
@@ -1,6 +1,7 @@ # Qualcomm pin control drivers obj-$(CONFIG_PINCTRL_MSM) += pinctrl-msm.o obj-$(CONFIG_PINCTRL_APQ8064) += pinctrl-apq8064.o +obj-$(CONFIG_PINCTRL_APQ8084) += pinctrl-apq8084.o obj-$(CONFIG_PINCTRL_IPQ8064) += pinctrl-ipq8064.o obj-$(CONFIG_PINCTRL_MSM8960) += pinctrl-msm8960.o obj-$(CONFIG_PINCTRL_MSM8X74) += pinctrl-msm8x74.o
drivers/pinctrl/qcom/pinctrl-apq8084.c new file +1243 -0
1,243 lines not on this page · raw message
Signature · 1 line
1.7.9.5
PATCH v2 2/3 dt: Document Qualcomm APQ8084 pinctrl binding
In reply to Georgi DjakovDefine a new binding for the Qualcomm TLMM (Top-Level Mode Mux) based pin controller inside the APQ8084.
--- .../bindings/pinctrl/qcom,apq8084-pinctrl.txt | 104 ++++++++++++++++++++ 1 file changed, 104 insertions(+) create mode 100644 Documentation/devicetree/bindings/pinctrl/qcom,apq8084-pinctrl.txt
Documentation/devicetree/bindings/pinctrl/qcom,apq8084-pinctrl.txt new file +104 -0
@@ -0,0 +1,104 @@ +Qualcomm APQ8084 TLMM block + +Required properties: +- compatible: "qcom,apq8084-pinctrl" +- reg: Should be the base address and length of the TLMM block. +- interrupts: Should be the parent IRQ of the TLMM block. +- interrupt-controller: Marks the device node as an interrupt controller. +- #interrupt-cells: Should be two. +- gpio-controller: Marks the device node as a GPIO controller. +- #gpio-cells : Should be two. + The first cell is the gpio pin number and the + second cell is used for optional parameters. + +Please refer to ../gpio/gpio.txt and ../interrupt-controller/interrupts.txt for +a general description of GPIO and interrupt bindings. + +Please refer to pinctrl-bindings.txt in this directory for details of the +common pinctrl bindings used by client devices, including the meaning of the +phrase "pin configuration node". + +Qualcomm's pin configuration nodes act as a container for an abitrary number of +subnodes. Each of these subnodes represents some desired configuration for a +pin, a group, or a list of pins or groups. This configuration can include the +mux function to select on those pin(s)/group(s), and various pin configuration +parameters, such as pull-up, drive strength, etc. + +The name of each subnode is not important; all subnodes should be enumerated +and processed purely based on their content. + +Each subnode only affects those parameters that are explicitly listed. In +other words, a subnode that lists a mux function but no pin configuration +parameters implies no information about any pin configuration parameters. +Similarly, a pin subnode that describes a pullup parameter implies no +information about e.g. the mux function. + + +The following generic properties as defined in pinctrl-bindings.txt are valid +to specify in a pin configuration subnode: + + pins, function, bias-disable, bias-pull-down, bias-pull-up, drive-strength, + output-low, output-high. + +Non-empty subnodes must specify the 'pins' property. +Note that not all properties are valid for all pins. + +Valid values for pins are: + gpio0-gpio146 + Supports mux, bias and drive-strength + + sdc1_clk, sdc1_cmd, sdc1_data, sdc2_clk, sdc2_cmd, sdc2_data + Supports bias and drive-strength + +Valid values for function are: +adsp_ext, audio_ref, blsp_i2c1, blsp_i2c2, blsp_i2c3, blsp_i2c4, blsp_i2c5, +blsp_i2c6, blsp_i2c7, blsp_i2c8, blsp_i2c9, blsp_i2c10, blsp_i2c11, blsp_i2c12, +blsp_spi1, blsp_spi2, blsp_spi3, blsp_spi4, blsp_spi5, blsp_spi6, blsp_spi7, +blsp_spi8, blsp_spi9, blsp_spi10, blsp_spi11, blsp_spi12, blsp_uart1, +blsp_uart2, blsp_uart3, blsp_uart4, blsp_uart5, blsp_uart6, blsp_uart7, +blsp_uart8, blsp_uart9, blsp_uart10, blsp_uart11, blsp_uart12, blsp_uim1, +blsp_uim2, blsp_uim3, blsp_uim4, blsp_uim5, blsp_uim6, blsp_uim7, blsp_uim8, +blsp_uim9, blsp_uim10, blsp_uim11, blsp_uim12, cam_mclk0, cam_mclk1, cam_mclk2, +cam_mclk3, cci_async, cci_async_in0, cci_i2c0, cci_i2c1, cci_timer0, cci_timer1, +cci_timer2, cci_timer3, cci_timer4, edp_hpd, gcc_gp1, gcc_gp2, gcc_gp3, gcc_obt, +gcc_vtt, gp_mn, gp_pdm0, gp_pdm1, gp_pdm2, gp0_clk, gp1_clk, gpio, hdmi_cec, +hdmi_ddc, hdmi_dtest, hdmi_hpd, hdmi_rcv, hsic, ldo_en, ldo_update, mdp_vsync, +pci_e0, pci_e0_n, pci_e0_rst, pci_e1, pci_e1_rst, pci_e1_rst_n, pci_e1_clkreq_n, +pri_mi2s, qua_mi2s, sata_act, sata_devsleep, sata_devsleep_n, sd_write, +sdc_emmc_mode, sdc3, sdc4, sec_mi2s, slimbus, spdif_tx, spkr_i2s, spkr_i2s_ws, +spss_geni, ter_mi2s, tsif1, tsif2, uim, uim_batt_alarm, gpio + +Example: + + tlmm: pinctrl at fd510000 { + compatible = "qcom,apq8084-pinctrl"; + reg = <0xfd510000 0x4000>; + gpio-controller; + #gpio-cells = <2>; + interrupt-controller; + #interrupt-cells = <2>; + interrupts = <0 208 0>; + + pinctrl-names = "default"; + pinctrl-0 = <&uart2_default>; + + uart2_default: uart2_default { + mux { + pins = "gpio4", "gpio5"; + function = "blsp_uart2"; + }; + + tx { + pins = "gpio4"; + drive-strength = <4>; + bias-disable; + }; + + + rx { + pins = "gpio5"; + drive-strength = <2>; + bias-pull-up; + }; + }; + };
Signature · 1 line
1.7.9.5
PATCH v2 3/3 ARM: dts: qcom: Add TLMM DT node for APQ8084
In reply to Georgi DjakovThis patch adds the TLMM node for the APQ8084 platform.
--- arch/arm/boot/dts/qcom-apq8084.dtsi | 10 ++++++++++ 1 file changed, 10 insertions(+)
arch/arm/boot/dts/qcom-apq8084.dtsi +10 -0
@@ -185,6 +185,16 @@ reg = <0xfc400000 0x4000>; }; + tlmm: pinctrl at fd510000 { + compatible = "qcom,apq8084-pinctrl"; + reg = <0xfd510000 0x4000>; + gpio-controller; + #gpio-cells = <2>; + interrupt-controller; + #interrupt-cells = <2>; + interrupts = <0 208 0>; + }; + serial at f995e000 { compatible = "qcom,msm-uartdm-v1.4", "qcom,msm-uartdm"; reg = <0xf995e000 0x1000>;
Signature · 1 line
1.7.9.5
Quoted 3 lines · Georgi Djakov
This patchset adds pinctrl support for the Qualcomm APQ8084 platform.
Signed-off-by Georgi Djakov <[email protected]>
Looks good. I'll try to test this tomorrow, but for now....
Signature · 3 lines
sent by an employee of the Qualcomm Innovation Center, Inc. The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum, hosted by The Linux Foundation
Re: [PATCH v2 2/3] dt: Document Qualcomm APQ8084 pinctrl binding
In reply to Georgi DjakovQuoted 4 lines · Georgi Djakov
Define a new binding for the Qualcomm TLMM (Top-Level Mode Mux) based pin controller inside the APQ8084.
Signed-off-by Georgi Djakov <[email protected]>
Looks fine.
Signature · 3 lines
sent by an employee of the Qualcomm Innovation Center, Inc. The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum, hosted by The Linux Foundation
Quoted 3 lines · Georgi Djakov
This patchset adds pinctrl support for the Qualcomm APQ8084 platform.
Signed-off-by Georgi Djakov <[email protected]>
Looks good to me, but waiting for Bj?rn's review before merging.
Yours,
Linus Walleij
On Tue 26 Aug 05:45 PDT 2014, Georgi Djakov wrote:
Hi Georgi,
Sorry for missing this before, but I did a quick walkthrough and unfortunately the gpio configuration needs a few updates.
Quoted 1 line
drivers/pinctrl/qcom/pinctrl-apq8084.c +0
-0
[...]
Quoted 12 lines
drivers/pinctrl/qcom/pinctrl-apq8084.c +12
-0+ +#define PINGROUP (id, f1, f2, f3, f4, f5, f6, f7) \ + { \ + .name = "gpio" #id, \ + .pins = gpio##id##_pins, \ + .npins = ARRAY_SIZE(gpio##id##_pins), \ + .funcs = (int[]){ \ + APQ_MUX_gpio, \ + APQ_MUX_##f1, \ + APQ_MUX_##f2, \ + APQ_MUX_##f3, \ + APQ_MUX_##f4, \
drivers/pinctrl/qcom/pinctrl-apq8084.c line 363
Quoted 10 lines
drivers/pinctrl/qcom/pinctrl-apq8084.c +10
-0+ APQ_MUX_##f5, \ + APQ_MUX_##f6, \ + APQ_MUX_##f7 \ + }, \ + .nfuncs = 8, \ + .ctl_reg = 0x1000 + 0x10 * id, \ + .io_reg = 0x1004 + 0x10 * id, \ + .intr_cfg_reg = 0x1008 + 0x10 * id, \ + .intr_status_reg = 0x100c + 0x10 * id, \ + .intr_target_reg = 0x400 + 0x4 * id, \
The routing of the interrupt is specified in TLMM_GPIO_INTR_CFG(n), i.e: 0x1008 + 0x10 * n
Apparently the HW guys wanted to give us more work, so in 8084 they use 3 to specify routing the interrupts to KPSS, instead of the previous 4. So the static define of INTR_TARGET_PROC_APPS is no longer adequate.
My suggestion is that you create an additional patch and add to your series that moves todays hardcoded 4 into the soc_data for the existing platforms (or include it in this struct).
drivers/pinctrl/qcom/pinctrl-apq8084.c line 372
Quoted 9 lines
drivers/pinctrl/qcom/pinctrl-apq8084.c +9
-0+ .mux_bit = 2, \ + .pull_bit = 0, \ + .drv_bit = 6, \ + .oe_bit = 9, \ + .in_bit = 0, \ + .out_bit = 1, \ + .intr_enable_bit = 0, \ + .intr_status_bit = 0, \ + .intr_ack_high = 1, \
With the 8084 TLMM chip you ack the interrupt status by clearing this bit, so intr_ack_high should be 0.
Quoted 1 line
+ .intr_target_bit = 0, \
Target bit is 5.
Quoted 1 line
+ .intr_raw_status_bit = 3, \
Raw interrupt status bit is 4.
drivers/pinctrl/qcom/pinctrl-apq8084.c line 377
Quoted 3 lines
drivers/pinctrl/qcom/pinctrl-apq8084.c +3
-0+ .intr_polarity_bit = 1, \ + .intr_detection_bit = 2, \ + .intr_detection_width = 1, \
You can do level, raise, fall and both edge detection with 8084, so the width of his part is 2.
drivers/pinctrl/qcom/pinctrl-apq8084.c
Quoted 2 lines
drivers/pinctrl/qcom/pinctrl-apq8084.c +2
-0+ } +
Regards,
Bjorn
Re: [PATCH v2 2/3] dt: Document Qualcomm APQ8084 pinctrl binding
In reply to Georgi DjakovQuoted 4 lines · Georgi Djakov
Define a new binding for the Qualcomm TLMM (Top-Level Mode Mux) based pin controller inside the APQ8084.
Signed-off-by Georgi Djakov <[email protected]>
[...]
Quoted 7 lines
Documentation/devicetree/bindings/pinctrl/qcom,apq8084-pinctrl.txt new file +7
-0+Valid values for function are: +adsp_ext, audio_ref, blsp_i2c1, blsp_i2c2, blsp_i2c3, blsp_i2c4, blsp_i2c5, +blsp_i2c6, blsp_i2c7, blsp_i2c8, blsp_i2c9, blsp_i2c10, blsp_i2c11, blsp_i2c12, +blsp_spi1, blsp_spi2, blsp_spi3, blsp_spi4, blsp_spi5, blsp_spi6, blsp_spi7, +blsp_spi8, blsp_spi9, blsp_spi10, blsp_spi11, blsp_spi12, blsp_uart1, +blsp_uart2, blsp_uart3, blsp_uart4, blsp_uart5, blsp_uart6, blsp_uart7, +blsp_uart8, blsp_uart9, blsp_uart10, blsp_uart11, blsp_uart12, blsp_uim1,
Documentation/devicetree/bindings/pinctrl/qcom,apq8084-pinctrl.txt line 69
Quoted 10 lines
Documentation/devicetree/bindings/pinctrl/qcom,apq8084-pinctrl.txt new file +10
-0+blsp_uim2, blsp_uim3, blsp_uim4, blsp_uim5, blsp_uim6, blsp_uim7, blsp_uim8, +blsp_uim9, blsp_uim10, blsp_uim11, blsp_uim12, cam_mclk0, cam_mclk1, cam_mclk2, +cam_mclk3, cci_async, cci_async_in0, cci_i2c0, cci_i2c1, cci_timer0, cci_timer1, +cci_timer2, cci_timer3, cci_timer4, edp_hpd, gcc_gp1, gcc_gp2, gcc_gp3, gcc_obt, +gcc_vtt, gp_mn, gp_pdm0, gp_pdm1, gp_pdm2, gp0_clk, gp1_clk, gpio, hdmi_cec, +hdmi_ddc, hdmi_dtest, hdmi_hpd, hdmi_rcv, hsic, ldo_en, ldo_update, mdp_vsync, +pci_e0, pci_e0_n, pci_e0_rst, pci_e1, pci_e1_rst, pci_e1_rst_n, pci_e1_clkreq_n, +pri_mi2s, qua_mi2s, sata_act, sata_devsleep, sata_devsleep_n, sd_write, +sdc_emmc_mode, sdc3, sdc4, sec_mi2s, slimbus, spdif_tx, spkr_i2s, spkr_i2s_ws, +spss_geni, ter_mi2s, tsif1, tsif2, uim, uim_batt_alarm, gpio
It would be nice if these where indented.
Also, the last binding I sent up was for msm8960, where I got some comments that made me change the format completely. I don't require you to follow that instead, but I have to vent my opinion saying that it would be nice if you did ;)
Otherwise, Acked-by: Bjorn Andersson <[email protected]>
Regards,
Bjorn
Quoted 62 lines · Bjorn Andersson
On Tue 26 Aug 05:45 PDT 2014, Georgi Djakov wrote:
Hi Georgi,
Sorry for missing this before, but I did a quick walkthrough and unfortunately the gpio configuration needs a few updates.
Quoted 1 line
drivers/pinctrl/qcom/pinctrl-apq8084.c +0
-0[...]
Quoted 12 lines
drivers/pinctrl/qcom/pinctrl-apq8084.c +12
-0+ +#define PINGROUP (id, f1, f2, f3, f4, f5, f6, f7) \ + { \ + .name = "gpio" #id, \ + .pins = gpio##id##_pins, \ + .npins = ARRAY_SIZE(gpio##id##_pins), \ + .funcs = (int[]){ \ + APQ_MUX_gpio, \ + APQ_MUX_##f1, \ + APQ_MUX_##f2, \ + APQ_MUX_##f3, \ + APQ_MUX_##f4, \drivers/pinctrl/qcom/pinctrl-apq8084.c line 363
Quoted 10 lines
drivers/pinctrl/qcom/pinctrl-apq8084.c +10
-0+ APQ_MUX_##f5, \ + APQ_MUX_##f6, \ + APQ_MUX_##f7 \ + }, \ + .nfuncs = 8, \ + .ctl_reg = 0x1000 + 0x10 * id, \ + .io_reg = 0x1004 + 0x10 * id, \ + .intr_cfg_reg = 0x1008 + 0x10 * id, \ + .intr_status_reg = 0x100c + 0x10 * id, \ + .intr_target_reg = 0x400 + 0x4 * id, \The routing of the interrupt is specified in
TLMM_GPIO_INTR_CFG(n), i.e:0x1008+0x10* nApparently the HW guys wanted to give us more work, so in 8084 they use 3 to specify routing the interrupts to KPSS, instead of the previous 4. So the static define of
INTR_TARGET_PROC_APPSis no longer adequate.My suggestion is that you create an additional patch and add to your series that moves todays hardcoded 4 into the
soc_datafor the existing platforms (or include it in this struct).drivers/pinctrl/qcom/pinctrl-apq8084.c line 372
Quoted 9 lines
drivers/pinctrl/qcom/pinctrl-apq8084.c +9
-0+ .mux_bit = 2, \ + .pull_bit = 0, \ + .drv_bit = 6, \ + .oe_bit = 9, \ + .in_bit = 0, \ + .out_bit = 1, \ + .intr_enable_bit = 0, \ + .intr_status_bit = 0, \ + .intr_ack_high = 1, \With the 8084 TLMM chip you ack the interrupt status by clearing this bit, so
intr_ack_highshould be 0.Quoted 1 line
+ .intr_target_bit = 0, \
Target bit is 5.
Quoted 1 line
+ .intr_raw_status_bit = 3, \
Quoted 12 lines
Raw interrupt status bit is 4.
drivers/pinctrl/qcom/pinctrl-apq8084.c line 377
Quoted 3 lines
drivers/pinctrl/qcom/pinctrl-apq8084.c +3
-0+ .intr_polarity_bit = 1, \ + .intr_detection_bit = 2, \ + .intr_detection_width = 1, \You can do level, raise, fall and both edge detection with 8084, so the width of his part is 2.
Quoted 2 lines
drivers/pinctrl/qcom/pinctrl-apq8084.c +2
-0+ } +
Thanks Bjorn. I'll search for some more information regarding this and will update accordingly, including the INTR_TARGET_PROC_APPS for each platform. Thanks again for your time!
BR,
Georgi
Re: [PATCH v2 2/3] dt: Document Qualcomm APQ8084 pinctrl binding
In reply to Bjorn AnderssonQuoted 27 lines · Bjorn Andersson
Quoted 4 lines · Georgi Djakov
Define a new binding for the Qualcomm TLMM (Top-Level Mode Mux) based pin controller inside the APQ8084.
Signed-off-by Georgi Djakov <[email protected]>[...]
Quoted 7 lines
Documentation/devicetree/bindings/pinctrl/qcom,apq8084-pinctrl.txt new file +7
-0+Valid values for function are: +adsp_ext, audio_ref, blsp_i2c1, blsp_i2c2, blsp_i2c3, blsp_i2c4, blsp_i2c5, +blsp_i2c6, blsp_i2c7, blsp_i2c8, blsp_i2c9, blsp_i2c10, blsp_i2c11, blsp_i2c12, +blsp_spi1, blsp_spi2, blsp_spi3, blsp_spi4, blsp_spi5, blsp_spi6, blsp_spi7, +blsp_spi8, blsp_spi9, blsp_spi10, blsp_spi11, blsp_spi12, blsp_uart1, +blsp_uart2, blsp_uart3, blsp_uart4, blsp_uart5, blsp_uart6, blsp_uart7, +blsp_uart8, blsp_uart9, blsp_uart10, blsp_uart11, blsp_uart12, blsp_uim1,Documentation/devicetree/bindings/pinctrl/qcom,apq8084-pinctrl.txt line 69
Quoted 10 lines
Documentation/devicetree/bindings/pinctrl/qcom,apq8084-pinctrl.txt new file +10
-0+blsp_uim2, blsp_uim3, blsp_uim4, blsp_uim5, blsp_uim6, blsp_uim7, blsp_uim8, +blsp_uim9, blsp_uim10, blsp_uim11, blsp_uim12, cam_mclk0, cam_mclk1, cam_mclk2, +cam_mclk3, cci_async, cci_async_in0, cci_i2c0, cci_i2c1, cci_timer0, cci_timer1, +cci_timer2, cci_timer3, cci_timer4, edp_hpd, gcc_gp1, gcc_gp2, gcc_gp3, gcc_obt, +gcc_vtt, gp_mn, gp_pdm0, gp_pdm1, gp_pdm2, gp0_clk, gp1_clk, gpio, hdmi_cec, +hdmi_ddc, hdmi_dtest, hdmi_hpd, hdmi_rcv, hsic, ldo_en, ldo_update, mdp_vsync, +pci_e0, pci_e0_n, pci_e0_rst, pci_e1, pci_e1_rst, pci_e1_rst_n, pci_e1_clkreq_n, +pri_mi2s, qua_mi2s, sata_act, sata_devsleep, sata_devsleep_n, sd_write, +sdc_emmc_mode, sdc3, sdc4, sec_mi2s, slimbus, spdif_tx, spkr_i2s, spkr_i2s_ws, +spss_geni, ter_mi2s, tsif1, tsif2, uim, uim_batt_alarm, gpioIt would be nice if these where indented.
Quoted 5 lines
Also, the last binding I sent up was for msm8960, where I got some comments that made me change the format completely. I don't require you to follow that instead, but I have to vent my opinion saying that it would be nice if you did ;)
Oh, sorry for missing that and thank you for pointing it out! I will update and resend.
BR,
Georgi