Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

Merge tag 'pinctrl-v4.10-1' of git://git.kernel.org/pub/scm/linux/kernel/git/linusw/linux-pinctrl

Pull pinctrl updates from Linus Walleij:
"Bulk pin control changes for the v4.10 kernel cycle:

No core changes this time. Mainly gradual improvement and
feature growth in the drivers.

New drivers:

- New driver for TI DA850/OMAP-L138/AM18XX pinconf

- The SX150x was moved over from the GPIO subsystem and reimagined as
a pin control driver with GPIO support in a joint effort by three
independent users of this hardware. The result was amazingly good!

- New subdriver for the Oxnas OX820

Improvements:

- The sunxi driver now supports the generic pin control bindings
rather than the sunxi-specific. Add debouncing support to the
driver.

- Simplifications in pinctrl-single adding a generic parser.

- Two downstream fixes and move the Raspberry Pi BCM2835 over to use
the generic GPIOLIB_IRQCHIP"

* tag 'pinctrl-v4.10-1' of git://git.kernel.org/pub/scm/linux/kernel/git/linusw/linux-pinctrl: (92 commits)
pinctrl: sx150x: use new nested IRQ infrastructure
pinctrl: sx150x: handle missing 'advanced' reg in sx1504 and sx1505
pinctrl: sx150x: rename 'reg_advance' to 'reg_advanced'
pinctrl: sx150x: access the correct bits in the 4-bit regs of sx150[147]
pinctrl: mt8173: set GPIO16 to usb iddig mode
pinctrl: bcm2835: switch to GPIOLIB_IRQCHIP
pinctrl: New driver for TI DA850/OMAP-L138/AM18XX pinconf
devicetree: bindings: pinctrl: Add binding for ti,da850-pupd
Documentation: pinctrl: palmas: Add ti,palmas-powerhold-override property definition
pinctrl: intel: set default handler to be handle_bad_irq()
pinctrl: sx150x: add support for sx1501, sx1504, sx1505 and sx1507
pinctrl: sx150x: sort chips by part number
pinctrl: sx150x: use correct registers for reg_sense (sx1502 and sx1508)
pinctrl: imx: fix imx_pinctrl_desc initialization
pinctrl: sx150x: support setting multiple pins at once
pinctrl: sx150x: various spelling fixes and some white-space cleanup
pinctrl: mediatek: use builtin_platform_driver
pinctrl: stm32: use builtin_platform_driver
pinctrl: sunxi: Testing the wrong variable
pinctrl: nomadik: split up and comments MC0 pins
...

+6173 -1355
+1 -1
Documentation/devicetree/bindings/gpio/gpio_oxnas.txt
··· 3 3 Please refer to gpio.txt for generic information regarding GPIO bindings. 4 4 5 5 Required properties: 6 - - compatible: "oxsemi,ox810se-gpio" 6 + - compatible: "oxsemi,ox810se-gpio" or "oxsemi,ox820-gpio" 7 7 - reg: Base address and length for the device. 8 8 - interrupts: The port interrupt shared by all pins. 9 9 - gpio-controller: Marks the port as GPIO controller.
+30
Documentation/devicetree/bindings/pinctrl/allwinner,sunxi-pinctrl.txt
··· 28 28 - reg: Should contain the register physical address and length for the 29 29 pin controller. 30 30 31 + - clocks: phandle to the clocks feeding the pin controller: 32 + - "apb": the gated APB parent clock 33 + - "hosc": the high frequency oscillator in the system 34 + - "losc": the low frequency oscillator in the system 35 + 36 + Note: For backward compatibility reasons, the hosc and losc clocks are only 37 + required if you need to use the optional input-debounce property. Any new 38 + device tree should set them. 39 + 40 + Optional properties: 41 + - input-debounce: Array of debouncing periods in microseconds. One period per 42 + irq bank found in the controller. 0 if no setup required. 43 + 44 + 31 45 Please refer to pinctrl-bindings.txt in this directory for details of the 32 46 common pinctrl bindings used by client devices. 33 47 ··· 50 36 pins it needs, and how they should be configured, with regard to muxer 51 37 configuration, drive strength and pullups. If one of these options is 52 38 not set, its actual value will be unspecified. 39 + 40 + This driver supports the generic pin multiplexing and configuration 41 + bindings. For details on each properties, you can refer to 42 + ./pinctrl-bindings.txt. 43 + 44 + Required sub-node properties: 45 + - pins 46 + - function 47 + 48 + Optional sub-node properties: 49 + - bias-disable 50 + - bias-pull-up 51 + - bias-pull-down 52 + - drive-strength 53 + 54 + *** Deprecated pin configuration and multiplexing binding 53 55 54 56 Required subnode-properties: 55 57
+2
Documentation/devicetree/bindings/pinctrl/atmel,at91-pinctrl.txt
··· 98 98 01 - Low 99 99 10 - Medium 100 100 11 - High 101 + OUTPUT (1 << 7): indicate this pin need to be configured as an output. 102 + OUTPUT_VAL (1 << 8): output val (1 = high, 0 = low) 101 103 DEBOUNCE (1 << 16): indicate this pin needs debounce. 102 104 DEBOUNCE_VAL (0x3fff << 17): debounce value. 103 105
+2
Documentation/devicetree/bindings/pinctrl/meson,pinctrl.txt
··· 7 7 "amlogic,meson8b-aobus-pinctrl" 8 8 "amlogic,meson-gxbb-periphs-pinctrl" 9 9 "amlogic,meson-gxbb-aobus-pinctrl" 10 + "amlogic,meson-gxl-periphs-pinctrl" 11 + "amlogic,meson-gxl-aobus-pinctrl" 10 12 - reg: address and size of registers controlling irq functionality 11 13 12 14 === GPIO sub-nodes ===
+1 -1
Documentation/devicetree/bindings/pinctrl/oxnas,pinctrl.txt
··· 9 9 pins, optional function, and optional mux related configuration. 10 10 11 11 Required properties for pin controller node: 12 - - compatible: "oxsemi,ox810se-pinctrl" 12 + - compatible: "oxsemi,ox810se-pinctrl" or "oxsemi,ox820-pinctrl" 13 13 - oxsemi,sys-ctrl: a phandle to the system controller syscon node 14 14 15 15 Required properties for pin configuration sub-nodes:
+43 -1
Documentation/devicetree/bindings/pinctrl/pinctrl-bindings.txt
··· 97 97 }; 98 98 99 99 == Pin controller devices == 100 + Required properties: See the pin controller driver specific documentation 101 + 102 + Optional properties: 103 + #pinctrl-cells: Number of pin control cells in addition to the index within the 104 + pin controller device instance 100 105 101 106 Pin controller devices should contain the pin configuration nodes that client 102 107 devices reference. ··· 124 119 125 120 The contents of each of those pin configuration child nodes is defined 126 121 entirely by the binding for the individual pin controller device. There 127 - exists no common standard for this content. 122 + exists no common standard for this content. The pinctrl framework only 123 + provides generic helper bindings that the pin controller driver can use. 128 124 129 125 The pin configuration nodes need not be direct children of the pin controller 130 126 device; they may be grandchildren, for example. Whether this is legal, and ··· 161 155 function = "i2c0"; 162 156 pins = "mfio29", "mfio30"; 163 157 }; 158 + 159 + Optionally an altenative binding can be used if more suitable depending on the 160 + pin controller hardware. For hardaware where there is a large number of identical 161 + pin controller instances, naming each pin and function can easily become 162 + unmaintainable. This is especially the case if the same controller is used for 163 + different pins and functions depending on the SoC revision and packaging. 164 + 165 + For cases like this, the pin controller driver may use pinctrl-pin-array helper 166 + binding with a hardware based index and a number of pin configuration values: 167 + 168 + pincontroller { 169 + ... /* Standard DT properties for the device itself elided */ 170 + #pinctrl-cells = <2>; 171 + 172 + state_0_node_a { 173 + pinctrl-pin-array = < 174 + 0 A_DELAY_PS(0) G_DELAY_PS(120) 175 + 4 A_DELAY_PS(0) G_DELAY_PS(360) 176 + ... 177 + >; 178 + }; 179 + ... 180 + }; 181 + 182 + Above #pinctrl-cells specifies the number of value cells in addition to the 183 + index of the registers. This is similar to the interrupts-extended binding with 184 + one exception. There is no need to specify the phandle for each entry as that 185 + is already known as the defined pins are always children of the pin controller 186 + node. Further having the phandle pointing to another pin controller would not 187 + currently work as the pinctrl framework uses named modes to group pins for each 188 + pin control device. 189 + 190 + The index for pinctrl-pin-array must relate to the hardware for the pinctrl 191 + registers, and must not be a virtual index of pin instances. The reason for 192 + this is to avoid mapping of the index in the dts files and the pin controller 193 + driver as it can change. 164 194 165 195 == Generic pin configuration node content == 166 196
+9
Documentation/devicetree/bindings/pinctrl/pinctrl-palmas.txt
··· 35 35 - ti,palmas-enable-dvfs2: Enable DVFS2. Configure pins for DVFS2 mode. 36 36 Selection primary or secondary function associated to GPADC_START 37 37 and SYSEN2 pin/pad for DVFS2 interface 38 + - ti,palmas-override-powerhold: This is applicable for PMICs for which 39 + GPIO7 is configured in POWERHOLD mode which has higher priority 40 + over DEV_ON bit and keeps the PMIC supplies on even after the DEV_ON 41 + bit is turned off. This property enables driver to over ride the 42 + POWERHOLD value to GPIO7 so as to turn off the PMIC in power off 43 + scenarios. So for GPIO7 if ti,palmas-override-powerhold is set 44 + then the GPIO_7 field should never be muxed to anything else. 45 + It should be set to POWERHOLD by default and only in case of 46 + power off scenarios the driver will over ride the mux value. 38 47 39 48 This binding uses the following generic properties as defined in 40 49 pinctrl-bindings.txt:
+9 -4
Documentation/devicetree/bindings/pinctrl/pinctrl-sx150x.txt
··· 6 6 7 7 Required properties: 8 8 - compatible: should be one of : 9 + "semtech,sx1501q", 10 + "semtech,sx1502q", 11 + "semtech,sx1503q", 12 + "semtech,sx1504q", 13 + "semtech,sx1505q", 9 14 "semtech,sx1506q", 15 + "semtech,sx1507q", 10 16 "semtech,sx1508q", 11 - "semtech,sx1509q", 12 - "semtech,sx1502q". 17 + "semtech,sx1509q". 13 18 14 19 - reg: The I2C slave address for this device. 15 20 ··· 32 27 - interrupt-controller: Marks the device as a interrupt controller. 33 28 34 29 - semtech,probe-reset: Will trigger a reset of the GPIO expander on probe, 35 - only for sx1508q and sx1509q 30 + only for sx1507q, sx1508q and sx1509q 36 31 37 32 The GPIO expander can optionally be used as an interrupt controller, in 38 33 which case it uses the default two cell specifier. ··· 47 42 - bias-pull-down: pull down the pin, except the OSCIO pin 48 43 - bias-pull-pin-default: use pin-default pull state, except the OSCIO pin 49 44 - drive-push-pull: drive actively high and low 50 - - drive-open-drain: drive with open drain only for sx1508q and sx1509q and except the OSCIO pin 45 + - drive-open-drain: drive with open drain only for sx1507q, sx1508q and sx1509q and except the OSCIO pin 51 46 - output-low: set the pin to output mode with low level 52 47 - output-high: set the pin to output mode with high level 53 48
+177
Documentation/devicetree/bindings/pinctrl/qcom,msm8994-pinctrl.txt
··· 1 + Qualcomm MSM8994 TLMM block 2 + 3 + This binding describes the Top Level Mode Multiplexer block found in the 4 + MSM8994 platform. 5 + 6 + - compatible: 7 + Usage: required 8 + Value type: <string> 9 + Definition: Should contain one of: 10 + "qcom,msm8992-pinctrl", 11 + "qcom,msm8994-pinctrl". 12 + 13 + - reg: 14 + Usage: required 15 + Value type: <prop-encoded-array> 16 + Definition: the base address and size of the TLMM register space. 17 + 18 + - interrupts: 19 + Usage: required 20 + Value type: <prop-encoded-array> 21 + Definition: should specify the TLMM summary IRQ. 22 + 23 + - interrupt-controller: 24 + Usage: required 25 + Value type: <none> 26 + Definition: identifies this node as an interrupt controller 27 + 28 + - #interrupt-cells: 29 + Usage: required 30 + Value type: <u32> 31 + Definition: must be 2. Specifying the pin number and flags, as defined 32 + in <dt-bindings/interrupt-controller/irq.h> 33 + 34 + - gpio-controller: 35 + Usage: required 36 + Value type: <none> 37 + Definition: identifies this node as a gpio controller 38 + 39 + - #gpio-cells: 40 + Usage: required 41 + Value type: <u32> 42 + Definition: must be 2. Specifying the pin number and flags, as defined 43 + in <dt-bindings/gpio/gpio.h> 44 + 45 + Please refer to ../gpio/gpio.txt and ../interrupt-controller/interrupts.txt for 46 + a general description of GPIO and interrupt bindings. 47 + 48 + Please refer to pinctrl-bindings.txt in this directory for details of the 49 + common pinctrl bindings used by client devices, including the meaning of the 50 + phrase "pin configuration node". 51 + 52 + The pin configuration nodes act as a container for an arbitrary number of 53 + subnodes. Each of these subnodes represents some desired configuration for a 54 + pin, a group, or a list of pins or groups. This configuration can include the 55 + mux function to select on those pin(s)/group(s), and various pin configuration 56 + parameters, such as pull-up, drive strength, etc. 57 + 58 + 59 + PIN CONFIGURATION NODES: 60 + 61 + The name of each subnode is not important; all subnodes should be enumerated 62 + and processed purely based on their content. 63 + 64 + Each subnode only affects those parameters that are explicitly listed. In 65 + other words, a subnode that lists a mux function but no pin configuration 66 + parameters implies no information about any pin configuration parameters. 67 + Similarly, a pin subnode that describes a pullup parameter implies no 68 + information about e.g. the mux function. 69 + 70 + 71 + The following generic properties as defined in pinctrl-bindings.txt are valid 72 + to specify in a pin configuration subnode: 73 + 74 + - pins: 75 + Usage: required 76 + Value type: <string-array> 77 + Definition: List of gpio pins affected by the properties specified in 78 + this subnode. 79 + 80 + Valid pins are: 81 + gpio0-gpio145 82 + Supports mux, bias and drive-strength 83 + 84 + sdc1_clk, sdc1_cmd, sdc1_data sdc1_rclk, sdc2_clk, 85 + sdc2_cmd, sdc2_data 86 + Supports bias and drive-strength 87 + 88 + - function: 89 + Usage: required 90 + Value type: <string> 91 + Definition: Specify the alternative function to be configured for the 92 + specified pins. Functions are only valid for gpio pins. 93 + Valid values are: 94 + 95 + audio_ref_clk, blsp_i2c1, blsp_i2c2, blsp_i2c3, blsp_i2c4, blsp_i2c5, 96 + blsp_i2c6, blsp_i2c7, blsp_i2c8, blsp_i2c9, blsp_i2c10, blsp_i2c11, 97 + blsp_i2c12, blsp_spi1, blsp_spi1_cs1, blsp_spi1_cs2, blsp_spi1_cs3, 98 + blsp_spi2, blsp_spi2_cs1, blsp_spi2_cs2, blsp_spi2_cs3, blsp_spi3, 99 + blsp_spi4, blsp_spi5, blsp_spi6, blsp_spi7, blsp_spi8, blsp_spi9, 100 + blsp_spi10, blsp_spi10_cs1, blsp_spi10_cs2, blsp_spi10_cs3, blsp_spi11, 101 + blsp_spi12, blsp_uart1, blsp_uart2, blsp_uart3, blsp_uart4, blsp_uart5, 102 + blsp_uart6, blsp_uart7, blsp_uart8, blsp_uart9, blsp_uart10, blsp_uart11, 103 + blsp_uart12, blsp_uim1, blsp_uim2, blsp_uim3, blsp_uim4, blsp_uim5, 104 + blsp_uim6, blsp_uim7, blsp_uim8, blsp_uim9, blsp_uim10, blsp_uim11, 105 + blsp_uim12, blsp11_i2c_scl_b, blsp11_i2c_sda_b, blsp11_uart_rx_b, 106 + blsp11_uart_tx_b, cam_mclk0, cam_mclk1, cam_mclk2, cam_mclk3, 107 + cci_async_in0, cci_async_in1, cci_async_in2, cci_i2c0, cci_i2c1, 108 + cci_timer0, cci_timer1, cci_timer2, cci_timer3, cci_timer4, 109 + gcc_gp1_clk_a, gcc_gp1_clk_b, gcc_gp2_clk_a, gcc_gp2_clk_b, gcc_gp3_clk_a, 110 + gcc_gp3_clk_b, gp_mn, gp_pdm0, gp_pdm1, gp_pdm2, gp0_clk, 111 + gp1_clk, gps_tx, gsm_tx, hdmi_cec, hdmi_ddc, hdmi_hpd, hdmi_rcv, 112 + mdp_vsync, mss_lte, nav_pps, nav_tsync, qdss_cti_trig_in_a, 113 + qdss_cti_trig_in_b, qdss_cti_trig_in_c, qdss_cti_trig_in_d, 114 + qdss_cti_trig_out_a, qdss_cti_trig_out_b, qdss_cti_trig_out_c, 115 + qdss_cti_trig_out_d, qdss_traceclk_a, qdss_traceclk_b, qdss_tracectl_a, 116 + qdss_tracectl_b, qdss_tracedata_a, qdss_tracedata_b, qua_mi2s, pci_e0, 117 + pci_e1, pri_mi2s, sdc4, sec_mi2s, slimbus, spkr_i2s, ter_mi2s, tsif1, 118 + tsif2, uim_batt_alarm, uim1, uim2, uim3, uim4, gpio 119 + 120 + - bias-disable: 121 + Usage: optional 122 + Value type: <none> 123 + Definition: The specified pins should be configued as no pull. 124 + 125 + - bias-pull-down: 126 + Usage: optional 127 + Value type: <none> 128 + Definition: The specified pins should be configued as pull down. 129 + 130 + - bias-pull-up: 131 + Usage: optional 132 + Value type: <none> 133 + Definition: The specified pins should be configued as pull up. 134 + 135 + - output-high: 136 + Usage: optional 137 + Value type: <none> 138 + Definition: The specified pins are configured in output mode, driven 139 + high. 140 + Not valid for sdc pins. 141 + 142 + - output-low: 143 + Usage: optional 144 + Value type: <none> 145 + Definition: The specified pins are configured in output mode, driven 146 + low. 147 + Not valid for sdc pins. 148 + 149 + - drive-strength: 150 + Usage: optional 151 + Value type: <u32> 152 + Definition: Selects the drive strength for the specified pins, in mA. 153 + Valid values are: 2, 4, 6, 8, 10, 12, 14 and 16 154 + 155 + Example: 156 + 157 + msmgpio: pinctrl@fd510000 { 158 + compatible = "qcom,msm8994-pinctrl"; 159 + reg = <0xfd510000 0x4000>; 160 + interrupts = <GIC_SPI 208 IRQ_TYPE_LEVEL_HIGH>; 161 + gpio-controller; 162 + #gpio-cells = <2>; 163 + interrupt-controller; 164 + #interrupt-cells = <2>; 165 + 166 + blsp1_uart2_default: blsp1_uart2_default { 167 + pinmux { 168 + pins = "gpio4", "gpio5"; 169 + function = "blsp_uart2"; 170 + }; 171 + pinconf { 172 + pins = "gpio4", "gpio5"; 173 + drive-strength = <16>; 174 + bias-disable; 175 + }; 176 + }; 177 + };
+5 -4
Documentation/devicetree/bindings/pinctrl/rockchip,pinctrl.txt
··· 19 19 defined as gpio sub-nodes of the pinmux controller. 20 20 21 21 Required properties for iomux controller: 22 - - compatible: one of "rockchip,rk2928-pinctrl", "rockchip,rk3066a-pinctrl" 23 - "rockchip,rk3066b-pinctrl", "rockchip,rk3188-pinctrl" 24 - "rockchip,rk3228-pinctrl", "rockchip,rk3288-pinctrl" 25 - "rockchip,rk3368-pinctrl", "rockchip,rk3399-pinctrl" 22 + - compatible: one of "rockchip,rk1108-pinctrl", "rockchip,rk2928-pinctrl" 23 + "rockchip,rk3066a-pinctrl", "rockchip,rk3066b-pinctrl" 24 + "rockchip,rk3188-pinctrl", "rockchip,rk3228-pinctrl" 25 + "rockchip,rk3288-pinctrl", "rockchip,rk3368-pinctrl" 26 + "rockchip,rk3399-pinctrl" 26 27 - rockchip,grf: phandle referencing a syscon providing the 27 28 "general register files" 28 29
+19
Documentation/devicetree/bindings/pinctrl/samsung-pinctrl.txt
··· 19 19 - "samsung,exynos5260-pinctrl": for Exynos5260 compatible pin-controller. 20 20 - "samsung,exynos5410-pinctrl": for Exynos5410 compatible pin-controller. 21 21 - "samsung,exynos5420-pinctrl": for Exynos5420 compatible pin-controller. 22 + - "samsung,exynos5433-pinctrl": for Exynos5433 compatible pin-controller. 22 23 - "samsung,exynos7-pinctrl": for Exynos7 compatible pin-controller. 23 24 24 25 - reg: Base address of the pin controller hardware module and length of 25 26 the address space it occupies. 27 + 28 + - reg: Second base address of the pin controller if the specific registers 29 + of the pin controller are separated into the different base address. 30 + 31 + Eg: GPF[1-5] of Exynos5433 are separated into the two base address. 32 + - First base address is for GPAx and GPF[1-5] external interrupt 33 + registers. 34 + - Second base address is for GPF[1-5] pinctrl registers. 35 + 36 + pinctrl_0: pinctrl@10580000 { 37 + compatible = "samsung,exynos5433-pinctrl"; 38 + reg = <0x10580000 0x1a20>, <0x11090000 0x100>; 39 + 40 + wakeup-interrupt-controller { 41 + compatible = "samsung,exynos7-wakeup-eint"; 42 + interrupts = <0 16 0>; 43 + }; 44 + }; 26 45 27 46 - Pin banks as child nodes: Pin banks of the controller are represented by child 28 47 nodes of the controller node. Bank name is taken from name of the node. Each
+55
Documentation/devicetree/bindings/pinctrl/ti,da850-pupd.txt
··· 1 + * Pin configuration for TI DA850/OMAP-L138/AM18x 2 + 3 + These SoCs have a separate controller for setting bias (internal pullup/down). 4 + Bias can only be selected for groups rather than individual pins. 5 + 6 + Required Properties: 7 + 8 + - compatible: Must be "ti,da850-pupd" 9 + - reg: Base address and length of the memory resource used by the pullup/down 10 + controller hardware module. 11 + 12 + The controller node also acts as a container for pin group configuration nodes. 13 + The names of these groups are ignored. 14 + 15 + Pin Group Node Properties: 16 + 17 + - groups: An array of strings, each string containing the name of a pin group. 18 + Valid names are "cp0".."cp31". 19 + 20 + The pin configuration parameters use the generic pinconf bindings defined in 21 + pinctrl-bindings.txt in this directory. The supported parameters are 22 + bias-disable, bias-pull-up, bias-pull-down. 23 + 24 + 25 + Example 26 + ------- 27 + 28 + In common dtsi file: 29 + 30 + pinconf: pin-controller@22c00c { 31 + compatible = "ti,da850-pupd"; 32 + reg = <0x22c00c 0x8>; 33 + }; 34 + 35 + In board-specific file: 36 + 37 + &pinconf { 38 + pinctrl-0 = <&pinconf_bias_groups>; 39 + pinctrl-names = "default"; 40 + 41 + pinconf_bias_groups: bias-groups { 42 + pull-up { 43 + groups = "cp30", "cp31"; 44 + bias-pull-up; 45 + }; 46 + pull-down { 47 + groups = "cp29", "cp28"; 48 + bias-pull-down; 49 + }; 50 + disable { 51 + groups = "cp27", "cp26"; 52 + bias-disable; 53 + }; 54 + }; 55 + };
+11 -1
drivers/pinctrl/Kconfig
··· 93 93 Requires ACPI/FDT device enumeration code to set up a platform 94 94 device. 95 95 96 + config PINCTRL_DA850_PUPD 97 + tristate "TI DA850/OMAP-L138/AM18XX pullup/pulldown groups" 98 + depends on OF && (ARCH_DAVINCI_DA850 || COMPILE_TEST) 99 + select PINCONF 100 + select GENERIC_PINCONF 101 + help 102 + Driver for TI DA850/OMAP-L138/AM18XX pinconf. Used to control 103 + pullup/pulldown pin groups. 104 + 96 105 config PINCTRL_DIGICOLOR 97 106 bool 98 107 depends on OF && (ARCH_DIGICOLOR || COMPILE_TEST) ··· 180 171 select PINCONF 181 172 select GENERIC_PINCONF 182 173 select GPIOLIB_IRQCHIP 174 + select REGMAP 183 175 help 184 176 Say yes here to provide support for Semtech SX150x-series I2C 185 177 GPIO expanders as pinctrl module. ··· 233 223 234 224 config PINCTRL_MAX77620 235 225 tristate "MAX77620/MAX20024 Pincontrol support" 236 - depends on MFD_MAX77620 226 + depends on MFD_MAX77620 && OF 237 227 select PINMUX 238 228 select GENERIC_PINCONF 239 229 help
+1
drivers/pinctrl/Makefile
··· 14 14 obj-$(CONFIG_PINCTRL_AT91) += pinctrl-at91.o 15 15 obj-$(CONFIG_PINCTRL_AT91PIO4) += pinctrl-at91-pio4.o 16 16 obj-$(CONFIG_PINCTRL_AMD) += pinctrl-amd.o 17 + obj-$(CONFIG_PINCTRL_DA850_PUPD) += pinctrl-da850-pupd.o 17 18 obj-$(CONFIG_PINCTRL_DIGICOLOR) += pinctrl-digicolor.o 18 19 obj-$(CONFIG_PINCTRL_FALCON) += pinctrl-falcon.o 19 20 obj-$(CONFIG_PINCTRL_MAX77620) += pinctrl-max77620.o
+1
drivers/pinctrl/bcm/Kconfig
··· 20 20 bool 21 21 select PINMUX 22 22 select PINCONF 23 + select GPIOLIB_IRQCHIP 23 24 24 25 config PINCTRL_IPROC_GPIO 25 26 bool "Broadcom iProc GPIO (with PINCONF) driver"
+96 -69
drivers/pinctrl/bcm/pinctrl-bcm2835.c
··· 24 24 #include <linux/device.h> 25 25 #include <linux/err.h> 26 26 #include <linux/gpio/driver.h> 27 - #include <linux/interrupt.h> 28 27 #include <linux/io.h> 29 28 #include <linux/irq.h> 30 29 #include <linux/irqdesc.h> 31 - #include <linux/irqdomain.h> 32 30 #include <linux/module.h> 33 31 #include <linux/of_address.h> 34 32 #include <linux/of.h> ··· 45 47 #define MODULE_NAME "pinctrl-bcm2835" 46 48 #define BCM2835_NUM_GPIOS 54 47 49 #define BCM2835_NUM_BANKS 2 50 + #define BCM2835_NUM_IRQS 3 48 51 49 52 #define BCM2835_PIN_BITMAP_SZ \ 50 53 DIV_ROUND_UP(BCM2835_NUM_GPIOS, sizeof(unsigned long) * 8) ··· 85 86 #define BCM2835_PINCONF_UNPACK_PARAM(_conf_) ((_conf_) >> 16) 86 87 #define BCM2835_PINCONF_UNPACK_ARG(_conf_) ((_conf_) & 0xffff) 87 88 88 - struct bcm2835_gpio_irqdata { 89 - struct bcm2835_pinctrl *pc; 90 - int bank; 91 - }; 92 - 93 89 struct bcm2835_pinctrl { 94 90 struct device *dev; 95 91 void __iomem *base; 96 - int irq[BCM2835_NUM_BANKS]; 92 + int irq[BCM2835_NUM_IRQS]; 97 93 98 94 /* note: locking assumes each bank will have its own unsigned long */ 99 95 unsigned long enabled_irq_map[BCM2835_NUM_BANKS]; 100 96 unsigned int irq_type[BCM2835_NUM_GPIOS]; 101 97 102 98 struct pinctrl_dev *pctl_dev; 103 - struct irq_domain *irq_domain; 104 99 struct gpio_chip gpio_chip; 105 100 struct pinctrl_gpio_range gpio_range; 106 101 107 - struct bcm2835_gpio_irqdata irq_data[BCM2835_NUM_BANKS]; 102 + int irq_group[BCM2835_NUM_IRQS]; 108 103 spinlock_t irq_lock[BCM2835_NUM_BANKS]; 109 104 }; 110 - 111 - static struct lock_class_key gpio_lock_class; 112 105 113 106 /* pins are just named GPIO0..GPIO53 */ 114 107 #define BCM2835_GPIO_PIN(a) PINCTRL_PIN(a, "gpio" #a) ··· 359 368 return pinctrl_gpio_direction_output(chip->base + offset); 360 369 } 361 370 362 - static int bcm2835_gpio_to_irq(struct gpio_chip *chip, unsigned offset) 363 - { 364 - struct bcm2835_pinctrl *pc = gpiochip_get_data(chip); 365 - 366 - return irq_linear_revmap(pc->irq_domain, offset); 367 - } 368 - 369 371 static struct gpio_chip bcm2835_gpio_chip = { 370 372 .label = MODULE_NAME, 371 373 .owner = THIS_MODULE, ··· 369 385 .get_direction = bcm2835_gpio_get_direction, 370 386 .get = bcm2835_gpio_get, 371 387 .set = bcm2835_gpio_set, 372 - .to_irq = bcm2835_gpio_to_irq, 373 388 .base = -1, 374 389 .ngpio = BCM2835_NUM_GPIOS, 375 390 .can_sleep = false, 376 391 }; 377 392 378 - static irqreturn_t bcm2835_gpio_irq_handler(int irq, void *dev_id) 393 + static void bcm2835_gpio_irq_handle_bank(struct bcm2835_pinctrl *pc, 394 + unsigned int bank, u32 mask) 379 395 { 380 - struct bcm2835_gpio_irqdata *irqdata = dev_id; 381 - struct bcm2835_pinctrl *pc = irqdata->pc; 382 - int bank = irqdata->bank; 383 396 unsigned long events; 384 397 unsigned offset; 385 398 unsigned gpio; 386 399 unsigned int type; 387 400 388 401 events = bcm2835_gpio_rd(pc, GPEDS0 + bank * 4); 402 + events &= mask; 389 403 events &= pc->enabled_irq_map[bank]; 390 404 for_each_set_bit(offset, &events, 32) { 391 405 gpio = (32 * bank) + offset; 406 + /* FIXME: no clue why the code looks up the type here */ 392 407 type = pc->irq_type[gpio]; 393 408 394 - generic_handle_irq(irq_linear_revmap(pc->irq_domain, gpio)); 409 + generic_handle_irq(irq_linear_revmap(pc->gpio_chip.irqdomain, 410 + gpio)); 395 411 } 396 - return events ? IRQ_HANDLED : IRQ_NONE; 412 + } 413 + 414 + static void bcm2835_gpio_irq_handler(struct irq_desc *desc) 415 + { 416 + struct gpio_chip *chip = irq_desc_get_handler_data(desc); 417 + struct bcm2835_pinctrl *pc = gpiochip_get_data(chip); 418 + struct irq_chip *host_chip = irq_desc_get_chip(desc); 419 + int irq = irq_desc_get_irq(desc); 420 + int group; 421 + int i; 422 + 423 + for (i = 0; i < ARRAY_SIZE(pc->irq); i++) { 424 + if (pc->irq[i] == irq) { 425 + group = pc->irq_group[i]; 426 + break; 427 + } 428 + } 429 + /* This should not happen, every IRQ has a bank */ 430 + if (i == ARRAY_SIZE(pc->irq)) 431 + BUG(); 432 + 433 + chained_irq_enter(host_chip, desc); 434 + 435 + switch (group) { 436 + case 0: /* IRQ0 covers GPIOs 0-27 */ 437 + bcm2835_gpio_irq_handle_bank(pc, 0, 0x0fffffff); 438 + break; 439 + case 1: /* IRQ1 covers GPIOs 28-45 */ 440 + bcm2835_gpio_irq_handle_bank(pc, 0, 0xf0000000); 441 + bcm2835_gpio_irq_handle_bank(pc, 1, 0x00003fff); 442 + break; 443 + case 2: /* IRQ2 covers GPIOs 46-53 */ 444 + bcm2835_gpio_irq_handle_bank(pc, 1, 0x003fc000); 445 + break; 446 + } 447 + 448 + chained_irq_exit(host_chip, desc); 397 449 } 398 450 399 451 static inline void __bcm2835_gpio_irq_config(struct bcm2835_pinctrl *pc, ··· 475 455 476 456 static void bcm2835_gpio_irq_enable(struct irq_data *data) 477 457 { 478 - struct bcm2835_pinctrl *pc = irq_data_get_irq_chip_data(data); 458 + struct gpio_chip *chip = irq_data_get_irq_chip_data(data); 459 + struct bcm2835_pinctrl *pc = gpiochip_get_data(chip); 479 460 unsigned gpio = irqd_to_hwirq(data); 480 461 unsigned offset = GPIO_REG_SHIFT(gpio); 481 462 unsigned bank = GPIO_REG_OFFSET(gpio); ··· 490 469 491 470 static void bcm2835_gpio_irq_disable(struct irq_data *data) 492 471 { 493 - struct bcm2835_pinctrl *pc = irq_data_get_irq_chip_data(data); 472 + struct gpio_chip *chip = irq_data_get_irq_chip_data(data); 473 + struct bcm2835_pinctrl *pc = gpiochip_get_data(chip); 494 474 unsigned gpio = irqd_to_hwirq(data); 495 475 unsigned offset = GPIO_REG_SHIFT(gpio); 496 476 unsigned bank = GPIO_REG_OFFSET(gpio); ··· 597 575 598 576 static int bcm2835_gpio_irq_set_type(struct irq_data *data, unsigned int type) 599 577 { 600 - struct bcm2835_pinctrl *pc = irq_data_get_irq_chip_data(data); 578 + struct gpio_chip *chip = irq_data_get_irq_chip_data(data); 579 + struct bcm2835_pinctrl *pc = gpiochip_get_data(chip); 601 580 unsigned gpio = irqd_to_hwirq(data); 602 581 unsigned offset = GPIO_REG_SHIFT(gpio); 603 582 unsigned bank = GPIO_REG_OFFSET(gpio); ··· 624 601 625 602 static void bcm2835_gpio_irq_ack(struct irq_data *data) 626 603 { 627 - struct bcm2835_pinctrl *pc = irq_data_get_irq_chip_data(data); 604 + struct gpio_chip *chip = irq_data_get_irq_chip_data(data); 605 + struct bcm2835_pinctrl *pc = gpiochip_get_data(chip); 628 606 unsigned gpio = irqd_to_hwirq(data); 629 607 630 608 bcm2835_gpio_set_bit(pc, GPEDS0, gpio); ··· 668 644 unsigned offset) 669 645 { 670 646 struct bcm2835_pinctrl *pc = pinctrl_dev_get_drvdata(pctldev); 647 + struct gpio_chip *chip = &pc->gpio_chip; 671 648 enum bcm2835_fsel fsel = bcm2835_pinctrl_fsel_get(pc, offset); 672 649 const char *fname = bcm2835_functions[fsel]; 673 650 int value = bcm2835_gpio_get_bit(pc, GPLEV0, offset); 674 - int irq = irq_find_mapping(pc->irq_domain, offset); 651 + int irq = irq_find_mapping(chip->irqdomain, offset); 675 652 676 653 seq_printf(s, "function %s in %s; irq %d (%s)", 677 654 fname, value ? "hi" : "lo", ··· 846 821 .dt_free_map = bcm2835_pctl_dt_free_map, 847 822 }; 848 823 824 + static int bcm2835_pmx_free(struct pinctrl_dev *pctldev, 825 + unsigned offset) 826 + { 827 + struct bcm2835_pinctrl *pc = pinctrl_dev_get_drvdata(pctldev); 828 + 829 + /* disable by setting to GPIO_IN */ 830 + bcm2835_pinctrl_fsel_set(pc, offset, BCM2835_FSEL_GPIO_IN); 831 + return 0; 832 + } 833 + 849 834 static int bcm2835_pmx_get_functions_count(struct pinctrl_dev *pctldev) 850 835 { 851 836 return BCM2835_FSEL_COUNT; ··· 915 880 } 916 881 917 882 static const struct pinmux_ops bcm2835_pmx_ops = { 883 + .free = bcm2835_pmx_free, 918 884 .get_functions_count = bcm2835_pmx_get_functions_count, 919 885 .get_function_name = bcm2835_pmx_get_function_name, 920 886 .get_function_groups = bcm2835_pmx_get_function_groups, ··· 953 917 954 918 bcm2835_gpio_wr(pc, GPPUD, arg & 3); 955 919 /* 956 - * Docs say to wait 150 cycles, but not of what. We assume a 957 - * 1 MHz clock here, which is pretty slow... 920 + * BCM2835 datasheet say to wait 150 cycles, but not of what. 921 + * But the VideoCore firmware delay for this operation 922 + * based nearly on the same amount of VPU cycles and this clock 923 + * runs at 250 MHz. 958 924 */ 959 - udelay(150); 925 + udelay(1); 960 926 bcm2835_gpio_wr(pc, GPPUDCLK0 + (off * 4), BIT(bit)); 961 - udelay(150); 927 + udelay(1); 962 928 bcm2835_gpio_wr(pc, GPPUDCLK0 + (off * 4), 0); 963 929 } /* for each config */ 964 930 ··· 1018 980 pc->gpio_chip.parent = dev; 1019 981 pc->gpio_chip.of_node = np; 1020 982 1021 - pc->irq_domain = irq_domain_add_linear(np, BCM2835_NUM_GPIOS, 1022 - &irq_domain_simple_ops, NULL); 1023 - if (!pc->irq_domain) { 1024 - dev_err(dev, "could not create IRQ domain\n"); 1025 - return -ENOMEM; 1026 - } 1027 - 1028 - for (i = 0; i < BCM2835_NUM_GPIOS; i++) { 1029 - int irq = irq_create_mapping(pc->irq_domain, i); 1030 - irq_set_lockdep_class(irq, &gpio_lock_class); 1031 - irq_set_chip_and_handler(irq, &bcm2835_gpio_irq_chip, 1032 - handle_level_irq); 1033 - irq_set_chip_data(irq, pc); 1034 - } 1035 - 1036 983 for (i = 0; i < BCM2835_NUM_BANKS; i++) { 1037 984 unsigned long events; 1038 985 unsigned offset; 1039 - int len; 1040 - char *name; 1041 986 1042 987 /* clear event detection flags */ 1043 988 bcm2835_gpio_wr(pc, GPREN0 + i * 4, 0); ··· 1035 1014 for_each_set_bit(offset, &events, 32) 1036 1015 bcm2835_gpio_wr(pc, GPEDS0 + i * 4, BIT(offset)); 1037 1016 1038 - pc->irq[i] = irq_of_parse_and_map(np, i); 1039 - pc->irq_data[i].pc = pc; 1040 - pc->irq_data[i].bank = i; 1041 1017 spin_lock_init(&pc->irq_lock[i]); 1042 - 1043 - len = strlen(dev_name(pc->dev)) + 16; 1044 - name = devm_kzalloc(pc->dev, len, GFP_KERNEL); 1045 - if (!name) 1046 - return -ENOMEM; 1047 - snprintf(name, len, "%s:bank%d", dev_name(pc->dev), i); 1048 - 1049 - err = devm_request_irq(dev, pc->irq[i], 1050 - bcm2835_gpio_irq_handler, IRQF_SHARED, 1051 - name, &pc->irq_data[i]); 1052 - if (err) { 1053 - dev_err(dev, "unable to request IRQ %d\n", pc->irq[i]); 1054 - return err; 1055 - } 1056 1018 } 1057 1019 1058 1020 err = gpiochip_add_data(&pc->gpio_chip, pc); 1059 1021 if (err) { 1060 1022 dev_err(dev, "could not add GPIO chip\n"); 1061 1023 return err; 1024 + } 1025 + 1026 + err = gpiochip_irqchip_add(&pc->gpio_chip, &bcm2835_gpio_irq_chip, 1027 + 0, handle_level_irq, IRQ_TYPE_NONE); 1028 + if (err) { 1029 + dev_info(dev, "could not add irqchip\n"); 1030 + return err; 1031 + } 1032 + 1033 + for (i = 0; i < BCM2835_NUM_IRQS; i++) { 1034 + pc->irq[i] = irq_of_parse_and_map(np, i); 1035 + pc->irq_group[i] = i; 1036 + /* 1037 + * Use the same handler for all groups: this is necessary 1038 + * since we use one gpiochip to cover all lines - the 1039 + * irq handler then needs to figure out which group and 1040 + * bank that was firing the IRQ and look up the per-group 1041 + * and bank data. 1042 + */ 1043 + gpiochip_set_chained_irqchip(&pc->gpio_chip, 1044 + &bcm2835_gpio_irq_chip, 1045 + pc->irq[i], 1046 + bcm2835_gpio_irq_handler); 1062 1047 } 1063 1048 1064 1049 pc->pctl_dev = devm_pinctrl_register(dev, &bcm2835_pinctrl_desc, pc);
+144
drivers/pinctrl/devicetree.c
··· 253 253 pinctrl_dt_free_maps(p); 254 254 return ret; 255 255 } 256 + 257 + /* 258 + * For pinctrl binding, typically #pinctrl-cells is for the pin controller 259 + * device, so either parent or grandparent. See pinctrl-bindings.txt. 260 + */ 261 + static int pinctrl_find_cells_size(const struct device_node *np) 262 + { 263 + const char *cells_name = "#pinctrl-cells"; 264 + int cells_size, error; 265 + 266 + error = of_property_read_u32(np->parent, cells_name, &cells_size); 267 + if (error) { 268 + error = of_property_read_u32(np->parent->parent, 269 + cells_name, &cells_size); 270 + if (error) 271 + return -ENOENT; 272 + } 273 + 274 + return cells_size; 275 + } 276 + 277 + /** 278 + * pinctrl_get_list_and_count - Gets the list and it's cell size and number 279 + * @np: pointer to device node with the property 280 + * @list_name: property that contains the list 281 + * @list: pointer for the list found 282 + * @cells_size: pointer for the cell size found 283 + * @nr_elements: pointer for the number of elements found 284 + * 285 + * Typically np is a single pinctrl entry containing the list. 286 + */ 287 + static int pinctrl_get_list_and_count(const struct device_node *np, 288 + const char *list_name, 289 + const __be32 **list, 290 + int *cells_size, 291 + int *nr_elements) 292 + { 293 + int size; 294 + 295 + *cells_size = 0; 296 + *nr_elements = 0; 297 + 298 + *list = of_get_property(np, list_name, &size); 299 + if (!*list) 300 + return -ENOENT; 301 + 302 + *cells_size = pinctrl_find_cells_size(np); 303 + if (*cells_size < 0) 304 + return -ENOENT; 305 + 306 + /* First element is always the index within the pinctrl device */ 307 + *nr_elements = (size / sizeof(**list)) / (*cells_size + 1); 308 + 309 + return 0; 310 + } 311 + 312 + /** 313 + * pinctrl_count_index_with_args - Count number of elements in a pinctrl entry 314 + * @np: pointer to device node with the property 315 + * @list_name: property that contains the list 316 + * 317 + * Counts the number of elements in a pinctrl array consisting of an index 318 + * within the controller and a number of u32 entries specified for each 319 + * entry. Note that device_node is always for the parent pin controller device. 320 + */ 321 + int pinctrl_count_index_with_args(const struct device_node *np, 322 + const char *list_name) 323 + { 324 + const __be32 *list; 325 + int size, nr_cells, error; 326 + 327 + error = pinctrl_get_list_and_count(np, list_name, &list, 328 + &nr_cells, &size); 329 + if (error) 330 + return error; 331 + 332 + return size; 333 + } 334 + EXPORT_SYMBOL_GPL(pinctrl_count_index_with_args); 335 + 336 + /** 337 + * pinctrl_copy_args - Populates of_phandle_args based on index 338 + * @np: pointer to device node with the property 339 + * @list: pointer to a list with the elements 340 + * @index: entry within the list of elements 341 + * @nr_cells: number of cells in the list 342 + * @nr_elem: number of elements for each entry in the list 343 + * @out_args: returned values 344 + * 345 + * Populates the of_phandle_args based on the index in the list. 346 + */ 347 + static int pinctrl_copy_args(const struct device_node *np, 348 + const __be32 *list, 349 + int index, int nr_cells, int nr_elem, 350 + struct of_phandle_args *out_args) 351 + { 352 + int i; 353 + 354 + memset(out_args, 0, sizeof(*out_args)); 355 + out_args->np = (struct device_node *)np; 356 + out_args->args_count = nr_cells + 1; 357 + 358 + if (index >= nr_elem) 359 + return -EINVAL; 360 + 361 + list += index * (nr_cells + 1); 362 + 363 + for (i = 0; i < nr_cells + 1; i++) 364 + out_args->args[i] = be32_to_cpup(list++); 365 + 366 + return 0; 367 + } 368 + 369 + /** 370 + * pinctrl_parse_index_with_args - Find a node pointed by index in a list 371 + * @np: pointer to device node with the property 372 + * @list_name: property that contains the list 373 + * @index: index within the list 374 + * @out_arts: entries in the list pointed by index 375 + * 376 + * Finds the selected element in a pinctrl array consisting of an index 377 + * within the controller and a number of u32 entries specified for each 378 + * entry. Note that device_node is always for the parent pin controller device. 379 + */ 380 + int pinctrl_parse_index_with_args(const struct device_node *np, 381 + const char *list_name, int index, 382 + struct of_phandle_args *out_args) 383 + { 384 + const __be32 *list; 385 + int nr_elem, nr_cells, error; 386 + 387 + error = pinctrl_get_list_and_count(np, list_name, &list, 388 + &nr_cells, &nr_elem); 389 + if (error || !nr_cells) 390 + return error; 391 + 392 + error = pinctrl_copy_args(np, list, index, nr_cells, nr_elem, 393 + out_args); 394 + if (error) 395 + return error; 396 + 397 + return 0; 398 + } 399 + EXPORT_SYMBOL_GPL(pinctrl_parse_index_with_args);
+23
drivers/pinctrl/devicetree.h
··· 16 16 * along with this program. If not, see <http://www.gnu.org/licenses/>. 17 17 */ 18 18 19 + struct of_phandle_args; 20 + 19 21 #ifdef CONFIG_OF 20 22 21 23 void pinctrl_dt_free_maps(struct pinctrl *p); 22 24 int pinctrl_dt_to_map(struct pinctrl *p); 25 + 26 + int pinctrl_count_index_with_args(const struct device_node *np, 27 + const char *list_name); 28 + 29 + int pinctrl_parse_index_with_args(const struct device_node *np, 30 + const char *list_name, int index, 31 + struct of_phandle_args *out_args); 23 32 24 33 #else 25 34 ··· 39 30 40 31 static inline void pinctrl_dt_free_maps(struct pinctrl *p) 41 32 { 33 + } 34 + 35 + static inline int pinctrl_count_index_with_args(const struct device_node *np, 36 + const char *list_name) 37 + { 38 + return -ENODEV; 39 + } 40 + 41 + static inline int 42 + pinctrl_parse_index_with_args(const struct device_node *np, 43 + const char *list_name, int index, 44 + struct of_phandle_args *out_args) 45 + { 46 + return -ENODEV; 42 47 } 43 48 44 49 #endif
+4 -4
drivers/pinctrl/freescale/pinctrl-imx.c
··· 778 778 imx_pinctrl_desc->name = dev_name(&pdev->dev); 779 779 imx_pinctrl_desc->pins = info->pins; 780 780 imx_pinctrl_desc->npins = info->npins; 781 - imx_pinctrl_desc->pctlops = &imx_pctrl_ops, 782 - imx_pinctrl_desc->pmxops = &imx_pmx_ops, 783 - imx_pinctrl_desc->confops = &imx_pinconf_ops, 784 - imx_pinctrl_desc->owner = THIS_MODULE, 781 + imx_pinctrl_desc->pctlops = &imx_pctrl_ops; 782 + imx_pinctrl_desc->pmxops = &imx_pmx_ops; 783 + imx_pinctrl_desc->confops = &imx_pinconf_ops; 784 + imx_pinctrl_desc->owner = THIS_MODULE; 785 785 786 786 ret = imx_pinctrl_probe_dt(pdev, info); 787 787 if (ret) {
+1 -1
drivers/pinctrl/intel/pinctrl-baytrail.c
··· 1703 1703 if (irq_rc && irq_rc->start) { 1704 1704 byt_gpio_irq_init_hw(vg); 1705 1705 ret = gpiochip_irqchip_add(gc, &byt_irqchip, 0, 1706 - handle_simple_irq, IRQ_TYPE_NONE); 1706 + handle_bad_irq, IRQ_TYPE_NONE); 1707 1707 if (ret) { 1708 1708 dev_err(&vg->pdev->dev, "failed to add irqchip\n"); 1709 1709 goto fail;
+1 -1
drivers/pinctrl/intel/pinctrl-cherryview.c
··· 762 762 seq_printf(s, "mode %d ", mode); 763 763 } 764 764 765 - seq_printf(s, "ctrl0 0x%08x ctrl1 0x%08x", ctrl0, ctrl1); 765 + seq_printf(s, "0x%08x 0x%08x", ctrl0, ctrl1); 766 766 767 767 if (locked) 768 768 seq_puts(s, " [LOCKED]");
+1 -1
drivers/pinctrl/intel/pinctrl-intel.c
··· 911 911 } 912 912 913 913 ret = gpiochip_irqchip_add(&pctrl->chip, &intel_gpio_irqchip, 0, 914 - handle_simple_irq, IRQ_TYPE_NONE); 914 + handle_bad_irq, IRQ_TYPE_NONE); 915 915 if (ret) { 916 916 dev_err(pctrl->dev, "failed to add irqchip\n"); 917 917 goto fail;
+41
drivers/pinctrl/intel/pinctrl-merrifield.c
··· 814 814 return 0; 815 815 } 816 816 817 + static int mrfld_config_group_get(struct pinctrl_dev *pctldev, 818 + unsigned int group, unsigned long *config) 819 + { 820 + const unsigned int *pins; 821 + unsigned int npins; 822 + int ret; 823 + 824 + ret = mrfld_get_group_pins(pctldev, group, &pins, &npins); 825 + if (ret) 826 + return ret; 827 + 828 + ret = mrfld_config_get(pctldev, pins[0], config); 829 + if (ret) 830 + return ret; 831 + 832 + return 0; 833 + } 834 + 835 + static int mrfld_config_group_set(struct pinctrl_dev *pctldev, 836 + unsigned int group, unsigned long *configs, 837 + unsigned int num_configs) 838 + { 839 + const unsigned int *pins; 840 + unsigned int npins; 841 + int i, ret; 842 + 843 + ret = mrfld_get_group_pins(pctldev, group, &pins, &npins); 844 + if (ret) 845 + return ret; 846 + 847 + for (i = 0; i < npins; i++) { 848 + ret = mrfld_config_set(pctldev, pins[i], configs, num_configs); 849 + if (ret) 850 + return ret; 851 + } 852 + 853 + return 0; 854 + } 855 + 817 856 static const struct pinconf_ops mrfld_pinconf_ops = { 818 857 .is_generic = true, 819 858 .pin_config_get = mrfld_config_get, 820 859 .pin_config_set = mrfld_config_set, 860 + .pin_config_group_get = mrfld_config_group_get, 861 + .pin_config_group_set = mrfld_config_group_set, 821 862 }; 822 863 823 864 static const struct pinctrl_desc mrfld_pinctrl_desc = {
+1 -5
drivers/pinctrl/mediatek/pinctrl-mt6397.c
··· 64 64 }, 65 65 }; 66 66 67 - static int __init mtk_pinctrl_init(void) 68 - { 69 - return platform_driver_register(&mtk_pinctrl_driver); 70 - } 71 - device_initcall(mtk_pinctrl_init); 67 + builtin_platform_driver(mtk_pinctrl_driver);
+1 -1
drivers/pinctrl/mediatek/pinctrl-mtk-mt8173.h
··· 201 201 MTK_PIN( 202 202 PINCTRL_PIN(16, "IDDIG"), 203 203 NULL, "mt8173", 204 - MTK_EINT_FUNCTION(0, 16), 204 + MTK_EINT_FUNCTION(1, 16), 205 205 MTK_FUNCTION(0, "GPIO16"), 206 206 MTK_FUNCTION(1, "IDDIG"), 207 207 MTK_FUNCTION(2, "CMFLASH"),
+2 -1
drivers/pinctrl/meson/Makefile
··· 1 - obj-y += pinctrl-meson8.o pinctrl-meson8b.o pinctrl-meson-gxbb.o 1 + obj-y += pinctrl-meson8.o pinctrl-meson8b.o 2 + obj-y += pinctrl-meson-gxbb.o pinctrl-meson-gxl.o 2 3 obj-y += pinctrl-meson.o
+589
drivers/pinctrl/meson/pinctrl-meson-gxl.c
··· 1 + /* 2 + * Pin controller and GPIO driver for Amlogic Meson GXL. 3 + * 4 + * Copyright (C) 2016 Endless Mobile, Inc. 5 + * Author: Carlo Caione <carlo@endlessm.com> 6 + * 7 + * This program is free software; you can redistribute it and/or 8 + * modify it under the terms of the GNU General Public License 9 + * version 2 as published by the Free Software Foundation. 10 + * 11 + * You should have received a copy of the GNU General Public License 12 + * along with this program. If not, see <http://www.gnu.org/licenses/>. 13 + */ 14 + 15 + #include <dt-bindings/gpio/meson-gxl-gpio.h> 16 + #include "pinctrl-meson.h" 17 + 18 + #define EE_OFF 10 19 + 20 + static const struct pinctrl_pin_desc meson_gxl_periphs_pins[] = { 21 + MESON_PIN(GPIOZ_0, EE_OFF), 22 + MESON_PIN(GPIOZ_1, EE_OFF), 23 + MESON_PIN(GPIOZ_2, EE_OFF), 24 + MESON_PIN(GPIOZ_3, EE_OFF), 25 + MESON_PIN(GPIOZ_4, EE_OFF), 26 + MESON_PIN(GPIOZ_5, EE_OFF), 27 + MESON_PIN(GPIOZ_6, EE_OFF), 28 + MESON_PIN(GPIOZ_7, EE_OFF), 29 + MESON_PIN(GPIOZ_8, EE_OFF), 30 + MESON_PIN(GPIOZ_9, EE_OFF), 31 + MESON_PIN(GPIOZ_10, EE_OFF), 32 + MESON_PIN(GPIOZ_11, EE_OFF), 33 + MESON_PIN(GPIOZ_12, EE_OFF), 34 + MESON_PIN(GPIOZ_13, EE_OFF), 35 + MESON_PIN(GPIOZ_14, EE_OFF), 36 + MESON_PIN(GPIOZ_15, EE_OFF), 37 + 38 + MESON_PIN(GPIOH_0, EE_OFF), 39 + MESON_PIN(GPIOH_1, EE_OFF), 40 + MESON_PIN(GPIOH_2, EE_OFF), 41 + MESON_PIN(GPIOH_3, EE_OFF), 42 + MESON_PIN(GPIOH_4, EE_OFF), 43 + MESON_PIN(GPIOH_5, EE_OFF), 44 + MESON_PIN(GPIOH_6, EE_OFF), 45 + MESON_PIN(GPIOH_7, EE_OFF), 46 + MESON_PIN(GPIOH_8, EE_OFF), 47 + MESON_PIN(GPIOH_9, EE_OFF), 48 + 49 + MESON_PIN(BOOT_0, EE_OFF), 50 + MESON_PIN(BOOT_1, EE_OFF), 51 + MESON_PIN(BOOT_2, EE_OFF), 52 + MESON_PIN(BOOT_3, EE_OFF), 53 + MESON_PIN(BOOT_4, EE_OFF), 54 + MESON_PIN(BOOT_5, EE_OFF), 55 + MESON_PIN(BOOT_6, EE_OFF), 56 + MESON_PIN(BOOT_7, EE_OFF), 57 + MESON_PIN(BOOT_8, EE_OFF), 58 + MESON_PIN(BOOT_9, EE_OFF), 59 + MESON_PIN(BOOT_10, EE_OFF), 60 + MESON_PIN(BOOT_11, EE_OFF), 61 + MESON_PIN(BOOT_12, EE_OFF), 62 + MESON_PIN(BOOT_13, EE_OFF), 63 + MESON_PIN(BOOT_14, EE_OFF), 64 + MESON_PIN(BOOT_15, EE_OFF), 65 + 66 + MESON_PIN(CARD_0, EE_OFF), 67 + MESON_PIN(CARD_1, EE_OFF), 68 + MESON_PIN(CARD_2, EE_OFF), 69 + MESON_PIN(CARD_3, EE_OFF), 70 + MESON_PIN(CARD_4, EE_OFF), 71 + MESON_PIN(CARD_5, EE_OFF), 72 + MESON_PIN(CARD_6, EE_OFF), 73 + 74 + MESON_PIN(GPIODV_0, EE_OFF), 75 + MESON_PIN(GPIODV_1, EE_OFF), 76 + MESON_PIN(GPIODV_2, EE_OFF), 77 + MESON_PIN(GPIODV_3, EE_OFF), 78 + MESON_PIN(GPIODV_4, EE_OFF), 79 + MESON_PIN(GPIODV_5, EE_OFF), 80 + MESON_PIN(GPIODV_6, EE_OFF), 81 + MESON_PIN(GPIODV_7, EE_OFF), 82 + MESON_PIN(GPIODV_8, EE_OFF), 83 + MESON_PIN(GPIODV_9, EE_OFF), 84 + MESON_PIN(GPIODV_10, EE_OFF), 85 + MESON_PIN(GPIODV_11, EE_OFF), 86 + MESON_PIN(GPIODV_12, EE_OFF), 87 + MESON_PIN(GPIODV_13, EE_OFF), 88 + MESON_PIN(GPIODV_14, EE_OFF), 89 + MESON_PIN(GPIODV_15, EE_OFF), 90 + MESON_PIN(GPIODV_16, EE_OFF), 91 + MESON_PIN(GPIODV_17, EE_OFF), 92 + MESON_PIN(GPIODV_19, EE_OFF), 93 + MESON_PIN(GPIODV_20, EE_OFF), 94 + MESON_PIN(GPIODV_21, EE_OFF), 95 + MESON_PIN(GPIODV_22, EE_OFF), 96 + MESON_PIN(GPIODV_23, EE_OFF), 97 + MESON_PIN(GPIODV_24, EE_OFF), 98 + MESON_PIN(GPIODV_25, EE_OFF), 99 + MESON_PIN(GPIODV_26, EE_OFF), 100 + MESON_PIN(GPIODV_27, EE_OFF), 101 + MESON_PIN(GPIODV_28, EE_OFF), 102 + MESON_PIN(GPIODV_29, EE_OFF), 103 + 104 + MESON_PIN(GPIOX_0, EE_OFF), 105 + MESON_PIN(GPIOX_1, EE_OFF), 106 + MESON_PIN(GPIOX_2, EE_OFF), 107 + MESON_PIN(GPIOX_3, EE_OFF), 108 + MESON_PIN(GPIOX_4, EE_OFF), 109 + MESON_PIN(GPIOX_5, EE_OFF), 110 + MESON_PIN(GPIOX_6, EE_OFF), 111 + MESON_PIN(GPIOX_7, EE_OFF), 112 + MESON_PIN(GPIOX_8, EE_OFF), 113 + MESON_PIN(GPIOX_9, EE_OFF), 114 + MESON_PIN(GPIOX_10, EE_OFF), 115 + MESON_PIN(GPIOX_11, EE_OFF), 116 + MESON_PIN(GPIOX_12, EE_OFF), 117 + MESON_PIN(GPIOX_13, EE_OFF), 118 + MESON_PIN(GPIOX_14, EE_OFF), 119 + MESON_PIN(GPIOX_15, EE_OFF), 120 + MESON_PIN(GPIOX_16, EE_OFF), 121 + MESON_PIN(GPIOX_17, EE_OFF), 122 + MESON_PIN(GPIOX_18, EE_OFF), 123 + 124 + MESON_PIN(GPIOCLK_0, EE_OFF), 125 + MESON_PIN(GPIOCLK_1, EE_OFF), 126 + 127 + MESON_PIN(GPIO_TEST_N, EE_OFF), 128 + }; 129 + 130 + static const unsigned int emmc_nand_d07_pins[] = { 131 + PIN(BOOT_0, EE_OFF), PIN(BOOT_1, EE_OFF), PIN(BOOT_2, EE_OFF), 132 + PIN(BOOT_3, EE_OFF), PIN(BOOT_4, EE_OFF), PIN(BOOT_5, EE_OFF), 133 + PIN(BOOT_6, EE_OFF), PIN(BOOT_7, EE_OFF), 134 + }; 135 + static const unsigned int emmc_clk_pins[] = { PIN(BOOT_8, EE_OFF) }; 136 + static const unsigned int emmc_cmd_pins[] = { PIN(BOOT_10, EE_OFF) }; 137 + static const unsigned int emmc_ds_pins[] = { PIN(BOOT_15, EE_OFF) }; 138 + 139 + static const unsigned int sdcard_d0_pins[] = { PIN(CARD_1, EE_OFF) }; 140 + static const unsigned int sdcard_d1_pins[] = { PIN(CARD_0, EE_OFF) }; 141 + static const unsigned int sdcard_d2_pins[] = { PIN(CARD_5, EE_OFF) }; 142 + static const unsigned int sdcard_d3_pins[] = { PIN(CARD_4, EE_OFF) }; 143 + static const unsigned int sdcard_cmd_pins[] = { PIN(CARD_3, EE_OFF) }; 144 + static const unsigned int sdcard_clk_pins[] = { PIN(CARD_2, EE_OFF) }; 145 + 146 + static const unsigned int sdio_d0_pins[] = { PIN(GPIOX_0, EE_OFF) }; 147 + static const unsigned int sdio_d1_pins[] = { PIN(GPIOX_1, EE_OFF) }; 148 + static const unsigned int sdio_d2_pins[] = { PIN(GPIOX_2, EE_OFF) }; 149 + static const unsigned int sdio_d3_pins[] = { PIN(GPIOX_3, EE_OFF) }; 150 + static const unsigned int sdio_cmd_pins[] = { PIN(GPIOX_4, EE_OFF) }; 151 + static const unsigned int sdio_clk_pins[] = { PIN(GPIOX_5, EE_OFF) }; 152 + static const unsigned int sdio_irq_pins[] = { PIN(GPIOX_7, EE_OFF) }; 153 + 154 + static const unsigned int nand_ce0_pins[] = { PIN(BOOT_8, EE_OFF) }; 155 + static const unsigned int nand_ce1_pins[] = { PIN(BOOT_9, EE_OFF) }; 156 + static const unsigned int nand_rb0_pins[] = { PIN(BOOT_10, EE_OFF) }; 157 + static const unsigned int nand_ale_pins[] = { PIN(BOOT_11, EE_OFF) }; 158 + static const unsigned int nand_cle_pins[] = { PIN(BOOT_12, EE_OFF) }; 159 + static const unsigned int nand_wen_clk_pins[] = { PIN(BOOT_13, EE_OFF) }; 160 + static const unsigned int nand_ren_wr_pins[] = { PIN(BOOT_14, EE_OFF) }; 161 + static const unsigned int nand_dqs_pins[] = { PIN(BOOT_15, EE_OFF) }; 162 + 163 + static const unsigned int uart_tx_a_pins[] = { PIN(GPIOX_12, EE_OFF) }; 164 + static const unsigned int uart_rx_a_pins[] = { PIN(GPIOX_13, EE_OFF) }; 165 + static const unsigned int uart_cts_a_pins[] = { PIN(GPIOX_14, EE_OFF) }; 166 + static const unsigned int uart_rts_a_pins[] = { PIN(GPIOX_15, EE_OFF) }; 167 + 168 + static const unsigned int uart_tx_b_pins[] = { PIN(GPIODV_24, EE_OFF) }; 169 + static const unsigned int uart_rx_b_pins[] = { PIN(GPIODV_25, EE_OFF) }; 170 + 171 + static const unsigned int uart_tx_c_pins[] = { PIN(GPIOX_8, EE_OFF) }; 172 + static const unsigned int uart_rx_c_pins[] = { PIN(GPIOX_9, EE_OFF) }; 173 + 174 + static const unsigned int i2c_sck_a_pins[] = { PIN(GPIODV_25, EE_OFF) }; 175 + static const unsigned int i2c_sda_a_pins[] = { PIN(GPIODV_24, EE_OFF) }; 176 + 177 + static const unsigned int i2c_sck_b_pins[] = { PIN(GPIODV_27, EE_OFF) }; 178 + static const unsigned int i2c_sda_b_pins[] = { PIN(GPIODV_26, EE_OFF) }; 179 + 180 + static const unsigned int i2c_sck_c_pins[] = { PIN(GPIODV_29, EE_OFF) }; 181 + static const unsigned int i2c_sda_c_pins[] = { PIN(GPIODV_28, EE_OFF) }; 182 + 183 + static const unsigned int eth_mdio_pins[] = { PIN(GPIOZ_0, EE_OFF) }; 184 + static const unsigned int eth_mdc_pins[] = { PIN(GPIOZ_1, EE_OFF) }; 185 + static const unsigned int eth_clk_rx_clk_pins[] = { PIN(GPIOZ_2, EE_OFF) }; 186 + static const unsigned int eth_rx_dv_pins[] = { PIN(GPIOZ_3, EE_OFF) }; 187 + static const unsigned int eth_rxd0_pins[] = { PIN(GPIOZ_4, EE_OFF) }; 188 + static const unsigned int eth_rxd1_pins[] = { PIN(GPIOZ_5, EE_OFF) }; 189 + static const unsigned int eth_rxd2_pins[] = { PIN(GPIOZ_6, EE_OFF) }; 190 + static const unsigned int eth_rxd3_pins[] = { PIN(GPIOZ_7, EE_OFF) }; 191 + static const unsigned int eth_rgmii_tx_clk_pins[] = { PIN(GPIOZ_8, EE_OFF) }; 192 + static const unsigned int eth_tx_en_pins[] = { PIN(GPIOZ_9, EE_OFF) }; 193 + static const unsigned int eth_txd0_pins[] = { PIN(GPIOZ_10, EE_OFF) }; 194 + static const unsigned int eth_txd1_pins[] = { PIN(GPIOZ_11, EE_OFF) }; 195 + static const unsigned int eth_txd2_pins[] = { PIN(GPIOZ_12, EE_OFF) }; 196 + static const unsigned int eth_txd3_pins[] = { PIN(GPIOZ_13, EE_OFF) }; 197 + 198 + static const unsigned int pwm_e_pins[] = { PIN(GPIOX_16, EE_OFF) }; 199 + 200 + static const struct pinctrl_pin_desc meson_gxl_aobus_pins[] = { 201 + MESON_PIN(GPIOAO_0, 0), 202 + MESON_PIN(GPIOAO_1, 0), 203 + MESON_PIN(GPIOAO_2, 0), 204 + MESON_PIN(GPIOAO_3, 0), 205 + MESON_PIN(GPIOAO_4, 0), 206 + MESON_PIN(GPIOAO_5, 0), 207 + MESON_PIN(GPIOAO_6, 0), 208 + MESON_PIN(GPIOAO_7, 0), 209 + MESON_PIN(GPIOAO_8, 0), 210 + MESON_PIN(GPIOAO_9, 0), 211 + }; 212 + 213 + static const unsigned int uart_tx_ao_a_pins[] = { PIN(GPIOAO_0, 0) }; 214 + static const unsigned int uart_rx_ao_a_pins[] = { PIN(GPIOAO_1, 0) }; 215 + static const unsigned int uart_cts_ao_a_pins[] = { PIN(GPIOAO_2, 0) }; 216 + static const unsigned int uart_rts_ao_a_pins[] = { PIN(GPIOAO_3, 0) }; 217 + static const unsigned int uart_tx_ao_b_pins[] = { PIN(GPIOAO_0, 0) }; 218 + static const unsigned int uart_rx_ao_b_pins[] = { PIN(GPIOAO_1, 0), 219 + PIN(GPIOAO_5, 0) }; 220 + static const unsigned int uart_cts_ao_b_pins[] = { PIN(GPIOAO_2, 0) }; 221 + static const unsigned int uart_rts_ao_b_pins[] = { PIN(GPIOAO_3, 0) }; 222 + 223 + static const unsigned int remote_input_ao_pins[] = {PIN(GPIOAO_7, 0) }; 224 + 225 + static struct meson_pmx_group meson_gxl_periphs_groups[] = { 226 + GPIO_GROUP(GPIOZ_0, EE_OFF), 227 + GPIO_GROUP(GPIOZ_1, EE_OFF), 228 + GPIO_GROUP(GPIOZ_2, EE_OFF), 229 + GPIO_GROUP(GPIOZ_3, EE_OFF), 230 + GPIO_GROUP(GPIOZ_4, EE_OFF), 231 + GPIO_GROUP(GPIOZ_5, EE_OFF), 232 + GPIO_GROUP(GPIOZ_6, EE_OFF), 233 + GPIO_GROUP(GPIOZ_7, EE_OFF), 234 + GPIO_GROUP(GPIOZ_8, EE_OFF), 235 + GPIO_GROUP(GPIOZ_9, EE_OFF), 236 + GPIO_GROUP(GPIOZ_10, EE_OFF), 237 + GPIO_GROUP(GPIOZ_11, EE_OFF), 238 + GPIO_GROUP(GPIOZ_12, EE_OFF), 239 + GPIO_GROUP(GPIOZ_13, EE_OFF), 240 + GPIO_GROUP(GPIOZ_14, EE_OFF), 241 + GPIO_GROUP(GPIOZ_15, EE_OFF), 242 + 243 + GPIO_GROUP(GPIOH_0, EE_OFF), 244 + GPIO_GROUP(GPIOH_1, EE_OFF), 245 + GPIO_GROUP(GPIOH_2, EE_OFF), 246 + GPIO_GROUP(GPIOH_3, EE_OFF), 247 + GPIO_GROUP(GPIOH_4, EE_OFF), 248 + GPIO_GROUP(GPIOH_5, EE_OFF), 249 + GPIO_GROUP(GPIOH_6, EE_OFF), 250 + GPIO_GROUP(GPIOH_7, EE_OFF), 251 + GPIO_GROUP(GPIOH_8, EE_OFF), 252 + GPIO_GROUP(GPIOH_9, EE_OFF), 253 + 254 + GPIO_GROUP(BOOT_0, EE_OFF), 255 + GPIO_GROUP(BOOT_1, EE_OFF), 256 + GPIO_GROUP(BOOT_2, EE_OFF), 257 + GPIO_GROUP(BOOT_3, EE_OFF), 258 + GPIO_GROUP(BOOT_4, EE_OFF), 259 + GPIO_GROUP(BOOT_5, EE_OFF), 260 + GPIO_GROUP(BOOT_6, EE_OFF), 261 + GPIO_GROUP(BOOT_7, EE_OFF), 262 + GPIO_GROUP(BOOT_8, EE_OFF), 263 + GPIO_GROUP(BOOT_9, EE_OFF), 264 + GPIO_GROUP(BOOT_10, EE_OFF), 265 + GPIO_GROUP(BOOT_11, EE_OFF), 266 + GPIO_GROUP(BOOT_12, EE_OFF), 267 + GPIO_GROUP(BOOT_13, EE_OFF), 268 + GPIO_GROUP(BOOT_14, EE_OFF), 269 + GPIO_GROUP(BOOT_15, EE_OFF), 270 + 271 + GPIO_GROUP(CARD_0, EE_OFF), 272 + GPIO_GROUP(CARD_1, EE_OFF), 273 + GPIO_GROUP(CARD_2, EE_OFF), 274 + GPIO_GROUP(CARD_3, EE_OFF), 275 + GPIO_GROUP(CARD_4, EE_OFF), 276 + GPIO_GROUP(CARD_5, EE_OFF), 277 + GPIO_GROUP(CARD_6, EE_OFF), 278 + 279 + GPIO_GROUP(GPIODV_0, EE_OFF), 280 + GPIO_GROUP(GPIODV_1, EE_OFF), 281 + GPIO_GROUP(GPIODV_2, EE_OFF), 282 + GPIO_GROUP(GPIODV_3, EE_OFF), 283 + GPIO_GROUP(GPIODV_4, EE_OFF), 284 + GPIO_GROUP(GPIODV_5, EE_OFF), 285 + GPIO_GROUP(GPIODV_6, EE_OFF), 286 + GPIO_GROUP(GPIODV_7, EE_OFF), 287 + GPIO_GROUP(GPIODV_8, EE_OFF), 288 + GPIO_GROUP(GPIODV_9, EE_OFF), 289 + GPIO_GROUP(GPIODV_10, EE_OFF), 290 + GPIO_GROUP(GPIODV_11, EE_OFF), 291 + GPIO_GROUP(GPIODV_12, EE_OFF), 292 + GPIO_GROUP(GPIODV_13, EE_OFF), 293 + GPIO_GROUP(GPIODV_14, EE_OFF), 294 + GPIO_GROUP(GPIODV_15, EE_OFF), 295 + GPIO_GROUP(GPIODV_16, EE_OFF), 296 + GPIO_GROUP(GPIODV_17, EE_OFF), 297 + GPIO_GROUP(GPIODV_19, EE_OFF), 298 + GPIO_GROUP(GPIODV_20, EE_OFF), 299 + GPIO_GROUP(GPIODV_21, EE_OFF), 300 + GPIO_GROUP(GPIODV_22, EE_OFF), 301 + GPIO_GROUP(GPIODV_23, EE_OFF), 302 + GPIO_GROUP(GPIODV_24, EE_OFF), 303 + GPIO_GROUP(GPIODV_25, EE_OFF), 304 + GPIO_GROUP(GPIODV_26, EE_OFF), 305 + GPIO_GROUP(GPIODV_27, EE_OFF), 306 + GPIO_GROUP(GPIODV_28, EE_OFF), 307 + GPIO_GROUP(GPIODV_29, EE_OFF), 308 + 309 + GPIO_GROUP(GPIOX_0, EE_OFF), 310 + GPIO_GROUP(GPIOX_1, EE_OFF), 311 + GPIO_GROUP(GPIOX_2, EE_OFF), 312 + GPIO_GROUP(GPIOX_3, EE_OFF), 313 + GPIO_GROUP(GPIOX_4, EE_OFF), 314 + GPIO_GROUP(GPIOX_5, EE_OFF), 315 + GPIO_GROUP(GPIOX_6, EE_OFF), 316 + GPIO_GROUP(GPIOX_7, EE_OFF), 317 + GPIO_GROUP(GPIOX_8, EE_OFF), 318 + GPIO_GROUP(GPIOX_9, EE_OFF), 319 + GPIO_GROUP(GPIOX_10, EE_OFF), 320 + GPIO_GROUP(GPIOX_11, EE_OFF), 321 + GPIO_GROUP(GPIOX_12, EE_OFF), 322 + GPIO_GROUP(GPIOX_13, EE_OFF), 323 + GPIO_GROUP(GPIOX_14, EE_OFF), 324 + GPIO_GROUP(GPIOX_15, EE_OFF), 325 + GPIO_GROUP(GPIOX_16, EE_OFF), 326 + GPIO_GROUP(GPIOX_17, EE_OFF), 327 + GPIO_GROUP(GPIOX_18, EE_OFF), 328 + 329 + GPIO_GROUP(GPIOCLK_0, EE_OFF), 330 + GPIO_GROUP(GPIOCLK_1, EE_OFF), 331 + 332 + GPIO_GROUP(GPIO_TEST_N, EE_OFF), 333 + 334 + /* Bank X */ 335 + GROUP(sdio_d0, 5, 31), 336 + GROUP(sdio_d1, 5, 30), 337 + GROUP(sdio_d2, 5, 29), 338 + GROUP(sdio_d3, 5, 28), 339 + GROUP(sdio_cmd, 5, 27), 340 + GROUP(sdio_clk, 5, 26), 341 + GROUP(sdio_irq, 5, 24), 342 + GROUP(uart_tx_a, 5, 19), 343 + GROUP(uart_rx_a, 5, 18), 344 + GROUP(uart_cts_a, 5, 17), 345 + GROUP(uart_rts_a, 5, 16), 346 + GROUP(uart_tx_c, 5, 13), 347 + GROUP(uart_rx_c, 5, 12), 348 + GROUP(pwm_e, 5, 15), 349 + 350 + /* Bank Z */ 351 + GROUP(eth_mdio, 4, 22), 352 + GROUP(eth_mdc, 4, 23), 353 + GROUP(eth_clk_rx_clk, 4, 21), 354 + GROUP(eth_rx_dv, 4, 20), 355 + GROUP(eth_rxd0, 4, 19), 356 + GROUP(eth_rxd1, 4, 18), 357 + GROUP(eth_rxd2, 4, 17), 358 + GROUP(eth_rxd3, 4, 16), 359 + GROUP(eth_rgmii_tx_clk, 4, 15), 360 + GROUP(eth_tx_en, 4, 14), 361 + GROUP(eth_txd0, 4, 13), 362 + GROUP(eth_txd1, 4, 12), 363 + GROUP(eth_txd2, 4, 11), 364 + GROUP(eth_txd3, 4, 10), 365 + 366 + /* Bank DV */ 367 + GROUP(uart_tx_b, 2, 16), 368 + GROUP(uart_rx_b, 2, 15), 369 + GROUP(i2c_sck_a, 1, 15), 370 + GROUP(i2c_sda_a, 1, 14), 371 + GROUP(i2c_sck_b, 1, 13), 372 + GROUP(i2c_sda_b, 1, 12), 373 + GROUP(i2c_sck_c, 1, 11), 374 + GROUP(i2c_sda_c, 1, 10), 375 + 376 + /* Bank BOOT */ 377 + GROUP(emmc_nand_d07, 7, 31), 378 + GROUP(emmc_clk, 7, 30), 379 + GROUP(emmc_cmd, 7, 29), 380 + GROUP(emmc_ds, 7, 28), 381 + GROUP(nand_ce0, 7, 7), 382 + GROUP(nand_ce1, 7, 6), 383 + GROUP(nand_rb0, 7, 5), 384 + GROUP(nand_ale, 7, 4), 385 + GROUP(nand_cle, 7, 3), 386 + GROUP(nand_wen_clk, 7, 2), 387 + GROUP(nand_ren_wr, 7, 1), 388 + GROUP(nand_dqs, 7, 0), 389 + 390 + /* Bank CARD */ 391 + GROUP(sdcard_d1, 6, 5), 392 + GROUP(sdcard_d0, 6, 4), 393 + GROUP(sdcard_d3, 6, 1), 394 + GROUP(sdcard_d2, 6, 0), 395 + GROUP(sdcard_cmd, 6, 2), 396 + GROUP(sdcard_clk, 6, 3), 397 + }; 398 + 399 + static struct meson_pmx_group meson_gxl_aobus_groups[] = { 400 + GPIO_GROUP(GPIOAO_0, 0), 401 + GPIO_GROUP(GPIOAO_1, 0), 402 + GPIO_GROUP(GPIOAO_2, 0), 403 + GPIO_GROUP(GPIOAO_3, 0), 404 + GPIO_GROUP(GPIOAO_4, 0), 405 + GPIO_GROUP(GPIOAO_5, 0), 406 + GPIO_GROUP(GPIOAO_6, 0), 407 + GPIO_GROUP(GPIOAO_7, 0), 408 + GPIO_GROUP(GPIOAO_8, 0), 409 + GPIO_GROUP(GPIOAO_9, 0), 410 + 411 + /* bank AO */ 412 + GROUP(uart_tx_ao_b, 0, 26), 413 + GROUP(uart_rx_ao_b, 0, 25), 414 + GROUP(uart_tx_ao_a, 0, 12), 415 + GROUP(uart_rx_ao_a, 0, 11), 416 + GROUP(uart_cts_ao_a, 0, 10), 417 + GROUP(uart_rts_ao_a, 0, 9), 418 + GROUP(uart_cts_ao_b, 0, 8), 419 + GROUP(uart_rts_ao_b, 0, 7), 420 + GROUP(remote_input_ao, 0, 0), 421 + }; 422 + 423 + static const char * const gpio_periphs_groups[] = { 424 + "GPIOZ_0", "GPIOZ_1", "GPIOZ_2", "GPIOZ_3", "GPIOZ_4", 425 + "GPIOZ_5", "GPIOZ_6", "GPIOZ_7", "GPIOZ_8", "GPIOZ_9", 426 + "GPIOZ_10", "GPIOZ_11", "GPIOZ_12", "GPIOZ_13", "GPIOZ_14", 427 + "GPIOZ_15", 428 + 429 + "GPIOH_0", "GPIOH_1", "GPIOH_2", "GPIOH_3", "GPIOH_4", 430 + "GPIOH_5", "GPIOH_6", "GPIOH_7", "GPIOH_8", "GPIOH_9", 431 + 432 + "BOOT_0", "BOOT_1", "BOOT_2", "BOOT_3", "BOOT_4", 433 + "BOOT_5", "BOOT_6", "BOOT_7", "BOOT_8", "BOOT_9", 434 + "BOOT_10", "BOOT_11", "BOOT_12", "BOOT_13", "BOOT_14", 435 + "BOOT_15", 436 + 437 + "CARD_0", "CARD_1", "CARD_2", "CARD_3", "CARD_4", 438 + "CARD_5", "CARD_6", 439 + 440 + "GPIODV_0", "GPIODV_1", "GPIODV_2", "GPIODV_3", "GPIODV_4", 441 + "GPIODV_5", "GPIODV_6", "GPIODV_7", "GPIODV_8", "GPIODV_9", 442 + "GPIODV_10", "GPIODV_11", "GPIODV_12", "GPIODV_13", "GPIODV_14", 443 + "GPIODV_15", "GPIODV_16", "GPIODV_17", "GPIODV_18", "GPIODV_19", 444 + "GPIODV_20", "GPIODV_21", "GPIODV_22", "GPIODV_23", "GPIODV_24", 445 + "GPIODV_25", "GPIODV_26", "GPIODV_27", "GPIODV_28", "GPIODV_29", 446 + 447 + "GPIOX_0", "GPIOX_1", "GPIOX_2", "GPIOX_3", "GPIOX_4", 448 + "GPIOX_5", "GPIOX_6", "GPIOX_7", "GPIOX_8", "GPIOX_9", 449 + "GPIOX_10", "GPIOX_11", "GPIOX_12", "GPIOX_13", "GPIOX_14", 450 + "GPIOX_15", "GPIOX_16", "GPIOX_17", "GPIOX_18", 451 + 452 + "GPIO_TEST_N", 453 + }; 454 + 455 + static const char * const emmc_groups[] = { 456 + "emmc_nand_d07", "emmc_clk", "emmc_cmd", "emmc_ds", 457 + }; 458 + 459 + static const char * const sdcard_groups[] = { 460 + "sdcard_d0", "sdcard_d1", "sdcard_d2", "sdcard_d3", 461 + "sdcard_cmd", "sdcard_clk", 462 + }; 463 + 464 + static const char * const sdio_groups[] = { 465 + "sdio_d0", "sdio_d1", "sdio_d2", "sdio_d3", 466 + "sdio_cmd", "sdio_clk", "sdio_irq", 467 + }; 468 + 469 + static const char * const nand_groups[] = { 470 + "nand_ce0", "nand_ce1", "nand_rb0", "nand_ale", "nand_cle", 471 + "nand_wen_clk", "nand_ren_wr", "nand_dqs", 472 + }; 473 + 474 + static const char * const uart_a_groups[] = { 475 + "uart_tx_a", "uart_rx_a", "uart_cts_a", "uart_rts_a", 476 + }; 477 + 478 + static const char * const uart_b_groups[] = { 479 + "uart_tx_b", "uart_rx_b", 480 + }; 481 + 482 + static const char * const uart_c_groups[] = { 483 + "uart_tx_c", "uart_rx_c", 484 + }; 485 + 486 + static const char * const i2c_a_groups[] = { 487 + "i2c_sck_a", "i2c_sda_a", 488 + }; 489 + 490 + static const char * const i2c_b_groups[] = { 491 + "i2c_sck_b", "i2c_sda_b", 492 + }; 493 + 494 + static const char * const i2c_c_groups[] = { 495 + "i2c_sck_c", "i2c_sda_c", 496 + }; 497 + 498 + static const char * const eth_groups[] = { 499 + "eth_mdio", "eth_mdc", "eth_clk_rx_clk", "eth_rx_dv", 500 + "eth_rxd0", "eth_rxd1", "eth_rxd2", "eth_rxd3", 501 + "eth_rgmii_tx_clk", "eth_tx_en", 502 + "eth_txd0", "eth_txd1", "eth_txd2", "eth_txd3", 503 + }; 504 + 505 + static const char * const pwm_e_groups[] = { 506 + "pwm_e", 507 + }; 508 + 509 + static const char * const gpio_aobus_groups[] = { 510 + "GPIOAO_0", "GPIOAO_1", "GPIOAO_2", "GPIOAO_3", "GPIOAO_4", 511 + "GPIOAO_5", "GPIOAO_6", "GPIOAO_7", "GPIOAO_8", "GPIOAO_9", 512 + }; 513 + 514 + static const char * const uart_ao_groups[] = { 515 + "uart_tx_ao_a", "uart_rx_ao_a", "uart_cts_ao_a", "uart_rts_ao_a", 516 + }; 517 + 518 + static const char * const uart_ao_b_groups[] = { 519 + "uart_tx_ao_b", "uart_rx_ao_b", "uart_cts_ao_b", "uart_rts_ao_b", 520 + }; 521 + 522 + static const char * const remote_input_ao_groups[] = { 523 + "remote_input_ao", 524 + }; 525 + 526 + static struct meson_pmx_func meson_gxl_periphs_functions[] = { 527 + FUNCTION(gpio_periphs), 528 + FUNCTION(emmc), 529 + FUNCTION(sdcard), 530 + FUNCTION(sdio), 531 + FUNCTION(nand), 532 + FUNCTION(uart_a), 533 + FUNCTION(uart_b), 534 + FUNCTION(uart_c), 535 + FUNCTION(i2c_a), 536 + FUNCTION(i2c_b), 537 + FUNCTION(i2c_c), 538 + FUNCTION(eth), 539 + FUNCTION(pwm_e), 540 + }; 541 + 542 + static struct meson_pmx_func meson_gxl_aobus_functions[] = { 543 + FUNCTION(gpio_aobus), 544 + FUNCTION(uart_ao), 545 + FUNCTION(uart_ao_b), 546 + FUNCTION(remote_input_ao), 547 + }; 548 + 549 + static struct meson_bank meson_gxl_periphs_banks[] = { 550 + /* name first last pullen pull dir out in */ 551 + BANK("X", PIN(GPIOX_0, EE_OFF), PIN(GPIOX_18, EE_OFF), 4, 0, 4, 0, 12, 0, 13, 0, 14, 0), 552 + BANK("DV", PIN(GPIODV_0, EE_OFF), PIN(GPIODV_29, EE_OFF), 0, 0, 0, 0, 0, 0, 1, 0, 2, 0), 553 + BANK("H", PIN(GPIOH_0, EE_OFF), PIN(GPIOH_9, EE_OFF), 1, 20, 1, 20, 3, 20, 4, 20, 5, 20), 554 + BANK("Z", PIN(GPIOZ_0, EE_OFF), PIN(GPIOZ_15, EE_OFF), 3, 0, 3, 0, 9, 0, 10, 0, 11, 0), 555 + BANK("CARD", PIN(CARD_0, EE_OFF), PIN(CARD_6, EE_OFF), 2, 20, 2, 20, 6, 20, 7, 20, 8, 20), 556 + BANK("BOOT", PIN(BOOT_0, EE_OFF), PIN(BOOT_15, EE_OFF), 2, 0, 2, 0, 6, 0, 7, 0, 8, 0), 557 + BANK("CLK", PIN(GPIOCLK_0, EE_OFF), PIN(GPIOCLK_1, EE_OFF), 3, 28, 3, 28, 9, 28, 10, 28, 11, 28), 558 + }; 559 + 560 + static struct meson_bank meson_gxl_aobus_banks[] = { 561 + /* name first last pullen pull dir out in */ 562 + BANK("AO", PIN(GPIOAO_0, 0), PIN(GPIOAO_9, 0), 0, 0, 0, 16, 0, 0, 0, 16, 1, 0), 563 + }; 564 + 565 + struct meson_pinctrl_data meson_gxl_periphs_pinctrl_data = { 566 + .name = "periphs-banks", 567 + .pin_base = 10, 568 + .pins = meson_gxl_periphs_pins, 569 + .groups = meson_gxl_periphs_groups, 570 + .funcs = meson_gxl_periphs_functions, 571 + .banks = meson_gxl_periphs_banks, 572 + .num_pins = ARRAY_SIZE(meson_gxl_periphs_pins), 573 + .num_groups = ARRAY_SIZE(meson_gxl_periphs_groups), 574 + .num_funcs = ARRAY_SIZE(meson_gxl_periphs_functions), 575 + .num_banks = ARRAY_SIZE(meson_gxl_periphs_banks), 576 + }; 577 + 578 + struct meson_pinctrl_data meson_gxl_aobus_pinctrl_data = { 579 + .name = "aobus-banks", 580 + .pin_base = 0, 581 + .pins = meson_gxl_aobus_pins, 582 + .groups = meson_gxl_aobus_groups, 583 + .funcs = meson_gxl_aobus_functions, 584 + .banks = meson_gxl_aobus_banks, 585 + .num_pins = ARRAY_SIZE(meson_gxl_aobus_pins), 586 + .num_groups = ARRAY_SIZE(meson_gxl_aobus_groups), 587 + .num_funcs = ARRAY_SIZE(meson_gxl_aobus_functions), 588 + .num_banks = ARRAY_SIZE(meson_gxl_aobus_banks), 589 + };
+8
drivers/pinctrl/meson/pinctrl-meson.c
··· 524 524 .compatible = "amlogic,meson-gxbb-aobus-pinctrl", 525 525 .data = &meson_gxbb_aobus_pinctrl_data, 526 526 }, 527 + { 528 + .compatible = "amlogic,meson-gxl-periphs-pinctrl", 529 + .data = &meson_gxl_periphs_pinctrl_data, 530 + }, 531 + { 532 + .compatible = "amlogic,meson-gxl-aobus-pinctrl", 533 + .data = &meson_gxl_aobus_pinctrl_data, 534 + }, 527 535 { }, 528 536 }; 529 537
+2
drivers/pinctrl/meson/pinctrl-meson.h
··· 169 169 extern struct meson_pinctrl_data meson8b_aobus_pinctrl_data; 170 170 extern struct meson_pinctrl_data meson_gxbb_periphs_pinctrl_data; 171 171 extern struct meson_pinctrl_data meson_gxbb_aobus_pinctrl_data; 172 + extern struct meson_pinctrl_data meson_gxl_periphs_pinctrl_data; 173 + extern struct meson_pinctrl_data meson_gxl_aobus_pinctrl_data;
+17 -6
drivers/pinctrl/nomadik/pinctrl-nomadik-db8500.c
··· 379 379 static const unsigned msp0tfstck_a_1_pins[] = { DB8500_PIN_AF3, DB8500_PIN_AE3 }; 380 380 static const unsigned msp0rfsrck_a_1_pins[] = { DB8500_PIN_AD3, DB8500_PIN_AD4 }; 381 381 /* Basic pins of the MMC/SD card 0 interface */ 382 - static const unsigned mc0_a_1_pins[] = { DB8500_PIN_AC2, DB8500_PIN_AC1, 383 - DB8500_PIN_AB4, DB8500_PIN_AA3, DB8500_PIN_AA4, DB8500_PIN_AB2, 384 - DB8500_PIN_Y4, DB8500_PIN_Y2, DB8500_PIN_AA2, DB8500_PIN_AA1 }; 382 + static const unsigned mc0_a_1_pins[] = { DB8500_PIN_AC2, /* MC0_CMDDIR */ 383 + DB8500_PIN_AC1, /* MC0_DAT0DIR */ 384 + DB8500_PIN_AB4, /* MC0_DAT2DIR */ 385 + DB8500_PIN_AA3, /* MC0_FBCLK */ 386 + DB8500_PIN_AA4, /* MC0_CLK */ 387 + DB8500_PIN_AB2, /* MC0_CMD */ 388 + DB8500_PIN_Y4, /* MC0_DAT0 */ 389 + DB8500_PIN_Y2, /* MC0_DAT1 */ 390 + DB8500_PIN_AA2, /* MC0_DAT2 */ 391 + DB8500_PIN_AA1 /* MC0_DAT3 */ 392 + }; 385 393 /* Often only 4 bits are used, then these are not needed (only used for MMC) */ 386 - static const unsigned mc0_dat47_a_1_pins[] = { DB8500_PIN_W2, DB8500_PIN_W3, 387 - DB8500_PIN_V3, DB8500_PIN_V2}; 388 - static const unsigned mc0dat31dir_a_1_pins[] = { DB8500_PIN_AB3 }; 394 + static const unsigned mc0_dat47_a_1_pins[] = { DB8500_PIN_W2, /* MC0_DAT4 */ 395 + DB8500_PIN_W3, /* MC0_DAT5 */ 396 + DB8500_PIN_V3, /* MC0_DAT6 */ 397 + DB8500_PIN_V2 /* MC0_DAT7 */ 398 + }; 399 + static const unsigned mc0dat31dir_a_1_pins[] = { DB8500_PIN_AB3 }; /* MC0_DAT31DIR */ 389 400 /* MSP1 can only be on these pins, but TXD and RXD can be flipped */ 390 401 static const unsigned msp1txrx_a_1_pins[] = { DB8500_PIN_AF2, DB8500_PIN_AG2 }; 391 402 static const unsigned msp1_a_1_pins[] = { DB8500_PIN_AE1, DB8500_PIN_AE2 };
+1 -1
drivers/pinctrl/pinconf-generic.c
··· 381 381 if (ret < 0) 382 382 goto exit; 383 383 384 - for_each_child_of_node(np_config, np) { 384 + for_each_available_child_of_node(np_config, np) { 385 385 ret = pinconf_generic_dt_subnode_to_map(pctldev, np, map, 386 386 &reserved_maps, num_maps, type); 387 387 if (ret < 0)
+21
drivers/pinctrl/pinctrl-at91.c
··· 56 56 #define DRIVE_STRENGTH_SHIFT 5 57 57 #define DRIVE_STRENGTH_MASK 0x3 58 58 #define DRIVE_STRENGTH (DRIVE_STRENGTH_MASK << DRIVE_STRENGTH_SHIFT) 59 + #define OUTPUT (1 << 7) 60 + #define OUTPUT_VAL_SHIFT 8 61 + #define OUTPUT_VAL (0x1 << OUTPUT_VAL_SHIFT) 59 62 #define DEBOUNCE (1 << 16) 60 63 #define DEBOUNCE_VAL_SHIFT 17 61 64 #define DEBOUNCE_VAL (0x3fff << DEBOUNCE_VAL_SHIFT) ··· 376 373 writel_relaxed(mask, pio + PIO_PPDDR); 377 374 378 375 writel_relaxed(mask, pio + (on ? PIO_PUER : PIO_PUDR)); 376 + } 377 + 378 + static bool at91_mux_get_output(void __iomem *pio, unsigned int pin, bool *val) 379 + { 380 + *val = (readl_relaxed(pio + PIO_ODSR) >> pin) & 0x1; 381 + return (readl_relaxed(pio + PIO_OSR) >> pin) & 0x1; 382 + } 383 + 384 + static void at91_mux_set_output(void __iomem *pio, unsigned int mask, 385 + bool is_on, bool val) 386 + { 387 + writel_relaxed(mask, pio + (val ? PIO_SODR : PIO_CODR)); 388 + writel_relaxed(mask, pio + (is_on ? PIO_OER : PIO_ODR)); 379 389 } 380 390 381 391 static unsigned at91_mux_get_multidrive(void __iomem *pio, unsigned pin) ··· 864 848 void __iomem *pio; 865 849 unsigned pin; 866 850 int div; 851 + bool out; 867 852 868 853 *config = 0; 869 854 dev_dbg(info->dev, "%s:%d, pin_id=%d", __func__, __LINE__, pin_id); ··· 892 875 if (info->ops->get_drivestrength) 893 876 *config |= (info->ops->get_drivestrength(pio, pin) 894 877 << DRIVE_STRENGTH_SHIFT); 878 + if (at91_mux_get_output(pio, pin, &out)) 879 + *config |= OUTPUT | (out << OUTPUT_VAL_SHIFT); 895 880 896 881 return 0; 897 882 } ··· 926 907 if (config & PULL_UP && config & PULL_DOWN) 927 908 return -EINVAL; 928 909 910 + at91_mux_set_output(pio, mask, config & OUTPUT, 911 + (config & OUTPUT_VAL) >> OUTPUT_VAL_SHIFT); 929 912 at91_mux_set_pullup(pio, mask, config & PULL_UP); 930 913 at91_mux_set_multidrive(pio, mask, config & MULTI_DRIVE); 931 914 if (info->ops->set_deglitch)
+210
drivers/pinctrl/pinctrl-da850-pupd.c
··· 1 + /* 2 + * Pinconf driver for TI DA850/OMAP-L138/AM18XX pullup/pulldown groups 3 + * 4 + * Copyright (C) 2016 David Lechner 5 + * 6 + * This program is free software; you can redistribute it and/or modify it 7 + * under the terms of the GNU General Public License as published by the Free 8 + * Software Foundation; version 2 of the License. 9 + * 10 + * This program is distributed in the hope that it will be useful, but WITHOUT 11 + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 12 + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for 13 + * more details. 14 + */ 15 + 16 + #include <linux/bitops.h> 17 + #include <linux/device.h> 18 + #include <linux/io.h> 19 + #include <linux/ioport.h> 20 + #include <linux/mod_devicetable.h> 21 + #include <linux/module.h> 22 + #include <linux/pinctrl/pinconf.h> 23 + #include <linux/pinctrl/pinconf-generic.h> 24 + #include <linux/pinctrl/pinctrl.h> 25 + #include <linux/platform_device.h> 26 + 27 + #define DA850_PUPD_ENA 0x00 28 + #define DA850_PUPD_SEL 0x04 29 + 30 + struct da850_pupd_data { 31 + void __iomem *base; 32 + struct pinctrl_desc desc; 33 + struct pinctrl_dev *pinctrl; 34 + }; 35 + 36 + static const char * const da850_pupd_group_names[] = { 37 + "cp0", "cp1", "cp2", "cp3", "cp4", "cp5", "cp6", "cp7", 38 + "cp8", "cp9", "cp10", "cp11", "cp12", "cp13", "cp14", "cp15", 39 + "cp16", "cp17", "cp18", "cp19", "cp20", "cp21", "cp22", "cp23", 40 + "cp24", "cp25", "cp26", "cp27", "cp28", "cp29", "cp30", "cp31", 41 + }; 42 + 43 + static int da850_pupd_get_groups_count(struct pinctrl_dev *pctldev) 44 + { 45 + return ARRAY_SIZE(da850_pupd_group_names); 46 + } 47 + 48 + static const char *da850_pupd_get_group_name(struct pinctrl_dev *pctldev, 49 + unsigned int selector) 50 + { 51 + return da850_pupd_group_names[selector]; 52 + } 53 + 54 + static int da850_pupd_get_group_pins(struct pinctrl_dev *pctldev, 55 + unsigned int selector, 56 + const unsigned int **pins, 57 + unsigned int *num_pins) 58 + { 59 + *num_pins = 0; 60 + 61 + return 0; 62 + } 63 + 64 + static const struct pinctrl_ops da850_pupd_pctlops = { 65 + .get_groups_count = da850_pupd_get_groups_count, 66 + .get_group_name = da850_pupd_get_group_name, 67 + .get_group_pins = da850_pupd_get_group_pins, 68 + .dt_node_to_map = pinconf_generic_dt_node_to_map_group, 69 + .dt_free_map = pinconf_generic_dt_free_map, 70 + }; 71 + 72 + static int da850_pupd_pin_config_group_get(struct pinctrl_dev *pctldev, 73 + unsigned int selector, 74 + unsigned long *config) 75 + { 76 + struct da850_pupd_data *data = pinctrl_dev_get_drvdata(pctldev); 77 + enum pin_config_param param = pinconf_to_config_param(*config); 78 + u32 val; 79 + u16 arg; 80 + 81 + val = readl(data->base + DA850_PUPD_ENA); 82 + arg = !!(~val & BIT(selector)); 83 + 84 + switch (param) { 85 + case PIN_CONFIG_BIAS_DISABLE: 86 + break; 87 + case PIN_CONFIG_BIAS_PULL_UP: 88 + case PIN_CONFIG_BIAS_PULL_DOWN: 89 + if (arg) { 90 + /* bias is disabled */ 91 + arg = 0; 92 + break; 93 + } 94 + val = readl(data->base + DA850_PUPD_SEL); 95 + if (param == PIN_CONFIG_BIAS_PULL_DOWN) 96 + val = ~val; 97 + arg = !!(val & BIT(selector)); 98 + break; 99 + default: 100 + return -EINVAL; 101 + } 102 + 103 + *config = pinconf_to_config_packed(param, arg); 104 + 105 + return 0; 106 + } 107 + 108 + static int da850_pupd_pin_config_group_set(struct pinctrl_dev *pctldev, 109 + unsigned int selector, 110 + unsigned long *configs, 111 + unsigned int num_configs) 112 + { 113 + struct da850_pupd_data *data = pinctrl_dev_get_drvdata(pctldev); 114 + u32 ena, sel; 115 + enum pin_config_param param; 116 + u16 arg; 117 + int i; 118 + 119 + ena = readl(data->base + DA850_PUPD_ENA); 120 + sel = readl(data->base + DA850_PUPD_SEL); 121 + 122 + for (i = 0; i < num_configs; i++) { 123 + param = pinconf_to_config_param(configs[i]); 124 + arg = pinconf_to_config_argument(configs[i]); 125 + 126 + switch (param) { 127 + case PIN_CONFIG_BIAS_DISABLE: 128 + ena &= ~BIT(selector); 129 + break; 130 + case PIN_CONFIG_BIAS_PULL_UP: 131 + ena |= BIT(selector); 132 + sel |= BIT(selector); 133 + break; 134 + case PIN_CONFIG_BIAS_PULL_DOWN: 135 + ena |= BIT(selector); 136 + sel &= ~BIT(selector); 137 + break; 138 + default: 139 + return -EINVAL; 140 + } 141 + } 142 + 143 + writel(sel, data->base + DA850_PUPD_SEL); 144 + writel(ena, data->base + DA850_PUPD_ENA); 145 + 146 + return 0; 147 + } 148 + 149 + static const struct pinconf_ops da850_pupd_confops = { 150 + .is_generic = true, 151 + .pin_config_group_get = da850_pupd_pin_config_group_get, 152 + .pin_config_group_set = da850_pupd_pin_config_group_set, 153 + }; 154 + 155 + static int da850_pupd_probe(struct platform_device *pdev) 156 + { 157 + struct device *dev = &pdev->dev; 158 + struct da850_pupd_data *data; 159 + struct resource *res; 160 + 161 + data = devm_kzalloc(dev, sizeof(*data), GFP_KERNEL); 162 + if (!data) 163 + return -ENOMEM; 164 + 165 + res = platform_get_resource(pdev, IORESOURCE_MEM, 0); 166 + data->base = devm_ioremap_resource(dev, res); 167 + if (IS_ERR(data->base)) { 168 + dev_err(dev, "Could not map resource\n"); 169 + return PTR_ERR(data->base); 170 + } 171 + 172 + data->desc.name = dev_name(dev); 173 + data->desc.pctlops = &da850_pupd_pctlops; 174 + data->desc.confops = &da850_pupd_confops; 175 + data->desc.owner = THIS_MODULE; 176 + 177 + data->pinctrl = devm_pinctrl_register(dev, &data->desc, data); 178 + if (IS_ERR(data->pinctrl)) { 179 + dev_err(dev, "Failed to register pinctrl\n"); 180 + return PTR_ERR(data->pinctrl); 181 + } 182 + 183 + platform_set_drvdata(pdev, data); 184 + 185 + return 0; 186 + } 187 + 188 + static int da850_pupd_remove(struct platform_device *pdev) 189 + { 190 + return 0; 191 + } 192 + 193 + static const struct of_device_id da850_pupd_of_match[] = { 194 + { .compatible = "ti,da850-pupd" }, 195 + { } 196 + }; 197 + 198 + static struct platform_driver da850_pupd_driver = { 199 + .driver = { 200 + .name = "ti-da850-pupd", 201 + .of_match_table = da850_pupd_of_match, 202 + }, 203 + .probe = da850_pupd_probe, 204 + .remove = da850_pupd_remove, 205 + }; 206 + module_platform_driver(da850_pupd_driver); 207 + 208 + MODULE_AUTHOR("David Lechner <david@lechnology.com>"); 209 + MODULE_DESCRIPTION("TI DA850/OMAP-L138/AM18XX pullup/pulldown configuration"); 210 + MODULE_LICENSE("GPL");
+532 -73
drivers/pinctrl/pinctrl-oxnas.c
··· 37 37 38 38 #define GPIO_BANK_START(bank) ((bank) * PINS_PER_BANK) 39 39 40 - /* Regmap Offsets */ 41 - #define PINMUX_PRIMARY_SEL0 0x0c 42 - #define PINMUX_SECONDARY_SEL0 0x14 43 - #define PINMUX_TERTIARY_SEL0 0x8c 44 - #define PINMUX_PRIMARY_SEL1 0x10 45 - #define PINMUX_SECONDARY_SEL1 0x18 46 - #define PINMUX_TERTIARY_SEL1 0x90 47 - #define PINMUX_PULLUP_CTRL0 0xac 48 - #define PINMUX_PULLUP_CTRL1 0xb0 40 + /* OX810 Regmap Offsets */ 41 + #define PINMUX_810_PRIMARY_SEL0 0x0c 42 + #define PINMUX_810_SECONDARY_SEL0 0x14 43 + #define PINMUX_810_TERTIARY_SEL0 0x8c 44 + #define PINMUX_810_PRIMARY_SEL1 0x10 45 + #define PINMUX_810_SECONDARY_SEL1 0x18 46 + #define PINMUX_810_TERTIARY_SEL1 0x90 47 + #define PINMUX_810_PULLUP_CTRL0 0xac 48 + #define PINMUX_810_PULLUP_CTRL1 0xb0 49 + 50 + /* OX820 Regmap Offsets */ 51 + #define PINMUX_820_BANK_OFFSET 0x100000 52 + #define PINMUX_820_SECONDARY_SEL 0x14 53 + #define PINMUX_820_TERTIARY_SEL 0x8c 54 + #define PINMUX_820_QUATERNARY_SEL 0x94 55 + #define PINMUX_820_DEBUG_SEL 0x9c 56 + #define PINMUX_820_ALTERNATIVE_SEL 0xa4 57 + #define PINMUX_820_PULLUP_CTRL 0xac 49 58 50 59 /* GPIO Registers */ 51 60 #define INPUT_VALUE 0x00 ··· 96 87 struct regmap *regmap; 97 88 struct device *dev; 98 89 struct pinctrl_dev *pctldev; 99 - const struct pinctrl_pin_desc *pins; 100 - unsigned int npins; 101 90 const struct oxnas_function *functions; 102 91 unsigned int nfunctions; 103 92 const struct oxnas_pin_group *groups; ··· 104 97 unsigned int nbanks; 105 98 }; 106 99 107 - static const struct pinctrl_pin_desc oxnas_pins[] = { 100 + struct oxnas_pinctrl_data { 101 + struct pinctrl_desc *desc; 102 + struct oxnas_pinctrl *pctl; 103 + }; 104 + 105 + static const struct pinctrl_pin_desc oxnas_ox810se_pins[] = { 108 106 PINCTRL_PIN(0, "gpio0"), 109 107 PINCTRL_PIN(1, "gpio1"), 110 108 PINCTRL_PIN(2, "gpio2"), ··· 147 135 PINCTRL_PIN(34, "gpio34"), 148 136 }; 149 137 150 - static const char * const oxnas_fct0_group[] = { 138 + static const struct pinctrl_pin_desc oxnas_ox820_pins[] = { 139 + PINCTRL_PIN(0, "gpio0"), 140 + PINCTRL_PIN(1, "gpio1"), 141 + PINCTRL_PIN(2, "gpio2"), 142 + PINCTRL_PIN(3, "gpio3"), 143 + PINCTRL_PIN(4, "gpio4"), 144 + PINCTRL_PIN(5, "gpio5"), 145 + PINCTRL_PIN(6, "gpio6"), 146 + PINCTRL_PIN(7, "gpio7"), 147 + PINCTRL_PIN(8, "gpio8"), 148 + PINCTRL_PIN(9, "gpio9"), 149 + PINCTRL_PIN(10, "gpio10"), 150 + PINCTRL_PIN(11, "gpio11"), 151 + PINCTRL_PIN(12, "gpio12"), 152 + PINCTRL_PIN(13, "gpio13"), 153 + PINCTRL_PIN(14, "gpio14"), 154 + PINCTRL_PIN(15, "gpio15"), 155 + PINCTRL_PIN(16, "gpio16"), 156 + PINCTRL_PIN(17, "gpio17"), 157 + PINCTRL_PIN(18, "gpio18"), 158 + PINCTRL_PIN(19, "gpio19"), 159 + PINCTRL_PIN(20, "gpio20"), 160 + PINCTRL_PIN(21, "gpio21"), 161 + PINCTRL_PIN(22, "gpio22"), 162 + PINCTRL_PIN(23, "gpio23"), 163 + PINCTRL_PIN(24, "gpio24"), 164 + PINCTRL_PIN(25, "gpio25"), 165 + PINCTRL_PIN(26, "gpio26"), 166 + PINCTRL_PIN(27, "gpio27"), 167 + PINCTRL_PIN(28, "gpio28"), 168 + PINCTRL_PIN(29, "gpio29"), 169 + PINCTRL_PIN(30, "gpio30"), 170 + PINCTRL_PIN(31, "gpio31"), 171 + PINCTRL_PIN(32, "gpio32"), 172 + PINCTRL_PIN(33, "gpio33"), 173 + PINCTRL_PIN(34, "gpio34"), 174 + PINCTRL_PIN(35, "gpio35"), 175 + PINCTRL_PIN(36, "gpio36"), 176 + PINCTRL_PIN(37, "gpio37"), 177 + PINCTRL_PIN(38, "gpio38"), 178 + PINCTRL_PIN(39, "gpio39"), 179 + PINCTRL_PIN(40, "gpio40"), 180 + PINCTRL_PIN(41, "gpio41"), 181 + PINCTRL_PIN(42, "gpio42"), 182 + PINCTRL_PIN(43, "gpio43"), 183 + PINCTRL_PIN(44, "gpio44"), 184 + PINCTRL_PIN(45, "gpio45"), 185 + PINCTRL_PIN(46, "gpio46"), 186 + PINCTRL_PIN(47, "gpio47"), 187 + PINCTRL_PIN(48, "gpio48"), 188 + PINCTRL_PIN(49, "gpio49"), 189 + }; 190 + 191 + static const char * const oxnas_ox810se_fct0_group[] = { 151 192 "gpio0", "gpio1", "gpio2", "gpio3", 152 193 "gpio4", "gpio5", "gpio6", "gpio7", 153 194 "gpio8", "gpio9", "gpio10", "gpio11", ··· 212 147 "gpio32", "gpio33", "gpio34" 213 148 }; 214 149 215 - static const char * const oxnas_fct3_group[] = { 150 + static const char * const oxnas_ox810se_fct3_group[] = { 216 151 "gpio0", "gpio1", "gpio2", "gpio3", 217 152 "gpio4", "gpio5", "gpio6", "gpio7", 218 153 "gpio8", "gpio9", ··· 223 158 "gpio34" 224 159 }; 225 160 161 + static const char * const oxnas_ox820_fct0_group[] = { 162 + "gpio0", "gpio1", "gpio2", "gpio3", 163 + "gpio4", "gpio5", "gpio6", "gpio7", 164 + "gpio8", "gpio9", "gpio10", "gpio11", 165 + "gpio12", "gpio13", "gpio14", "gpio15", 166 + "gpio16", "gpio17", "gpio18", "gpio19", 167 + "gpio20", "gpio21", "gpio22", "gpio23", 168 + "gpio24", "gpio25", "gpio26", "gpio27", 169 + "gpio28", "gpio29", "gpio30", "gpio31", 170 + "gpio32", "gpio33", "gpio34", "gpio35", 171 + "gpio36", "gpio37", "gpio38", "gpio39", 172 + "gpio40", "gpio41", "gpio42", "gpio43", 173 + "gpio44", "gpio45", "gpio46", "gpio47", 174 + "gpio48", "gpio49" 175 + }; 176 + 177 + static const char * const oxnas_ox820_fct1_group[] = { 178 + "gpio3", "gpio4", 179 + "gpio12", "gpio13", "gpio14", "gpio15", 180 + "gpio16", "gpio17", "gpio18", "gpio19", 181 + "gpio20", "gpio21", "gpio22", "gpio23", 182 + "gpio24" 183 + }; 184 + 185 + static const char * const oxnas_ox820_fct4_group[] = { 186 + "gpio5", "gpio6", "gpio7", "gpio8", 187 + "gpio24", "gpio25", "gpio26", "gpio27", 188 + "gpio40", "gpio41", "gpio42", "gpio43" 189 + }; 190 + 191 + static const char * const oxnas_ox820_fct5_group[] = { 192 + "gpio28", "gpio29", "gpio30", "gpio31" 193 + }; 194 + 226 195 #define FUNCTION(_name, _gr) \ 227 196 { \ 228 197 .name = #_name, \ ··· 264 165 .ngroups = ARRAY_SIZE(oxnas_##_gr##_group), \ 265 166 } 266 167 267 - static const struct oxnas_function oxnas_functions[] = { 268 - FUNCTION(gpio, fct0), 269 - FUNCTION(fct3, fct3), 168 + static const struct oxnas_function oxnas_ox810se_functions[] = { 169 + FUNCTION(gpio, ox810se_fct0), 170 + FUNCTION(fct3, ox810se_fct3), 171 + }; 172 + 173 + static const struct oxnas_function oxnas_ox820_functions[] = { 174 + FUNCTION(gpio, ox820_fct0), 175 + FUNCTION(fct1, ox820_fct1), 176 + FUNCTION(fct4, ox820_fct4), 177 + FUNCTION(fct5, ox820_fct5), 270 178 }; 271 179 272 180 #define OXNAS_PINCTRL_GROUP(_pin, _name, ...) \ ··· 291 185 .fct = _fct, \ 292 186 } 293 187 294 - static const struct oxnas_pin_group oxnas_groups[] = { 188 + static const struct oxnas_pin_group oxnas_ox810se_groups[] = { 295 189 OXNAS_PINCTRL_GROUP(0, gpio0, 296 190 OXNAS_PINCTRL_FUNCTION(gpio, 0), 297 191 OXNAS_PINCTRL_FUNCTION(fct3, 3)), ··· 388 282 OXNAS_PINCTRL_FUNCTION(fct3, 3)), 389 283 }; 390 284 285 + static const struct oxnas_pin_group oxnas_ox820_groups[] = { 286 + OXNAS_PINCTRL_GROUP(0, gpio0, 287 + OXNAS_PINCTRL_FUNCTION(gpio, 0)), 288 + OXNAS_PINCTRL_GROUP(1, gpio1, 289 + OXNAS_PINCTRL_FUNCTION(gpio, 0)), 290 + OXNAS_PINCTRL_GROUP(2, gpio2, 291 + OXNAS_PINCTRL_FUNCTION(gpio, 0)), 292 + OXNAS_PINCTRL_GROUP(3, gpio3, 293 + OXNAS_PINCTRL_FUNCTION(gpio, 0), 294 + OXNAS_PINCTRL_FUNCTION(fct1, 1)), 295 + OXNAS_PINCTRL_GROUP(4, gpio4, 296 + OXNAS_PINCTRL_FUNCTION(gpio, 0), 297 + OXNAS_PINCTRL_FUNCTION(fct1, 1)), 298 + OXNAS_PINCTRL_GROUP(5, gpio5, 299 + OXNAS_PINCTRL_FUNCTION(gpio, 0), 300 + OXNAS_PINCTRL_FUNCTION(fct4, 4)), 301 + OXNAS_PINCTRL_GROUP(6, gpio6, 302 + OXNAS_PINCTRL_FUNCTION(gpio, 0), 303 + OXNAS_PINCTRL_FUNCTION(fct4, 4)), 304 + OXNAS_PINCTRL_GROUP(7, gpio7, 305 + OXNAS_PINCTRL_FUNCTION(gpio, 0), 306 + OXNAS_PINCTRL_FUNCTION(fct4, 4)), 307 + OXNAS_PINCTRL_GROUP(8, gpio8, 308 + OXNAS_PINCTRL_FUNCTION(gpio, 0), 309 + OXNAS_PINCTRL_FUNCTION(fct4, 4)), 310 + OXNAS_PINCTRL_GROUP(9, gpio9, 311 + OXNAS_PINCTRL_FUNCTION(gpio, 0)), 312 + OXNAS_PINCTRL_GROUP(10, gpio10, 313 + OXNAS_PINCTRL_FUNCTION(gpio, 0)), 314 + OXNAS_PINCTRL_GROUP(11, gpio11, 315 + OXNAS_PINCTRL_FUNCTION(gpio, 0)), 316 + OXNAS_PINCTRL_GROUP(12, gpio12, 317 + OXNAS_PINCTRL_FUNCTION(gpio, 0), 318 + OXNAS_PINCTRL_FUNCTION(fct1, 1)), 319 + OXNAS_PINCTRL_GROUP(13, gpio13, 320 + OXNAS_PINCTRL_FUNCTION(gpio, 0), 321 + OXNAS_PINCTRL_FUNCTION(fct1, 1)), 322 + OXNAS_PINCTRL_GROUP(14, gpio14, 323 + OXNAS_PINCTRL_FUNCTION(gpio, 0), 324 + OXNAS_PINCTRL_FUNCTION(fct1, 1)), 325 + OXNAS_PINCTRL_GROUP(15, gpio15, 326 + OXNAS_PINCTRL_FUNCTION(gpio, 0), 327 + OXNAS_PINCTRL_FUNCTION(fct1, 1)), 328 + OXNAS_PINCTRL_GROUP(16, gpio16, 329 + OXNAS_PINCTRL_FUNCTION(gpio, 0), 330 + OXNAS_PINCTRL_FUNCTION(fct1, 1)), 331 + OXNAS_PINCTRL_GROUP(17, gpio17, 332 + OXNAS_PINCTRL_FUNCTION(gpio, 0), 333 + OXNAS_PINCTRL_FUNCTION(fct1, 1)), 334 + OXNAS_PINCTRL_GROUP(18, gpio18, 335 + OXNAS_PINCTRL_FUNCTION(gpio, 0), 336 + OXNAS_PINCTRL_FUNCTION(fct1, 1)), 337 + OXNAS_PINCTRL_GROUP(19, gpio19, 338 + OXNAS_PINCTRL_FUNCTION(gpio, 0), 339 + OXNAS_PINCTRL_FUNCTION(fct1, 1)), 340 + OXNAS_PINCTRL_GROUP(20, gpio20, 341 + OXNAS_PINCTRL_FUNCTION(gpio, 0), 342 + OXNAS_PINCTRL_FUNCTION(fct1, 1)), 343 + OXNAS_PINCTRL_GROUP(21, gpio21, 344 + OXNAS_PINCTRL_FUNCTION(gpio, 0), 345 + OXNAS_PINCTRL_FUNCTION(fct1, 1)), 346 + OXNAS_PINCTRL_GROUP(22, gpio22, 347 + OXNAS_PINCTRL_FUNCTION(gpio, 0), 348 + OXNAS_PINCTRL_FUNCTION(fct1, 1)), 349 + OXNAS_PINCTRL_GROUP(23, gpio23, 350 + OXNAS_PINCTRL_FUNCTION(gpio, 0), 351 + OXNAS_PINCTRL_FUNCTION(fct1, 1)), 352 + OXNAS_PINCTRL_GROUP(24, gpio24, 353 + OXNAS_PINCTRL_FUNCTION(gpio, 0), 354 + OXNAS_PINCTRL_FUNCTION(fct1, 1), 355 + OXNAS_PINCTRL_FUNCTION(fct4, 5)), 356 + OXNAS_PINCTRL_GROUP(25, gpio25, 357 + OXNAS_PINCTRL_FUNCTION(gpio, 0), 358 + OXNAS_PINCTRL_FUNCTION(fct4, 4)), 359 + OXNAS_PINCTRL_GROUP(26, gpio26, 360 + OXNAS_PINCTRL_FUNCTION(gpio, 0), 361 + OXNAS_PINCTRL_FUNCTION(fct4, 4)), 362 + OXNAS_PINCTRL_GROUP(27, gpio27, 363 + OXNAS_PINCTRL_FUNCTION(gpio, 0), 364 + OXNAS_PINCTRL_FUNCTION(fct4, 4)), 365 + OXNAS_PINCTRL_GROUP(28, gpio28, 366 + OXNAS_PINCTRL_FUNCTION(gpio, 0), 367 + OXNAS_PINCTRL_FUNCTION(fct5, 5)), 368 + OXNAS_PINCTRL_GROUP(29, gpio29, 369 + OXNAS_PINCTRL_FUNCTION(gpio, 0), 370 + OXNAS_PINCTRL_FUNCTION(fct5, 5)), 371 + OXNAS_PINCTRL_GROUP(30, gpio30, 372 + OXNAS_PINCTRL_FUNCTION(gpio, 0), 373 + OXNAS_PINCTRL_FUNCTION(fct5, 5)), 374 + OXNAS_PINCTRL_GROUP(31, gpio31, 375 + OXNAS_PINCTRL_FUNCTION(gpio, 0), 376 + OXNAS_PINCTRL_FUNCTION(fct5, 5)), 377 + OXNAS_PINCTRL_GROUP(32, gpio32, 378 + OXNAS_PINCTRL_FUNCTION(gpio, 0)), 379 + OXNAS_PINCTRL_GROUP(33, gpio33, 380 + OXNAS_PINCTRL_FUNCTION(gpio, 0)), 381 + OXNAS_PINCTRL_GROUP(34, gpio34, 382 + OXNAS_PINCTRL_FUNCTION(gpio, 0)), 383 + OXNAS_PINCTRL_GROUP(35, gpio35, 384 + OXNAS_PINCTRL_FUNCTION(gpio, 0)), 385 + OXNAS_PINCTRL_GROUP(36, gpio36, 386 + OXNAS_PINCTRL_FUNCTION(gpio, 0)), 387 + OXNAS_PINCTRL_GROUP(37, gpio37, 388 + OXNAS_PINCTRL_FUNCTION(gpio, 0)), 389 + OXNAS_PINCTRL_GROUP(38, gpio38, 390 + OXNAS_PINCTRL_FUNCTION(gpio, 0)), 391 + OXNAS_PINCTRL_GROUP(39, gpio39, 392 + OXNAS_PINCTRL_FUNCTION(gpio, 0)), 393 + OXNAS_PINCTRL_GROUP(40, gpio40, 394 + OXNAS_PINCTRL_FUNCTION(gpio, 0), 395 + OXNAS_PINCTRL_FUNCTION(fct4, 4)), 396 + OXNAS_PINCTRL_GROUP(41, gpio41, 397 + OXNAS_PINCTRL_FUNCTION(gpio, 0), 398 + OXNAS_PINCTRL_FUNCTION(fct4, 4)), 399 + OXNAS_PINCTRL_GROUP(42, gpio42, 400 + OXNAS_PINCTRL_FUNCTION(gpio, 0), 401 + OXNAS_PINCTRL_FUNCTION(fct4, 4)), 402 + OXNAS_PINCTRL_GROUP(43, gpio43, 403 + OXNAS_PINCTRL_FUNCTION(gpio, 0), 404 + OXNAS_PINCTRL_FUNCTION(fct4, 4)), 405 + OXNAS_PINCTRL_GROUP(44, gpio44, 406 + OXNAS_PINCTRL_FUNCTION(gpio, 0)), 407 + OXNAS_PINCTRL_GROUP(45, gpio45, 408 + OXNAS_PINCTRL_FUNCTION(gpio, 0)), 409 + OXNAS_PINCTRL_GROUP(46, gpio46, 410 + OXNAS_PINCTRL_FUNCTION(gpio, 0)), 411 + OXNAS_PINCTRL_GROUP(47, gpio47, 412 + OXNAS_PINCTRL_FUNCTION(gpio, 0)), 413 + OXNAS_PINCTRL_GROUP(48, gpio48, 414 + OXNAS_PINCTRL_FUNCTION(gpio, 0)), 415 + OXNAS_PINCTRL_GROUP(49, gpio49, 416 + OXNAS_PINCTRL_FUNCTION(gpio, 0)), 417 + }; 418 + 391 419 static inline struct oxnas_gpio_bank *pctl_to_bank(struct oxnas_pinctrl *pctl, 392 420 unsigned int pin) 393 421 { ··· 592 352 return 0; 593 353 } 594 354 595 - static int oxnas_pinmux_enable(struct pinctrl_dev *pctldev, 596 - unsigned int func, unsigned int group) 355 + static int oxnas_ox810se_pinmux_enable(struct pinctrl_dev *pctldev, 356 + unsigned int func, unsigned int group) 597 357 { 598 358 struct oxnas_pinctrl *pctl = pinctrl_dev_get_drvdata(pctldev); 599 359 const struct oxnas_pin_group *pg = &pctl->groups[group]; ··· 611 371 612 372 regmap_write_bits(pctl->regmap, 613 373 (pg->bank ? 614 - PINMUX_PRIMARY_SEL1 : 615 - PINMUX_PRIMARY_SEL0), 374 + PINMUX_810_PRIMARY_SEL1 : 375 + PINMUX_810_PRIMARY_SEL0), 616 376 mask, 617 377 (functions->fct == 1 ? 618 378 mask : 0)); 619 379 regmap_write_bits(pctl->regmap, 620 380 (pg->bank ? 621 - PINMUX_SECONDARY_SEL1 : 622 - PINMUX_SECONDARY_SEL0), 381 + PINMUX_810_SECONDARY_SEL1 : 382 + PINMUX_810_SECONDARY_SEL0), 623 383 mask, 624 384 (functions->fct == 2 ? 625 385 mask : 0)); 626 386 regmap_write_bits(pctl->regmap, 627 387 (pg->bank ? 628 - PINMUX_TERTIARY_SEL1 : 629 - PINMUX_TERTIARY_SEL0), 388 + PINMUX_810_TERTIARY_SEL1 : 389 + PINMUX_810_TERTIARY_SEL0), 630 390 mask, 631 391 (functions->fct == 3 ? 632 392 mask : 0)); ··· 642 402 return -EINVAL; 643 403 } 644 404 645 - static int oxnas_gpio_request_enable(struct pinctrl_dev *pctldev, 646 - struct pinctrl_gpio_range *range, 647 - unsigned int offset) 405 + static int oxnas_ox820_pinmux_enable(struct pinctrl_dev *pctldev, 406 + unsigned int func, unsigned int group) 407 + { 408 + struct oxnas_pinctrl *pctl = pinctrl_dev_get_drvdata(pctldev); 409 + const struct oxnas_pin_group *pg = &pctl->groups[group]; 410 + const struct oxnas_function *pf = &pctl->functions[func]; 411 + const char *fname = pf->name; 412 + struct oxnas_desc_function *functions = pg->functions; 413 + unsigned int offset = (pg->bank ? PINMUX_820_BANK_OFFSET : 0); 414 + u32 mask = BIT(pg->pin); 415 + 416 + while (functions->name) { 417 + if (!strcmp(functions->name, fname)) { 418 + dev_dbg(pctl->dev, 419 + "setting function %s bank %d pin %d fct %d mask %x\n", 420 + fname, pg->bank, pg->pin, 421 + functions->fct, mask); 422 + 423 + regmap_write_bits(pctl->regmap, 424 + offset + PINMUX_820_SECONDARY_SEL, 425 + mask, 426 + (functions->fct == 1 ? 427 + mask : 0)); 428 + regmap_write_bits(pctl->regmap, 429 + offset + PINMUX_820_TERTIARY_SEL, 430 + mask, 431 + (functions->fct == 2 ? 432 + mask : 0)); 433 + regmap_write_bits(pctl->regmap, 434 + offset + PINMUX_820_QUATERNARY_SEL, 435 + mask, 436 + (functions->fct == 3 ? 437 + mask : 0)); 438 + regmap_write_bits(pctl->regmap, 439 + offset + PINMUX_820_DEBUG_SEL, 440 + mask, 441 + (functions->fct == 4 ? 442 + mask : 0)); 443 + regmap_write_bits(pctl->regmap, 444 + offset + PINMUX_820_ALTERNATIVE_SEL, 445 + mask, 446 + (functions->fct == 5 ? 447 + mask : 0)); 448 + 449 + return 0; 450 + } 451 + 452 + functions++; 453 + } 454 + 455 + dev_err(pctl->dev, "cannot mux pin %u to function %u\n", group, func); 456 + 457 + return -EINVAL; 458 + } 459 + 460 + static int oxnas_ox810se_gpio_request_enable(struct pinctrl_dev *pctldev, 461 + struct pinctrl_gpio_range *range, 462 + unsigned int offset) 648 463 { 649 464 struct oxnas_pinctrl *pctl = pinctrl_dev_get_drvdata(pctldev); 650 465 struct oxnas_gpio_bank *bank = gpiochip_get_data(range->gc); ··· 710 415 711 416 regmap_write_bits(pctl->regmap, 712 417 (bank->id ? 713 - PINMUX_PRIMARY_SEL1 : 714 - PINMUX_PRIMARY_SEL0), 418 + PINMUX_810_PRIMARY_SEL1 : 419 + PINMUX_810_PRIMARY_SEL0), 715 420 mask, 0); 716 421 regmap_write_bits(pctl->regmap, 717 422 (bank->id ? 718 - PINMUX_SECONDARY_SEL1 : 719 - PINMUX_SECONDARY_SEL0), 423 + PINMUX_810_SECONDARY_SEL1 : 424 + PINMUX_810_SECONDARY_SEL0), 720 425 mask, 0); 721 426 regmap_write_bits(pctl->regmap, 722 427 (bank->id ? 723 - PINMUX_TERTIARY_SEL1 : 724 - PINMUX_TERTIARY_SEL0), 428 + PINMUX_810_TERTIARY_SEL1 : 429 + PINMUX_810_TERTIARY_SEL0), 430 + mask, 0); 431 + 432 + return 0; 433 + } 434 + 435 + static int oxnas_ox820_gpio_request_enable(struct pinctrl_dev *pctldev, 436 + struct pinctrl_gpio_range *range, 437 + unsigned int offset) 438 + { 439 + struct oxnas_pinctrl *pctl = pinctrl_dev_get_drvdata(pctldev); 440 + struct oxnas_gpio_bank *bank = gpiochip_get_data(range->gc); 441 + unsigned int bank_offset = (bank->id ? PINMUX_820_BANK_OFFSET : 0); 442 + u32 mask = BIT(offset - bank->gpio_chip.base); 443 + 444 + dev_dbg(pctl->dev, "requesting gpio %d in bank %d (id %d) with mask 0x%x\n", 445 + offset, bank->gpio_chip.base, bank->id, mask); 446 + 447 + regmap_write_bits(pctl->regmap, 448 + bank_offset + PINMUX_820_SECONDARY_SEL, 449 + mask, 0); 450 + regmap_write_bits(pctl->regmap, 451 + bank_offset + PINMUX_820_TERTIARY_SEL, 452 + mask, 0); 453 + regmap_write_bits(pctl->regmap, 454 + bank_offset + PINMUX_820_QUATERNARY_SEL, 455 + mask, 0); 456 + regmap_write_bits(pctl->regmap, 457 + bank_offset + PINMUX_820_DEBUG_SEL, 458 + mask, 0); 459 + regmap_write_bits(pctl->regmap, 460 + bank_offset + PINMUX_820_ALTERNATIVE_SEL, 725 461 mask, 0); 726 462 727 463 return 0; ··· 824 498 return 0; 825 499 } 826 500 827 - static const struct pinmux_ops oxnas_pinmux_ops = { 501 + static const struct pinmux_ops oxnas_ox810se_pinmux_ops = { 828 502 .get_functions_count = oxnas_pinmux_get_functions_count, 829 503 .get_function_name = oxnas_pinmux_get_function_name, 830 504 .get_function_groups = oxnas_pinmux_get_function_groups, 831 - .set_mux = oxnas_pinmux_enable, 832 - .gpio_request_enable = oxnas_gpio_request_enable, 505 + .set_mux = oxnas_ox810se_pinmux_enable, 506 + .gpio_request_enable = oxnas_ox810se_gpio_request_enable, 833 507 .gpio_set_direction = oxnas_gpio_set_direction, 834 508 }; 835 509 836 - static int oxnas_pinconf_get(struct pinctrl_dev *pctldev, unsigned int pin, 837 - unsigned long *config) 510 + static const struct pinmux_ops oxnas_ox820_pinmux_ops = { 511 + .get_functions_count = oxnas_pinmux_get_functions_count, 512 + .get_function_name = oxnas_pinmux_get_function_name, 513 + .get_function_groups = oxnas_pinmux_get_function_groups, 514 + .set_mux = oxnas_ox820_pinmux_enable, 515 + .gpio_request_enable = oxnas_ox820_gpio_request_enable, 516 + .gpio_set_direction = oxnas_gpio_set_direction, 517 + }; 518 + 519 + static int oxnas_ox810se_pinconf_get(struct pinctrl_dev *pctldev, 520 + unsigned int pin, unsigned long *config) 838 521 { 839 522 struct oxnas_pinctrl *pctl = pinctrl_dev_get_drvdata(pctldev); 840 523 struct oxnas_gpio_bank *bank = pctl_to_bank(pctl, pin); ··· 856 521 case PIN_CONFIG_BIAS_PULL_UP: 857 522 ret = regmap_read(pctl->regmap, 858 523 (bank->id ? 859 - PINMUX_PULLUP_CTRL1 : 860 - PINMUX_PULLUP_CTRL0), 524 + PINMUX_810_PULLUP_CTRL1 : 525 + PINMUX_810_PULLUP_CTRL0), 861 526 &arg); 862 527 if (ret) 863 528 return ret; ··· 873 538 return 0; 874 539 } 875 540 876 - static int oxnas_pinconf_set(struct pinctrl_dev *pctldev, unsigned int pin, 877 - unsigned long *configs, unsigned int num_configs) 541 + static int oxnas_ox820_pinconf_get(struct pinctrl_dev *pctldev, 542 + unsigned int pin, unsigned long *config) 543 + { 544 + struct oxnas_pinctrl *pctl = pinctrl_dev_get_drvdata(pctldev); 545 + struct oxnas_gpio_bank *bank = pctl_to_bank(pctl, pin); 546 + unsigned int param = pinconf_to_config_param(*config); 547 + unsigned int bank_offset = (bank->id ? PINMUX_820_BANK_OFFSET : 0); 548 + u32 mask = BIT(pin - bank->gpio_chip.base); 549 + int ret; 550 + u32 arg; 551 + 552 + switch (param) { 553 + case PIN_CONFIG_BIAS_PULL_UP: 554 + ret = regmap_read(pctl->regmap, 555 + bank_offset + PINMUX_820_PULLUP_CTRL, 556 + &arg); 557 + if (ret) 558 + return ret; 559 + 560 + arg = !!(arg & mask); 561 + break; 562 + default: 563 + return -ENOTSUPP; 564 + } 565 + 566 + *config = pinconf_to_config_packed(param, arg); 567 + 568 + return 0; 569 + } 570 + 571 + static int oxnas_ox810se_pinconf_set(struct pinctrl_dev *pctldev, 572 + unsigned int pin, unsigned long *configs, 573 + unsigned int num_configs) 878 574 { 879 575 struct oxnas_pinctrl *pctl = pinctrl_dev_get_drvdata(pctldev); 880 576 struct oxnas_gpio_bank *bank = pctl_to_bank(pctl, pin); ··· 927 561 dev_dbg(pctl->dev, " pullup\n"); 928 562 regmap_write_bits(pctl->regmap, 929 563 (bank->id ? 930 - PINMUX_PULLUP_CTRL1 : 931 - PINMUX_PULLUP_CTRL0), 564 + PINMUX_810_PULLUP_CTRL1 : 565 + PINMUX_810_PULLUP_CTRL0), 932 566 mask, mask); 933 567 break; 934 568 default: ··· 941 575 return 0; 942 576 } 943 577 944 - static const struct pinconf_ops oxnas_pinconf_ops = { 945 - .pin_config_get = oxnas_pinconf_get, 946 - .pin_config_set = oxnas_pinconf_set, 578 + static int oxnas_ox820_pinconf_set(struct pinctrl_dev *pctldev, 579 + unsigned int pin, unsigned long *configs, 580 + unsigned int num_configs) 581 + { 582 + struct oxnas_pinctrl *pctl = pinctrl_dev_get_drvdata(pctldev); 583 + struct oxnas_gpio_bank *bank = pctl_to_bank(pctl, pin); 584 + unsigned int bank_offset = (bank->id ? PINMUX_820_BANK_OFFSET : 0); 585 + unsigned int param; 586 + u32 arg; 587 + unsigned int i; 588 + u32 offset = pin - bank->gpio_chip.base; 589 + u32 mask = BIT(offset); 590 + 591 + dev_dbg(pctl->dev, "setting pin %d bank %d mask 0x%x\n", 592 + pin, bank->gpio_chip.base, mask); 593 + 594 + for (i = 0; i < num_configs; i++) { 595 + param = pinconf_to_config_param(configs[i]); 596 + arg = pinconf_to_config_argument(configs[i]); 597 + 598 + switch (param) { 599 + case PIN_CONFIG_BIAS_PULL_UP: 600 + dev_dbg(pctl->dev, " pullup\n"); 601 + regmap_write_bits(pctl->regmap, 602 + bank_offset + PINMUX_820_PULLUP_CTRL, 603 + mask, mask); 604 + break; 605 + default: 606 + dev_err(pctl->dev, "Property %u not supported\n", 607 + param); 608 + return -ENOTSUPP; 609 + } 610 + } 611 + 612 + return 0; 613 + } 614 + 615 + static const struct pinconf_ops oxnas_ox810se_pinconf_ops = { 616 + .pin_config_get = oxnas_ox810se_pinconf_get, 617 + .pin_config_set = oxnas_ox810se_pinconf_set, 947 618 .is_generic = true, 948 619 }; 949 620 950 - static struct pinctrl_desc oxnas_pinctrl_desc = { 951 - .name = "oxnas-pinctrl", 952 - .pctlops = &oxnas_pinctrl_ops, 953 - .pmxops = &oxnas_pinmux_ops, 954 - .confops = &oxnas_pinconf_ops, 955 - .owner = THIS_MODULE, 621 + static const struct pinconf_ops oxnas_ox820_pinconf_ops = { 622 + .pin_config_get = oxnas_ox820_pinconf_get, 623 + .pin_config_set = oxnas_ox820_pinconf_set, 624 + .is_generic = true, 956 625 }; 957 626 958 627 static void oxnas_gpio_irq_ack(struct irq_data *data) ··· 1100 699 GPIO_BANK(1), 1101 700 }; 1102 701 702 + static struct oxnas_pinctrl ox810se_pinctrl = { 703 + .functions = oxnas_ox810se_functions, 704 + .nfunctions = ARRAY_SIZE(oxnas_ox810se_functions), 705 + .groups = oxnas_ox810se_groups, 706 + .ngroups = ARRAY_SIZE(oxnas_ox810se_groups), 707 + .gpio_banks = oxnas_gpio_banks, 708 + .nbanks = ARRAY_SIZE(oxnas_gpio_banks), 709 + }; 710 + 711 + static struct pinctrl_desc oxnas_ox810se_pinctrl_desc = { 712 + .name = "oxnas-pinctrl", 713 + .pins = oxnas_ox810se_pins, 714 + .npins = ARRAY_SIZE(oxnas_ox810se_pins), 715 + .pctlops = &oxnas_pinctrl_ops, 716 + .pmxops = &oxnas_ox810se_pinmux_ops, 717 + .confops = &oxnas_ox810se_pinconf_ops, 718 + .owner = THIS_MODULE, 719 + }; 720 + 721 + static struct oxnas_pinctrl ox820_pinctrl = { 722 + .functions = oxnas_ox820_functions, 723 + .nfunctions = ARRAY_SIZE(oxnas_ox820_functions), 724 + .groups = oxnas_ox820_groups, 725 + .ngroups = ARRAY_SIZE(oxnas_ox820_groups), 726 + .gpio_banks = oxnas_gpio_banks, 727 + .nbanks = ARRAY_SIZE(oxnas_gpio_banks), 728 + }; 729 + 730 + static struct pinctrl_desc oxnas_ox820_pinctrl_desc = { 731 + .name = "oxnas-pinctrl", 732 + .pins = oxnas_ox820_pins, 733 + .npins = ARRAY_SIZE(oxnas_ox820_pins), 734 + .pctlops = &oxnas_pinctrl_ops, 735 + .pmxops = &oxnas_ox820_pinmux_ops, 736 + .confops = &oxnas_ox820_pinconf_ops, 737 + .owner = THIS_MODULE, 738 + }; 739 + 740 + static struct oxnas_pinctrl_data oxnas_ox810se_pinctrl_data = { 741 + .desc = &oxnas_ox810se_pinctrl_desc, 742 + .pctl = &ox810se_pinctrl, 743 + }; 744 + 745 + static struct oxnas_pinctrl_data oxnas_ox820_pinctrl_data = { 746 + .desc = &oxnas_ox820_pinctrl_desc, 747 + .pctl = &ox820_pinctrl, 748 + }; 749 + 750 + static const struct of_device_id oxnas_pinctrl_of_match[] = { 751 + { .compatible = "oxsemi,ox810se-pinctrl", 752 + .data = &oxnas_ox810se_pinctrl_data 753 + }, 754 + { .compatible = "oxsemi,ox820-pinctrl", 755 + .data = &oxnas_ox820_pinctrl_data, 756 + }, 757 + { }, 758 + }; 759 + 1103 760 static int oxnas_pinctrl_probe(struct platform_device *pdev) 1104 761 { 762 + const struct of_device_id *id; 763 + const struct oxnas_pinctrl_data *data; 1105 764 struct oxnas_pinctrl *pctl; 765 + 766 + id = of_match_node(oxnas_pinctrl_of_match, pdev->dev.of_node); 767 + if (!id) 768 + return -ENODEV; 769 + 770 + data = id->data; 771 + if (!data || !data->pctl || !data->desc) 772 + return -EINVAL; 1106 773 1107 774 pctl = devm_kzalloc(&pdev->dev, sizeof(*pctl), GFP_KERNEL); 1108 775 if (!pctl) ··· 1185 716 return -ENODEV; 1186 717 } 1187 718 1188 - pctl->pins = oxnas_pins; 1189 - pctl->npins = ARRAY_SIZE(oxnas_pins); 1190 - pctl->functions = oxnas_functions; 1191 - pctl->nfunctions = ARRAY_SIZE(oxnas_functions); 1192 - pctl->groups = oxnas_groups; 1193 - pctl->ngroups = ARRAY_SIZE(oxnas_groups); 1194 - pctl->gpio_banks = oxnas_gpio_banks; 1195 - pctl->nbanks = ARRAY_SIZE(oxnas_gpio_banks); 719 + pctl->functions = data->pctl->functions; 720 + pctl->nfunctions = data->pctl->nfunctions; 721 + pctl->groups = data->pctl->groups; 722 + pctl->ngroups = data->pctl->ngroups; 723 + pctl->gpio_banks = data->pctl->gpio_banks; 724 + pctl->nbanks = data->pctl->nbanks; 1196 725 1197 - oxnas_pinctrl_desc.pins = pctl->pins; 1198 - oxnas_pinctrl_desc.npins = pctl->npins; 1199 - 1200 - pctl->pctldev = pinctrl_register(&oxnas_pinctrl_desc, 1201 - &pdev->dev, pctl); 726 + pctl->pctldev = pinctrl_register(data->desc, &pdev->dev, pctl); 1202 727 if (IS_ERR(pctl->pctldev)) { 1203 728 dev_err(&pdev->dev, "Failed to register pinctrl device\n"); 1204 729 return PTR_ERR(pctl->pctldev); ··· 1268 805 return 0; 1269 806 } 1270 807 1271 - static const struct of_device_id oxnas_pinctrl_of_match[] = { 1272 - { .compatible = "oxsemi,ox810se-pinctrl", }, 1273 - { }, 1274 - }; 1275 - 1276 808 static struct platform_driver oxnas_pinctrl_driver = { 1277 809 .driver = { 1278 810 .name = "oxnas-pinctrl", ··· 1279 821 1280 822 static const struct of_device_id oxnas_gpio_of_match[] = { 1281 823 { .compatible = "oxsemi,ox810se-gpio", }, 824 + { .compatible = "oxsemi,ox820-gpio", }, 1282 825 { }, 1283 826 }; 1284 827
+86
drivers/pinctrl/pinctrl-rockchip.c
··· 59 59 #define GPIO_LS_SYNC 0x60 60 60 61 61 enum rockchip_pinctrl_type { 62 + RK1108, 62 63 RK2928, 63 64 RK3066B, 64 65 RK3188, ··· 625 624 return ret; 626 625 } 627 626 627 + #define RK1108_PULL_PMU_OFFSET 0x10 628 + #define RK1108_PULL_OFFSET 0x110 629 + #define RK1108_PULL_PINS_PER_REG 8 630 + #define RK1108_PULL_BITS_PER_PIN 2 631 + #define RK1108_PULL_BANK_STRIDE 16 632 + 633 + static void rk1108_calc_pull_reg_and_bit(struct rockchip_pin_bank *bank, 634 + int pin_num, struct regmap **regmap, 635 + int *reg, u8 *bit) 636 + { 637 + struct rockchip_pinctrl *info = bank->drvdata; 638 + 639 + /* The first 24 pins of the first bank are located in PMU */ 640 + if (bank->bank_num == 0) { 641 + *regmap = info->regmap_pmu; 642 + *reg = RK1108_PULL_PMU_OFFSET; 643 + } else { 644 + *reg = RK1108_PULL_OFFSET; 645 + *regmap = info->regmap_base; 646 + /* correct the offset, as we're starting with the 2nd bank */ 647 + *reg -= 0x10; 648 + *reg += bank->bank_num * RK1108_PULL_BANK_STRIDE; 649 + } 650 + 651 + *reg += ((pin_num / RK1108_PULL_PINS_PER_REG) * 4); 652 + *bit = (pin_num % RK1108_PULL_PINS_PER_REG); 653 + *bit *= RK1108_PULL_BITS_PER_PIN; 654 + } 655 + 656 + #define RK1108_DRV_PMU_OFFSET 0x20 657 + #define RK1108_DRV_GRF_OFFSET 0x210 658 + #define RK1108_DRV_BITS_PER_PIN 2 659 + #define RK1108_DRV_PINS_PER_REG 8 660 + #define RK1108_DRV_BANK_STRIDE 16 661 + 662 + static void rk1108_calc_drv_reg_and_bit(struct rockchip_pin_bank *bank, 663 + int pin_num, struct regmap **regmap, 664 + int *reg, u8 *bit) 665 + { 666 + struct rockchip_pinctrl *info = bank->drvdata; 667 + 668 + /* The first 24 pins of the first bank are located in PMU */ 669 + if (bank->bank_num == 0) { 670 + *regmap = info->regmap_pmu; 671 + *reg = RK1108_DRV_PMU_OFFSET; 672 + } else { 673 + *regmap = info->regmap_base; 674 + *reg = RK1108_DRV_GRF_OFFSET; 675 + 676 + /* correct the offset, as we're starting with the 2nd bank */ 677 + *reg -= 0x10; 678 + *reg += bank->bank_num * RK1108_DRV_BANK_STRIDE; 679 + } 680 + 681 + *reg += ((pin_num / RK1108_DRV_PINS_PER_REG) * 4); 682 + *bit = pin_num % RK1108_DRV_PINS_PER_REG; 683 + *bit *= RK1108_DRV_BITS_PER_PIN; 684 + } 685 + 628 686 #define RK2928_PULL_OFFSET 0x118 629 687 #define RK2928_PULL_PINS_PER_REG 16 630 688 #define RK2928_PULL_BANK_STRIDE 8 ··· 1183 1123 return !(data & BIT(bit)) 1184 1124 ? PIN_CONFIG_BIAS_PULL_PIN_DEFAULT 1185 1125 : PIN_CONFIG_BIAS_DISABLE; 1126 + case RK1108: 1186 1127 case RK3188: 1187 1128 case RK3288: 1188 1129 case RK3368: ··· 1230 1169 1231 1170 spin_unlock_irqrestore(&bank->slock, flags); 1232 1171 break; 1172 + case RK1108: 1233 1173 case RK3188: 1234 1174 case RK3288: 1235 1175 case RK3368: ··· 1420 1358 pull == PIN_CONFIG_BIAS_DISABLE); 1421 1359 case RK3066B: 1422 1360 return pull ? false : true; 1361 + case RK1108: 1423 1362 case RK3188: 1424 1363 case RK3288: 1425 1364 case RK3368: ··· 2518 2455 return 0; 2519 2456 } 2520 2457 2458 + static struct rockchip_pin_bank rk1108_pin_banks[] = { 2459 + PIN_BANK_IOMUX_FLAGS(0, 32, "gpio0", IOMUX_SOURCE_PMU, 2460 + IOMUX_SOURCE_PMU, 2461 + IOMUX_SOURCE_PMU, 2462 + IOMUX_SOURCE_PMU), 2463 + PIN_BANK_IOMUX_FLAGS(1, 32, "gpio1", 0, 0, 0, 0), 2464 + PIN_BANK_IOMUX_FLAGS(2, 32, "gpio2", 0, 0, 0, 0), 2465 + PIN_BANK_IOMUX_FLAGS(3, 32, "gpio3", 0, 0, 0, 0), 2466 + }; 2467 + 2468 + static struct rockchip_pin_ctrl rk1108_pin_ctrl = { 2469 + .pin_banks = rk1108_pin_banks, 2470 + .nr_banks = ARRAY_SIZE(rk1108_pin_banks), 2471 + .label = "RK1108-GPIO", 2472 + .type = RK1108, 2473 + .grf_mux_offset = 0x10, 2474 + .pmu_mux_offset = 0x0, 2475 + .pull_calc_reg = rk1108_calc_pull_reg_and_bit, 2476 + .drv_calc_reg = rk1108_calc_drv_reg_and_bit, 2477 + }; 2478 + 2521 2479 static struct rockchip_pin_bank rk2928_pin_banks[] = { 2522 2480 PIN_BANK(0, 32, "gpio0"), 2523 2481 PIN_BANK(1, 32, "gpio1"), ··· 2768 2684 }; 2769 2685 2770 2686 static const struct of_device_id rockchip_pinctrl_dt_match[] = { 2687 + { .compatible = "rockchip,rk1108-pinctrl", 2688 + .data = (void *)&rk1108_pin_ctrl }, 2771 2689 { .compatible = "rockchip,rk2928-pinctrl", 2772 2690 .data = (void *)&rk2928_pin_ctrl }, 2773 2691 { .compatible = "rockchip,rk3036-pinctrl",
+136 -81
drivers/pinctrl/pinctrl-single.c
··· 31 31 #include <linux/platform_data/pinctrl-single.h> 32 32 33 33 #include "core.h" 34 + #include "devicetree.h" 34 35 #include "pinconf.h" 35 36 36 37 #define DRIVER_NAME "pinctrl-single" 37 - #define PCS_MUX_PINS_NAME "pinctrl-single,pins" 38 - #define PCS_MUX_BITS_NAME "pinctrl-single,bits" 39 - #define PCS_REG_NAME_LEN ((sizeof(unsigned long) * 2) + 3) 40 38 #define PCS_OFF_DISABLED ~0U 41 39 42 40 /** ··· 140 142 }; 141 143 142 144 /** 143 - * struct pcs_name - register name for a pin 144 - * @name: name of the pinctrl register 145 - * 146 - * REVISIT: We may want to make names optional in the pinctrl 147 - * framework as some drivers may not care about pin names to 148 - * avoid kernel bloat. The pin names can be deciphered by user 149 - * space tools using debugfs based on the register address and 150 - * SoC packaging information. 151 - */ 152 - struct pcs_name { 153 - char name[PCS_REG_NAME_LEN]; 154 - }; 155 - 156 - /** 157 145 * struct pcs_soc_data - SoC specific settings 158 146 * @flags: initial SoC specific PCS_FEAT_xxx values 159 147 * @irq: optional interrupt for the controller ··· 161 177 * @base: virtual address of the controller 162 178 * @size: size of the ioremapped area 163 179 * @dev: device entry 180 + * @np: device tree node 164 181 * @pctl: pin controller device 165 182 * @flags: mask of PCS_FEAT_xxx values 183 + * @missing_nr_pinctrl_cells: for legacy binding, may go away 184 + * @socdata: soc specific data 166 185 * @lock: spinlock for register access 167 186 * @mutex: mutex protecting the lists 168 187 * @width: bits per mux register ··· 173 186 * @fshift: function register shift 174 187 * @foff: value to turn mux off 175 188 * @fmax: max number of functions in fmask 176 - * @bits_per_pin:number of bits per pin 177 - * @names: array of register names for pins 189 + * @bits_per_mux: number of bits per mux 190 + * @bits_per_pin: number of bits per pin 178 191 * @pins: physical pins on the SoC 179 192 * @pgtree: pingroup index radix tree 180 193 * @ftree: function index radix tree ··· 195 208 void __iomem *base; 196 209 unsigned size; 197 210 struct device *dev; 211 + struct device_node *np; 198 212 struct pinctrl_dev *pctl; 199 213 unsigned flags; 200 214 #define PCS_QUIRK_SHARED_IRQ (1 << 2) 201 215 #define PCS_FEAT_IRQ (1 << 1) 202 216 #define PCS_FEAT_PINCONF (1 << 0) 217 + struct property *missing_nr_pinctrl_cells; 203 218 struct pcs_soc_data socdata; 204 219 raw_spinlock_t lock; 205 220 struct mutex mutex; ··· 212 223 unsigned fmax; 213 224 bool bits_per_mux; 214 225 unsigned bits_per_pin; 215 - struct pcs_name *names; 216 226 struct pcs_data pins; 217 227 struct radix_tree_root pgtree; 218 228 struct radix_tree_root ftree; ··· 342 354 { 343 355 struct pcs_device *pcs; 344 356 unsigned val, mux_bytes; 357 + unsigned long offset; 358 + size_t pa; 345 359 346 360 pcs = pinctrl_dev_get_drvdata(pctldev); 347 361 348 362 mux_bytes = pcs->width / BITS_PER_BYTE; 349 - val = pcs->read(pcs->base + pin * mux_bytes); 363 + offset = pin * mux_bytes; 364 + val = pcs->read(pcs->base + offset); 365 + pa = pcs->res->start + offset; 350 366 351 - seq_printf(s, "%08x %s " , val, DRIVER_NAME); 367 + seq_printf(s, "%zx %08x %s ", pa, val, DRIVER_NAME); 352 368 } 353 369 354 370 static void pcs_dt_free_map(struct pinctrl_dev *pctldev, ··· 755 763 { 756 764 struct pcs_soc_data *pcs_soc = &pcs->socdata; 757 765 struct pinctrl_pin_desc *pin; 758 - struct pcs_name *pn; 759 766 int i; 760 767 761 768 i = pcs->pins.cur; ··· 777 786 } 778 787 779 788 pin = &pcs->pins.pa[i]; 780 - pn = &pcs->names[i]; 781 - sprintf(pn->name, "%lx.%u", 782 - (unsigned long)pcs->res->start + offset, pin_pos); 783 - pin->name = pn->name; 784 789 pin->number = i; 785 790 pcs->pins.cur++; 786 791 ··· 812 825 sizeof(*pcs->pins.pa) * nr_pins, 813 826 GFP_KERNEL); 814 827 if (!pcs->pins.pa) 815 - return -ENOMEM; 816 - 817 - pcs->names = devm_kzalloc(pcs->dev, 818 - sizeof(struct pcs_name) * nr_pins, 819 - GFP_KERNEL); 820 - if (!pcs->names) 821 828 return -ENOMEM; 822 829 823 830 pcs->desc.pins = pcs->pins.pa; ··· 1127 1146 unsigned *num_maps, 1128 1147 const char **pgnames) 1129 1148 { 1149 + const char *name = "pinctrl-single,pins"; 1130 1150 struct pcs_func_vals *vals; 1131 - const __be32 *mux; 1132 - int size, rows, *pins, index = 0, found = 0, res = -ENOMEM; 1151 + int rows, *pins, found = 0, res = -ENOMEM, i; 1133 1152 struct pcs_function *function; 1134 1153 1135 - mux = of_get_property(np, PCS_MUX_PINS_NAME, &size); 1136 - if ((!mux) || (size < sizeof(*mux) * 2)) { 1137 - dev_err(pcs->dev, "bad data for mux %s\n", 1138 - np->name); 1154 + rows = pinctrl_count_index_with_args(np, name); 1155 + if (rows <= 0) { 1156 + dev_err(pcs->dev, "Ivalid number of rows: %d\n", rows); 1139 1157 return -EINVAL; 1140 1158 } 1141 - 1142 - size /= sizeof(*mux); /* Number of elements in array */ 1143 - rows = size / 2; 1144 1159 1145 1160 vals = devm_kzalloc(pcs->dev, sizeof(*vals) * rows, GFP_KERNEL); 1146 1161 if (!vals) ··· 1146 1169 if (!pins) 1147 1170 goto free_vals; 1148 1171 1149 - while (index < size) { 1150 - unsigned offset, val; 1172 + for (i = 0; i < rows; i++) { 1173 + struct of_phandle_args pinctrl_spec; 1174 + unsigned int offset; 1151 1175 int pin; 1152 1176 1153 - offset = be32_to_cpup(mux + index++); 1154 - val = be32_to_cpup(mux + index++); 1177 + res = pinctrl_parse_index_with_args(np, name, i, &pinctrl_spec); 1178 + if (res) 1179 + return res; 1180 + 1181 + if (pinctrl_spec.args_count < 2) { 1182 + dev_err(pcs->dev, "invalid args_count for spec: %i\n", 1183 + pinctrl_spec.args_count); 1184 + break; 1185 + } 1186 + 1187 + /* Index plus one value cell */ 1188 + offset = pinctrl_spec.args[0]; 1155 1189 vals[found].reg = pcs->base + offset; 1156 - vals[found].val = val; 1190 + vals[found].val = pinctrl_spec.args[1]; 1191 + 1192 + dev_dbg(pcs->dev, "%s index: 0x%x value: 0x%x\n", 1193 + pinctrl_spec.np->name, offset, pinctrl_spec.args[1]); 1157 1194 1158 1195 pin = pcs_get_pin_by_offset(pcs, offset); 1159 1196 if (pin < 0) { ··· 1181 1190 1182 1191 pgnames[0] = np->name; 1183 1192 function = pcs_add_function(pcs, np, np->name, vals, found, pgnames, 1); 1184 - if (!function) 1193 + if (!function) { 1194 + res = -ENOMEM; 1185 1195 goto free_pins; 1196 + } 1186 1197 1187 1198 res = pcs_add_pingroup(pcs, np, np->name, pins, found); 1188 1199 if (res < 0) ··· 1219 1226 return res; 1220 1227 } 1221 1228 1222 - #define PARAMS_FOR_BITS_PER_MUX 3 1223 - 1224 1229 static int pcs_parse_bits_in_pinctrl_entry(struct pcs_device *pcs, 1225 1230 struct device_node *np, 1226 1231 struct pinctrl_map **map, 1227 1232 unsigned *num_maps, 1228 1233 const char **pgnames) 1229 1234 { 1235 + const char *name = "pinctrl-single,bits"; 1230 1236 struct pcs_func_vals *vals; 1231 - const __be32 *mux; 1232 - int size, rows, *pins, index = 0, found = 0, res = -ENOMEM; 1237 + int rows, *pins, found = 0, res = -ENOMEM, i; 1233 1238 int npins_in_row; 1234 1239 struct pcs_function *function; 1235 1240 1236 - mux = of_get_property(np, PCS_MUX_BITS_NAME, &size); 1237 - 1238 - if (!mux) { 1239 - dev_err(pcs->dev, "no valid property for %s\n", np->name); 1241 + rows = pinctrl_count_index_with_args(np, name); 1242 + if (rows <= 0) { 1243 + dev_err(pcs->dev, "Invalid number of rows: %d\n", rows); 1240 1244 return -EINVAL; 1241 1245 } 1242 1246 1243 - if (size < (sizeof(*mux) * PARAMS_FOR_BITS_PER_MUX)) { 1244 - dev_err(pcs->dev, "bad data for %s\n", np->name); 1245 - return -EINVAL; 1246 - } 1247 - 1248 - /* Number of elements in array */ 1249 - size /= sizeof(*mux); 1250 - 1251 - rows = size / PARAMS_FOR_BITS_PER_MUX; 1252 1247 npins_in_row = pcs->width / pcs->bits_per_pin; 1253 1248 1254 1249 vals = devm_kzalloc(pcs->dev, sizeof(*vals) * rows * npins_in_row, ··· 1249 1268 if (!pins) 1250 1269 goto free_vals; 1251 1270 1252 - while (index < size) { 1271 + for (i = 0; i < rows; i++) { 1272 + struct of_phandle_args pinctrl_spec; 1253 1273 unsigned offset, val; 1254 1274 unsigned mask, bit_pos, val_pos, mask_pos, submask; 1255 1275 unsigned pin_num_from_lsb; 1256 1276 int pin; 1257 1277 1258 - offset = be32_to_cpup(mux + index++); 1259 - val = be32_to_cpup(mux + index++); 1260 - mask = be32_to_cpup(mux + index++); 1278 + res = pinctrl_parse_index_with_args(np, name, i, &pinctrl_spec); 1279 + if (res) 1280 + return res; 1281 + 1282 + if (pinctrl_spec.args_count < 3) { 1283 + dev_err(pcs->dev, "invalid args_count for spec: %i\n", 1284 + pinctrl_spec.args_count); 1285 + break; 1286 + } 1287 + 1288 + /* Index plus two value cells */ 1289 + offset = pinctrl_spec.args[0]; 1290 + val = pinctrl_spec.args[1]; 1291 + mask = pinctrl_spec.args[2]; 1292 + 1293 + dev_dbg(pcs->dev, "%s index: 0x%x value: 0x%x mask: 0x%x\n", 1294 + pinctrl_spec.np->name, offset, val, mask); 1261 1295 1262 1296 /* Parse pins in each row from LSB */ 1263 1297 while (mask) { ··· 1315 1319 1316 1320 pgnames[0] = np->name; 1317 1321 function = pcs_add_function(pcs, np, np->name, vals, found, pgnames, 1); 1318 - if (!function) 1322 + if (!function) { 1323 + res = -ENOMEM; 1319 1324 goto free_pins; 1325 + } 1320 1326 1321 1327 res = pcs_add_pingroup(pcs, np, np->name, pins, found); 1322 1328 if (res < 0) ··· 1492 1494 pinctrl_unregister(pcs->pctl); 1493 1495 pcs_free_funcs(pcs); 1494 1496 pcs_free_pingroups(pcs); 1497 + #if IS_BUILTIN(CONFIG_PINCTRL_SINGLE) 1498 + if (pcs->missing_nr_pinctrl_cells) 1499 + of_remove_property(pcs->np, pcs->missing_nr_pinctrl_cells); 1500 + #endif 1495 1501 } 1496 - 1497 - #define PCS_GET_PROP_U32(name, reg, err) \ 1498 - do { \ 1499 - ret = of_property_read_u32(np, name, reg); \ 1500 - if (ret) { \ 1501 - dev_err(pcs->dev, err); \ 1502 - return ret; \ 1503 - } \ 1504 - } while (0); 1505 1502 1506 1503 static const struct of_device_id pcs_of_match[]; 1507 1504 ··· 1813 1820 } 1814 1821 #endif 1815 1822 1823 + /** 1824 + * pcs_quirk_missing_pinctrl_cells - handle legacy binding 1825 + * @pcs: pinctrl driver instance 1826 + * @np: device tree node 1827 + * @cells: number of cells 1828 + * 1829 + * Handle legacy binding with no #pinctrl-cells. This should be 1830 + * always two pinctrl-single,bit-per-mux and one for others. 1831 + * At some point we may want to consider removing this. 1832 + */ 1833 + static int pcs_quirk_missing_pinctrl_cells(struct pcs_device *pcs, 1834 + struct device_node *np, 1835 + int cells) 1836 + { 1837 + struct property *p; 1838 + const char *name = "#pinctrl-cells"; 1839 + int error; 1840 + u32 val; 1841 + 1842 + error = of_property_read_u32(np, name, &val); 1843 + if (!error) 1844 + return 0; 1845 + 1846 + dev_warn(pcs->dev, "please update dts to use %s = <%i>\n", 1847 + name, cells); 1848 + 1849 + p = devm_kzalloc(pcs->dev, sizeof(*p), GFP_KERNEL); 1850 + if (!p) 1851 + return -ENOMEM; 1852 + 1853 + p->length = sizeof(__be32); 1854 + p->value = devm_kzalloc(pcs->dev, sizeof(__be32), GFP_KERNEL); 1855 + if (!p->value) 1856 + return -ENOMEM; 1857 + *(__be32 *)p->value = cpu_to_be32(cells); 1858 + 1859 + p->name = devm_kstrdup(pcs->dev, name, GFP_KERNEL); 1860 + if (!p->name) 1861 + return -ENOMEM; 1862 + 1863 + pcs->missing_nr_pinctrl_cells = p; 1864 + 1865 + #if IS_BUILTIN(CONFIG_PINCTRL_SINGLE) 1866 + error = of_add_property(np, pcs->missing_nr_pinctrl_cells); 1867 + #endif 1868 + 1869 + return error; 1870 + } 1871 + 1816 1872 static int pcs_probe(struct platform_device *pdev) 1817 1873 { 1818 1874 struct device_node *np = pdev->dev.of_node; ··· 1882 1840 return -ENOMEM; 1883 1841 } 1884 1842 pcs->dev = &pdev->dev; 1843 + pcs->np = np; 1885 1844 raw_spin_lock_init(&pcs->lock); 1886 1845 mutex_init(&pcs->mutex); 1887 1846 INIT_LIST_HEAD(&pcs->pingroups); ··· 1892 1849 pcs->flags = soc->flags; 1893 1850 memcpy(&pcs->socdata, soc, sizeof(*soc)); 1894 1851 1895 - PCS_GET_PROP_U32("pinctrl-single,register-width", &pcs->width, 1896 - "register width not specified\n"); 1852 + ret = of_property_read_u32(np, "pinctrl-single,register-width", 1853 + &pcs->width); 1854 + if (ret) { 1855 + dev_err(pcs->dev, "register width not specified\n"); 1856 + 1857 + return ret; 1858 + } 1897 1859 1898 1860 ret = of_property_read_u32(np, "pinctrl-single,function-mask", 1899 1861 &pcs->fmask); ··· 1919 1871 1920 1872 pcs->bits_per_mux = of_property_read_bool(np, 1921 1873 "pinctrl-single,bit-per-mux"); 1874 + ret = pcs_quirk_missing_pinctrl_cells(pcs, np, 1875 + pcs->bits_per_mux ? 2 : 1); 1876 + if (ret) { 1877 + dev_err(&pdev->dev, "unable to patch #pinctrl-cells\n"); 1878 + 1879 + return ret; 1880 + } 1922 1881 1923 1882 res = platform_get_resource(pdev, IORESOURCE_MEM, 0); 1924 1883 if (!res) {
+2 -2
drivers/pinctrl/pinctrl-st.c
··· 1006 1006 1007 1007 function = st_pctl_get_pin_function(pc, offset); 1008 1008 if (function) 1009 - snprintf(f, 10, "Alt Fn %d", function); 1009 + snprintf(f, 10, "Alt Fn %u", function); 1010 1010 else 1011 1011 snprintf(f, 5, "GPIO"); 1012 1012 ··· 1181 1181 if (!strcmp(pp->name, "name")) 1182 1182 continue; 1183 1183 1184 - if (pp && (pp->length/sizeof(__be32)) >= OF_GPIO_ARGS_MIN) { 1184 + if (pp->length / sizeof(__be32) >= OF_GPIO_ARGS_MIN) { 1185 1185 npins++; 1186 1186 } else { 1187 1187 pr_warn("Invalid st,pins in %s node\n", np->name);
+601 -388
drivers/pinctrl/pinctrl-sx150x.c
··· 5 5 * Copyright (c) 2010, Code Aurora Forum. All rights reserved. 6 6 * 7 7 * Driver for Semtech SX150X I2C GPIO Expanders 8 + * The handling of the 4-bit chips (SX1501/SX1504/SX1507) is untested. 8 9 * 9 10 * Author: Gregory Bean <gbean@codeaurora.org> 10 11 * ··· 19 18 * GNU General Public License for more details. 20 19 */ 21 20 21 + #include <linux/regmap.h> 22 22 #include <linux/i2c.h> 23 23 #include <linux/init.h> 24 24 #include <linux/interrupt.h> ··· 27 25 #include <linux/mutex.h> 28 26 #include <linux/slab.h> 29 27 #include <linux/of.h> 30 - #include <linux/gpio.h> 31 - #include <linux/pinctrl/machine.h> 28 + #include <linux/of_device.h> 29 + #include <linux/gpio/driver.h> 32 30 #include <linux/pinctrl/pinconf.h> 33 31 #include <linux/pinctrl/pinctrl.h> 34 32 #include <linux/pinctrl/pinmux.h> ··· 44 42 SX150X_456, 45 43 SX150X_789, 46 44 }; 45 + enum { 46 + SX150X_789_REG_MISC_AUTOCLEAR_OFF = 1 << 0, 47 + SX150X_MAX_REGISTER = 0xad, 48 + SX150X_IRQ_TYPE_EDGE_RISING = 0x1, 49 + SX150X_IRQ_TYPE_EDGE_FALLING = 0x2, 50 + SX150X_789_RESET_KEY1 = 0x12, 51 + SX150X_789_RESET_KEY2 = 0x34, 52 + }; 47 53 48 54 struct sx150x_123_pri { 49 55 u8 reg_pld_mode; ··· 60 50 u8 reg_pld_table2; 61 51 u8 reg_pld_table3; 62 52 u8 reg_pld_table4; 63 - u8 reg_advance; 53 + u8 reg_advanced; 64 54 }; 65 55 66 56 struct sx150x_456_pri { ··· 70 60 u8 reg_pld_table2; 71 61 u8 reg_pld_table3; 72 62 u8 reg_pld_table4; 73 - u8 reg_advance; 63 + u8 reg_advanced; 74 64 }; 75 65 76 66 struct sx150x_789_pri { ··· 108 98 struct pinctrl_desc pinctrl_desc; 109 99 struct gpio_chip gpio; 110 100 struct irq_chip irq_chip; 101 + struct regmap *regmap; 111 102 struct { 112 - int update; 113 103 u32 sense; 114 104 u32 masked; 115 - u32 dev_sense; 116 - u32 dev_masked; 117 105 } irq; 118 106 struct mutex lock; 119 107 const struct sx150x_device_data *data; 108 + }; 109 + 110 + static const struct pinctrl_pin_desc sx150x_4_pins[] = { 111 + PINCTRL_PIN(0, "gpio0"), 112 + PINCTRL_PIN(1, "gpio1"), 113 + PINCTRL_PIN(2, "gpio2"), 114 + PINCTRL_PIN(3, "gpio3"), 115 + PINCTRL_PIN(4, "oscio"), 120 116 }; 121 117 122 118 static const struct pinctrl_pin_desc sx150x_8_pins[] = { ··· 157 141 PINCTRL_PIN(16, "oscio"), 158 142 }; 159 143 144 + static const struct sx150x_device_data sx1501q_device_data = { 145 + .model = SX150X_123, 146 + .reg_pullup = 0x02, 147 + .reg_pulldn = 0x03, 148 + .reg_dir = 0x01, 149 + .reg_data = 0x00, 150 + .reg_irq_mask = 0x05, 151 + .reg_irq_src = 0x08, 152 + .reg_sense = 0x07, 153 + .pri.x123 = { 154 + .reg_pld_mode = 0x10, 155 + .reg_pld_table0 = 0x11, 156 + .reg_pld_table2 = 0x13, 157 + .reg_advanced = 0xad, 158 + }, 159 + .ngpios = 4, 160 + .pins = sx150x_4_pins, 161 + .npins = 4, /* oscio not available */ 162 + }; 163 + 164 + static const struct sx150x_device_data sx1502q_device_data = { 165 + .model = SX150X_123, 166 + .reg_pullup = 0x02, 167 + .reg_pulldn = 0x03, 168 + .reg_dir = 0x01, 169 + .reg_data = 0x00, 170 + .reg_irq_mask = 0x05, 171 + .reg_irq_src = 0x08, 172 + .reg_sense = 0x06, 173 + .pri.x123 = { 174 + .reg_pld_mode = 0x10, 175 + .reg_pld_table0 = 0x11, 176 + .reg_pld_table1 = 0x12, 177 + .reg_pld_table2 = 0x13, 178 + .reg_pld_table3 = 0x14, 179 + .reg_pld_table4 = 0x15, 180 + .reg_advanced = 0xad, 181 + }, 182 + .ngpios = 8, 183 + .pins = sx150x_8_pins, 184 + .npins = 8, /* oscio not available */ 185 + }; 186 + 187 + static const struct sx150x_device_data sx1503q_device_data = { 188 + .model = SX150X_123, 189 + .reg_pullup = 0x04, 190 + .reg_pulldn = 0x06, 191 + .reg_dir = 0x02, 192 + .reg_data = 0x00, 193 + .reg_irq_mask = 0x08, 194 + .reg_irq_src = 0x0e, 195 + .reg_sense = 0x0a, 196 + .pri.x123 = { 197 + .reg_pld_mode = 0x20, 198 + .reg_pld_table0 = 0x22, 199 + .reg_pld_table1 = 0x24, 200 + .reg_pld_table2 = 0x26, 201 + .reg_pld_table3 = 0x28, 202 + .reg_pld_table4 = 0x2a, 203 + .reg_advanced = 0xad, 204 + }, 205 + .ngpios = 16, 206 + .pins = sx150x_16_pins, 207 + .npins = 16, /* oscio not available */ 208 + }; 209 + 210 + static const struct sx150x_device_data sx1504q_device_data = { 211 + .model = SX150X_456, 212 + .reg_pullup = 0x02, 213 + .reg_pulldn = 0x03, 214 + .reg_dir = 0x01, 215 + .reg_data = 0x00, 216 + .reg_irq_mask = 0x05, 217 + .reg_irq_src = 0x08, 218 + .reg_sense = 0x07, 219 + .pri.x456 = { 220 + .reg_pld_mode = 0x10, 221 + .reg_pld_table0 = 0x11, 222 + .reg_pld_table2 = 0x13, 223 + }, 224 + .ngpios = 4, 225 + .pins = sx150x_4_pins, 226 + .npins = 4, /* oscio not available */ 227 + }; 228 + 229 + static const struct sx150x_device_data sx1505q_device_data = { 230 + .model = SX150X_456, 231 + .reg_pullup = 0x02, 232 + .reg_pulldn = 0x03, 233 + .reg_dir = 0x01, 234 + .reg_data = 0x00, 235 + .reg_irq_mask = 0x05, 236 + .reg_irq_src = 0x08, 237 + .reg_sense = 0x06, 238 + .pri.x456 = { 239 + .reg_pld_mode = 0x10, 240 + .reg_pld_table0 = 0x11, 241 + .reg_pld_table1 = 0x12, 242 + .reg_pld_table2 = 0x13, 243 + .reg_pld_table3 = 0x14, 244 + .reg_pld_table4 = 0x15, 245 + }, 246 + .ngpios = 8, 247 + .pins = sx150x_8_pins, 248 + .npins = 8, /* oscio not available */ 249 + }; 250 + 251 + static const struct sx150x_device_data sx1506q_device_data = { 252 + .model = SX150X_456, 253 + .reg_pullup = 0x04, 254 + .reg_pulldn = 0x06, 255 + .reg_dir = 0x02, 256 + .reg_data = 0x00, 257 + .reg_irq_mask = 0x08, 258 + .reg_irq_src = 0x0e, 259 + .reg_sense = 0x0a, 260 + .pri.x456 = { 261 + .reg_pld_mode = 0x20, 262 + .reg_pld_table0 = 0x22, 263 + .reg_pld_table1 = 0x24, 264 + .reg_pld_table2 = 0x26, 265 + .reg_pld_table3 = 0x28, 266 + .reg_pld_table4 = 0x2a, 267 + .reg_advanced = 0xad, 268 + }, 269 + .ngpios = 16, 270 + .pins = sx150x_16_pins, 271 + .npins = 16, /* oscio not available */ 272 + }; 273 + 274 + static const struct sx150x_device_data sx1507q_device_data = { 275 + .model = SX150X_789, 276 + .reg_pullup = 0x03, 277 + .reg_pulldn = 0x04, 278 + .reg_dir = 0x07, 279 + .reg_data = 0x08, 280 + .reg_irq_mask = 0x09, 281 + .reg_irq_src = 0x0b, 282 + .reg_sense = 0x0a, 283 + .pri.x789 = { 284 + .reg_drain = 0x05, 285 + .reg_polarity = 0x06, 286 + .reg_clock = 0x0d, 287 + .reg_misc = 0x0e, 288 + .reg_reset = 0x7d, 289 + }, 290 + .ngpios = 4, 291 + .pins = sx150x_4_pins, 292 + .npins = ARRAY_SIZE(sx150x_4_pins), 293 + }; 294 + 160 295 static const struct sx150x_device_data sx1508q_device_data = { 161 296 .model = SX150X_789, 162 297 .reg_pullup = 0x03, ··· 316 149 .reg_data = 0x08, 317 150 .reg_irq_mask = 0x09, 318 151 .reg_irq_src = 0x0c, 319 - .reg_sense = 0x0b, 152 + .reg_sense = 0x0a, 320 153 .pri.x789 = { 321 154 .reg_drain = 0x05, 322 155 .reg_polarity = 0x06, ··· 331 164 332 165 static const struct sx150x_device_data sx1509q_device_data = { 333 166 .model = SX150X_789, 334 - .reg_pullup = 0x07, 335 - .reg_pulldn = 0x09, 336 - .reg_dir = 0x0f, 337 - .reg_data = 0x11, 338 - .reg_irq_mask = 0x13, 339 - .reg_irq_src = 0x19, 340 - .reg_sense = 0x17, 167 + .reg_pullup = 0x06, 168 + .reg_pulldn = 0x08, 169 + .reg_dir = 0x0e, 170 + .reg_data = 0x10, 171 + .reg_irq_mask = 0x12, 172 + .reg_irq_src = 0x18, 173 + .reg_sense = 0x14, 341 174 .pri.x789 = { 342 - .reg_drain = 0x0b, 343 - .reg_polarity = 0x0d, 175 + .reg_drain = 0x0a, 176 + .reg_polarity = 0x0c, 344 177 .reg_clock = 0x1e, 345 178 .reg_misc = 0x1f, 346 179 .reg_reset = 0x7d, ··· 349 182 .pins = sx150x_16_pins, 350 183 .npins = ARRAY_SIZE(sx150x_16_pins), 351 184 }; 352 - 353 - static const struct sx150x_device_data sx1506q_device_data = { 354 - .model = SX150X_456, 355 - .reg_pullup = 0x05, 356 - .reg_pulldn = 0x07, 357 - .reg_dir = 0x03, 358 - .reg_data = 0x01, 359 - .reg_irq_mask = 0x09, 360 - .reg_irq_src = 0x0f, 361 - .reg_sense = 0x0d, 362 - .pri.x456 = { 363 - .reg_pld_mode = 0x21, 364 - .reg_pld_table0 = 0x23, 365 - .reg_pld_table1 = 0x25, 366 - .reg_pld_table2 = 0x27, 367 - .reg_pld_table3 = 0x29, 368 - .reg_pld_table4 = 0x2b, 369 - .reg_advance = 0xad, 370 - }, 371 - .ngpios = 16, 372 - .pins = sx150x_16_pins, 373 - .npins = 16, /* oscio not available */ 374 - }; 375 - 376 - static const struct sx150x_device_data sx1502q_device_data = { 377 - .model = SX150X_123, 378 - .reg_pullup = 0x02, 379 - .reg_pulldn = 0x03, 380 - .reg_dir = 0x01, 381 - .reg_data = 0x00, 382 - .reg_irq_mask = 0x05, 383 - .reg_irq_src = 0x08, 384 - .reg_sense = 0x07, 385 - .pri.x123 = { 386 - .reg_pld_mode = 0x10, 387 - .reg_pld_table0 = 0x11, 388 - .reg_pld_table1 = 0x12, 389 - .reg_pld_table2 = 0x13, 390 - .reg_pld_table3 = 0x14, 391 - .reg_pld_table4 = 0x15, 392 - .reg_advance = 0xad, 393 - }, 394 - .ngpios = 8, 395 - .pins = sx150x_8_pins, 396 - .npins = 8, /* oscio not available */ 397 - }; 398 - 399 - static s32 sx150x_i2c_write(struct i2c_client *client, u8 reg, u8 val) 400 - { 401 - s32 err = i2c_smbus_write_byte_data(client, reg, val); 402 - 403 - if (err < 0) 404 - dev_warn(&client->dev, 405 - "i2c write fail: can't write %02x to %02x: %d\n", 406 - val, reg, err); 407 - return err; 408 - } 409 - 410 - static s32 sx150x_i2c_read(struct i2c_client *client, u8 reg, u8 *val) 411 - { 412 - s32 err = i2c_smbus_read_byte_data(client, reg); 413 - 414 - if (err >= 0) 415 - *val = err; 416 - else 417 - dev_warn(&client->dev, 418 - "i2c read fail: can't read from %02x: %d\n", 419 - reg, err); 420 - return err; 421 - } 422 - 423 - /* 424 - * These utility functions solve the common problem of locating and setting 425 - * configuration bits. Configuration bits are grouped into registers 426 - * whose indexes increase downwards. For example, with eight-bit registers, 427 - * sixteen gpios would have their config bits grouped in the following order: 428 - * REGISTER N-1 [ f e d c b a 9 8 ] 429 - * N [ 7 6 5 4 3 2 1 0 ] 430 - * 431 - * For multi-bit configurations, the pattern gets wider: 432 - * REGISTER N-3 [ f f e e d d c c ] 433 - * N-2 [ b b a a 9 9 8 8 ] 434 - * N-1 [ 7 7 6 6 5 5 4 4 ] 435 - * N [ 3 3 2 2 1 1 0 0 ] 436 - * 437 - * Given the address of the starting register 'N', the index of the gpio 438 - * whose configuration we seek to change, and the width in bits of that 439 - * configuration, these functions allow us to locate the correct 440 - * register and mask the correct bits. 441 - */ 442 - static inline void sx150x_find_cfg(u8 offset, u8 width, 443 - u8 *reg, u8 *mask, u8 *shift) 444 - { 445 - *reg -= offset * width / 8; 446 - *mask = (1 << width) - 1; 447 - *shift = (offset * width) % 8; 448 - *mask <<= *shift; 449 - } 450 - 451 - static int sx150x_write_cfg(struct i2c_client *client, 452 - u8 offset, u8 width, u8 reg, u8 val) 453 - { 454 - u8 mask; 455 - u8 data; 456 - u8 shift; 457 - int err; 458 - 459 - sx150x_find_cfg(offset, width, &reg, &mask, &shift); 460 - err = sx150x_i2c_read(client, reg, &data); 461 - if (err < 0) 462 - return err; 463 - 464 - data &= ~mask; 465 - data |= (val << shift) & mask; 466 - return sx150x_i2c_write(client, reg, data); 467 - } 468 - 469 - static int sx150x_read_cfg(struct i2c_client *client, 470 - u8 offset, u8 width, u8 reg) 471 - { 472 - u8 mask; 473 - u8 data; 474 - u8 shift; 475 - int err; 476 - 477 - sx150x_find_cfg(offset, width, &reg, &mask, &shift); 478 - err = sx150x_i2c_read(client, reg, &data); 479 - if (err < 0) 480 - return err; 481 - 482 - return (data & mask); 483 - } 484 185 485 186 static int sx150x_pinctrl_get_groups_count(struct pinctrl_dev *pctldev) 486 187 { ··· 395 360 unsigned int offset) 396 361 { 397 362 struct sx150x_pinctrl *pctl = gpiochip_get_data(chip); 398 - int status; 363 + unsigned int value; 364 + int ret; 399 365 400 366 if (sx150x_pin_is_oscio(pctl, offset)) 401 367 return false; 402 368 403 - status = sx150x_read_cfg(pctl->client, offset, 1, pctl->data->reg_dir); 404 - if (status >= 0) 405 - status = !!status; 369 + ret = regmap_read(pctl->regmap, pctl->data->reg_dir, &value); 370 + if (ret < 0) 371 + return ret; 406 372 407 - return status; 373 + return !!(value & BIT(offset)); 408 374 } 409 375 410 376 static int sx150x_gpio_get(struct gpio_chip *chip, unsigned int offset) 411 377 { 412 378 struct sx150x_pinctrl *pctl = gpiochip_get_data(chip); 413 - int status; 379 + unsigned int value; 380 + int ret; 414 381 415 382 if (sx150x_pin_is_oscio(pctl, offset)) 416 383 return -EINVAL; 417 384 418 - status = sx150x_read_cfg(pctl->client, offset, 1, pctl->data->reg_data); 419 - if (status >= 0) 420 - status = !!status; 385 + ret = regmap_read(pctl->regmap, pctl->data->reg_data, &value); 386 + if (ret < 0) 387 + return ret; 421 388 422 - return status; 389 + return !!(value & BIT(offset)); 423 390 } 424 391 425 392 static int sx150x_gpio_set_single_ended(struct gpio_chip *chip, ··· 437 400 sx150x_pin_is_oscio(pctl, offset)) 438 401 return 0; 439 402 440 - mutex_lock(&pctl->lock); 441 - ret = sx150x_write_cfg(pctl->client, offset, 1, 442 - pctl->data->pri.x789.reg_drain, 443 - 0); 444 - mutex_unlock(&pctl->lock); 445 - if (ret < 0) 446 - return ret; 403 + ret = regmap_write_bits(pctl->regmap, 404 + pctl->data->pri.x789.reg_drain, 405 + BIT(offset), 0); 447 406 break; 448 407 449 408 case LINE_MODE_OPEN_DRAIN: ··· 447 414 sx150x_pin_is_oscio(pctl, offset)) 448 415 return -ENOTSUPP; 449 416 450 - mutex_lock(&pctl->lock); 451 - ret = sx150x_write_cfg(pctl->client, offset, 1, 452 - pctl->data->pri.x789.reg_drain, 453 - 1); 454 - mutex_unlock(&pctl->lock); 455 - if (ret < 0) 456 - return ret; 417 + ret = regmap_write_bits(pctl->regmap, 418 + pctl->data->pri.x789.reg_drain, 419 + BIT(offset), BIT(offset)); 457 420 break; 458 - 459 421 default: 460 - return -ENOTSUPP; 422 + ret = -ENOTSUPP; 423 + break; 461 424 } 462 425 463 - return 0; 426 + return ret; 427 + } 428 + 429 + static int __sx150x_gpio_set(struct sx150x_pinctrl *pctl, unsigned int offset, 430 + int value) 431 + { 432 + return regmap_write_bits(pctl->regmap, pctl->data->reg_data, 433 + BIT(offset), value ? BIT(offset) : 0); 434 + } 435 + 436 + static int sx150x_gpio_oscio_set(struct sx150x_pinctrl *pctl, 437 + int value) 438 + { 439 + return regmap_write(pctl->regmap, 440 + pctl->data->pri.x789.reg_clock, 441 + (value ? 0x1f : 0x10)); 464 442 } 465 443 466 444 static void sx150x_gpio_set(struct gpio_chip *chip, unsigned int offset, 467 - int value) 445 + int value) 468 446 { 469 447 struct sx150x_pinctrl *pctl = gpiochip_get_data(chip); 470 448 471 - if (sx150x_pin_is_oscio(pctl, offset)) { 449 + if (sx150x_pin_is_oscio(pctl, offset)) 450 + sx150x_gpio_oscio_set(pctl, value); 451 + else 452 + __sx150x_gpio_set(pctl, offset, value); 472 453 473 - mutex_lock(&pctl->lock); 474 - sx150x_i2c_write(pctl->client, 475 - pctl->data->pri.x789.reg_clock, 476 - (value ? 0x1f : 0x10)); 477 - mutex_unlock(&pctl->lock); 478 - } else { 479 - mutex_lock(&pctl->lock); 480 - sx150x_write_cfg(pctl->client, offset, 1, 481 - pctl->data->reg_data, 482 - (value ? 1 : 0)); 483 - mutex_unlock(&pctl->lock); 484 - } 454 + } 455 + 456 + static void sx150x_gpio_set_multiple(struct gpio_chip *chip, 457 + unsigned long *mask, 458 + unsigned long *bits) 459 + { 460 + struct sx150x_pinctrl *pctl = gpiochip_get_data(chip); 461 + 462 + regmap_write_bits(pctl->regmap, pctl->data->reg_data, *mask, *bits); 485 463 } 486 464 487 465 static int sx150x_gpio_direction_input(struct gpio_chip *chip, 488 - unsigned int offset) 466 + unsigned int offset) 467 + { 468 + struct sx150x_pinctrl *pctl = gpiochip_get_data(chip); 469 + 470 + if (sx150x_pin_is_oscio(pctl, offset)) 471 + return -EINVAL; 472 + 473 + return regmap_write_bits(pctl->regmap, 474 + pctl->data->reg_dir, 475 + BIT(offset), BIT(offset)); 476 + } 477 + 478 + static int sx150x_gpio_direction_output(struct gpio_chip *chip, 479 + unsigned int offset, int value) 489 480 { 490 481 struct sx150x_pinctrl *pctl = gpiochip_get_data(chip); 491 482 int ret; 492 483 493 484 if (sx150x_pin_is_oscio(pctl, offset)) 494 - return -EINVAL; 485 + return sx150x_gpio_oscio_set(pctl, value); 495 486 496 - mutex_lock(&pctl->lock); 497 - ret = sx150x_write_cfg(pctl->client, offset, 1, 498 - pctl->data->reg_dir, 1); 499 - mutex_unlock(&pctl->lock); 487 + ret = __sx150x_gpio_set(pctl, offset, value); 488 + if (ret < 0) 489 + return ret; 500 490 501 - return ret; 502 - } 503 - 504 - static int sx150x_gpio_direction_output(struct gpio_chip *chip, 505 - unsigned int offset, int value) 506 - { 507 - struct sx150x_pinctrl *pctl = gpiochip_get_data(chip); 508 - int status; 509 - 510 - if (sx150x_pin_is_oscio(pctl, offset)) { 511 - sx150x_gpio_set(chip, offset, value); 512 - return 0; 513 - } 514 - 515 - mutex_lock(&pctl->lock); 516 - status = sx150x_write_cfg(pctl->client, offset, 1, 517 - pctl->data->reg_data, 518 - (value ? 1 : 0)); 519 - if (status >= 0) 520 - status = sx150x_write_cfg(pctl->client, offset, 1, 521 - pctl->data->reg_dir, 0); 522 - mutex_unlock(&pctl->lock); 523 - 524 - return status; 491 + return regmap_write_bits(pctl->regmap, 492 + pctl->data->reg_dir, 493 + BIT(offset), 0); 525 494 } 526 495 527 496 static void sx150x_irq_mask(struct irq_data *d) ··· 532 497 gpiochip_get_data(irq_data_get_irq_chip_data(d)); 533 498 unsigned int n = d->hwirq; 534 499 535 - pctl->irq.masked |= (1 << n); 536 - pctl->irq.update = n; 500 + pctl->irq.masked |= BIT(n); 537 501 } 538 502 539 503 static void sx150x_irq_unmask(struct irq_data *d) ··· 541 507 gpiochip_get_data(irq_data_get_irq_chip_data(d)); 542 508 unsigned int n = d->hwirq; 543 509 544 - pctl->irq.masked &= ~(1 << n); 545 - pctl->irq.update = n; 510 + pctl->irq.masked &= ~BIT(n); 511 + } 512 + 513 + static void sx150x_irq_set_sense(struct sx150x_pinctrl *pctl, 514 + unsigned int line, unsigned int sense) 515 + { 516 + /* 517 + * Every interrupt line is represented by two bits shifted 518 + * proportionally to the line number 519 + */ 520 + const unsigned int n = line * 2; 521 + const unsigned int mask = ~((SX150X_IRQ_TYPE_EDGE_RISING | 522 + SX150X_IRQ_TYPE_EDGE_FALLING) << n); 523 + 524 + pctl->irq.sense &= mask; 525 + pctl->irq.sense |= sense << n; 546 526 } 547 527 548 528 static int sx150x_irq_set_type(struct irq_data *d, unsigned int flow_type) ··· 571 523 n = d->hwirq; 572 524 573 525 if (flow_type & IRQ_TYPE_EDGE_RISING) 574 - val |= 0x1; 526 + val |= SX150X_IRQ_TYPE_EDGE_RISING; 575 527 if (flow_type & IRQ_TYPE_EDGE_FALLING) 576 - val |= 0x2; 528 + val |= SX150X_IRQ_TYPE_EDGE_FALLING; 577 529 578 - pctl->irq.sense &= ~(3UL << (n * 2)); 579 - pctl->irq.sense |= val << (n * 2); 580 - pctl->irq.update = n; 530 + sx150x_irq_set_sense(pctl, n, val); 581 531 return 0; 582 532 } 583 533 584 534 static irqreturn_t sx150x_irq_thread_fn(int irq, void *dev_id) 585 535 { 586 536 struct sx150x_pinctrl *pctl = (struct sx150x_pinctrl *)dev_id; 587 - unsigned int nhandled = 0; 588 - unsigned int sub_irq; 589 - unsigned int n; 590 - s32 err; 591 - u8 val; 592 - int i; 537 + unsigned long n, status; 538 + unsigned int val; 539 + int err; 593 540 594 - for (i = (pctl->data->ngpios / 8) - 1; i >= 0; --i) { 595 - err = sx150x_i2c_read(pctl->client, 596 - pctl->data->reg_irq_src - i, 597 - &val); 598 - if (err < 0) 599 - continue; 541 + err = regmap_read(pctl->regmap, pctl->data->reg_irq_src, &val); 542 + if (err < 0) 543 + return IRQ_NONE; 600 544 601 - err = sx150x_i2c_write(pctl->client, 602 - pctl->data->reg_irq_src - i, 603 - val); 604 - if (err < 0) 605 - continue; 545 + err = regmap_write(pctl->regmap, pctl->data->reg_irq_src, val); 546 + if (err < 0) 547 + return IRQ_NONE; 606 548 607 - for (n = 0; n < 8; ++n) { 608 - if (val & (1 << n)) { 609 - sub_irq = irq_find_mapping( 610 - pctl->gpio.irqdomain, 611 - (i * 8) + n); 612 - handle_nested_irq(sub_irq); 613 - ++nhandled; 614 - } 615 - } 616 - } 549 + status = val; 550 + for_each_set_bit(n, &status, pctl->data->ngpios) 551 + handle_nested_irq(irq_find_mapping(pctl->gpio.irqdomain, n)); 617 552 618 - return (nhandled > 0 ? IRQ_HANDLED : IRQ_NONE); 553 + return IRQ_HANDLED; 619 554 } 620 555 621 556 static void sx150x_irq_bus_lock(struct irq_data *d) ··· 613 582 { 614 583 struct sx150x_pinctrl *pctl = 615 584 gpiochip_get_data(irq_data_get_irq_chip_data(d)); 616 - unsigned int n; 617 585 618 - if (pctl->irq.update < 0) 619 - goto out; 620 - 621 - n = pctl->irq.update; 622 - pctl->irq.update = -1; 623 - 624 - /* Avoid updates if nothing changed */ 625 - if (pctl->irq.dev_sense == pctl->irq.sense && 626 - pctl->irq.dev_masked == pctl->irq.masked) 627 - goto out; 628 - 629 - pctl->irq.dev_sense = pctl->irq.sense; 630 - pctl->irq.dev_masked = pctl->irq.masked; 631 - 632 - if (pctl->irq.masked & (1 << n)) { 633 - sx150x_write_cfg(pctl->client, n, 1, 634 - pctl->data->reg_irq_mask, 1); 635 - sx150x_write_cfg(pctl->client, n, 2, 636 - pctl->data->reg_sense, 0); 637 - } else { 638 - sx150x_write_cfg(pctl->client, n, 1, 639 - pctl->data->reg_irq_mask, 0); 640 - sx150x_write_cfg(pctl->client, n, 2, 641 - pctl->data->reg_sense, 642 - pctl->irq.sense >> (n * 2)); 643 - } 644 - out: 586 + regmap_write(pctl->regmap, pctl->data->reg_irq_mask, pctl->irq.masked); 587 + regmap_write(pctl->regmap, pctl->data->reg_sense, pctl->irq.sense); 645 588 mutex_unlock(&pctl->lock); 646 589 } 647 590 ··· 626 621 unsigned int param = pinconf_to_config_param(*config); 627 622 int ret; 628 623 u32 arg; 624 + unsigned int data; 629 625 630 626 if (sx150x_pin_is_oscio(pctl, pin)) { 631 - u8 data; 632 - 633 627 switch (param) { 634 628 case PIN_CONFIG_DRIVE_PUSH_PULL: 635 629 case PIN_CONFIG_OUTPUT: 636 - mutex_lock(&pctl->lock); 637 - ret = sx150x_i2c_read(pctl->client, 638 - pctl->data->pri.x789.reg_clock, 639 - &data); 640 - mutex_unlock(&pctl->lock); 641 - 630 + ret = regmap_read(pctl->regmap, 631 + pctl->data->pri.x789.reg_clock, 632 + &data); 642 633 if (ret < 0) 643 634 return ret; 644 635 ··· 659 658 660 659 switch (param) { 661 660 case PIN_CONFIG_BIAS_PULL_DOWN: 662 - mutex_lock(&pctl->lock); 663 - ret = sx150x_read_cfg(pctl->client, pin, 1, 664 - pctl->data->reg_pulldn); 665 - mutex_unlock(&pctl->lock); 661 + ret = regmap_read(pctl->regmap, 662 + pctl->data->reg_pulldn, 663 + &data); 664 + data &= BIT(pin); 666 665 667 666 if (ret < 0) 668 667 return ret; ··· 674 673 break; 675 674 676 675 case PIN_CONFIG_BIAS_PULL_UP: 677 - mutex_lock(&pctl->lock); 678 - ret = sx150x_read_cfg(pctl->client, pin, 1, 679 - pctl->data->reg_pullup); 680 - mutex_unlock(&pctl->lock); 676 + ret = regmap_read(pctl->regmap, 677 + pctl->data->reg_pullup, 678 + &data); 679 + data &= BIT(pin); 681 680 682 681 if (ret < 0) 683 682 return ret; ··· 692 691 if (pctl->data->model != SX150X_789) 693 692 return -ENOTSUPP; 694 693 695 - mutex_lock(&pctl->lock); 696 - ret = sx150x_read_cfg(pctl->client, pin, 1, 697 - pctl->data->pri.x789.reg_drain); 698 - mutex_unlock(&pctl->lock); 694 + ret = regmap_read(pctl->regmap, 695 + pctl->data->pri.x789.reg_drain, 696 + &data); 697 + data &= BIT(pin); 699 698 700 699 if (ret < 0) 701 700 return ret; 702 701 703 - if (!ret) 702 + if (!data) 704 703 return -EINVAL; 705 704 706 705 arg = 1; ··· 710 709 if (pctl->data->model != SX150X_789) 711 710 arg = true; 712 711 else { 713 - mutex_lock(&pctl->lock); 714 - ret = sx150x_read_cfg(pctl->client, pin, 1, 715 - pctl->data->pri.x789.reg_drain); 716 - mutex_unlock(&pctl->lock); 712 + ret = regmap_read(pctl->regmap, 713 + pctl->data->pri.x789.reg_drain, 714 + &data); 715 + data &= BIT(pin); 717 716 718 717 if (ret < 0) 719 718 return ret; 720 719 721 - if (ret) 720 + if (data) 722 721 return -EINVAL; 723 722 724 723 arg = 1; ··· 778 777 switch (param) { 779 778 case PIN_CONFIG_BIAS_PULL_PIN_DEFAULT: 780 779 case PIN_CONFIG_BIAS_DISABLE: 781 - mutex_lock(&pctl->lock); 782 - ret = sx150x_write_cfg(pctl->client, pin, 1, 783 - pctl->data->reg_pulldn, 0); 784 - mutex_unlock(&pctl->lock); 780 + ret = regmap_write_bits(pctl->regmap, 781 + pctl->data->reg_pulldn, 782 + BIT(pin), 0); 785 783 if (ret < 0) 786 784 return ret; 787 785 788 - mutex_lock(&pctl->lock); 789 - ret = sx150x_write_cfg(pctl->client, pin, 1, 790 - pctl->data->reg_pullup, 0); 791 - mutex_unlock(&pctl->lock); 786 + ret = regmap_write_bits(pctl->regmap, 787 + pctl->data->reg_pullup, 788 + BIT(pin), 0); 792 789 if (ret < 0) 793 790 return ret; 794 791 795 792 break; 796 793 797 794 case PIN_CONFIG_BIAS_PULL_UP: 798 - mutex_lock(&pctl->lock); 799 - ret = sx150x_write_cfg(pctl->client, pin, 1, 800 - pctl->data->reg_pullup, 801 - 1); 802 - mutex_unlock(&pctl->lock); 795 + ret = regmap_write_bits(pctl->regmap, 796 + pctl->data->reg_pullup, 797 + BIT(pin), BIT(pin)); 803 798 if (ret < 0) 804 799 return ret; 805 800 806 801 break; 807 802 808 803 case PIN_CONFIG_BIAS_PULL_DOWN: 809 - mutex_lock(&pctl->lock); 810 - ret = sx150x_write_cfg(pctl->client, pin, 1, 811 - pctl->data->reg_pulldn, 812 - 1); 813 - mutex_unlock(&pctl->lock); 804 + ret = regmap_write_bits(pctl->regmap, 805 + pctl->data->reg_pulldn, 806 + BIT(pin), BIT(pin)); 814 807 if (ret < 0) 815 808 return ret; 816 809 ··· 849 854 }; 850 855 851 856 static const struct i2c_device_id sx150x_id[] = { 857 + {"sx1501q", (kernel_ulong_t) &sx1501q_device_data }, 858 + {"sx1502q", (kernel_ulong_t) &sx1502q_device_data }, 859 + {"sx1503q", (kernel_ulong_t) &sx1503q_device_data }, 860 + {"sx1504q", (kernel_ulong_t) &sx1504q_device_data }, 861 + {"sx1505q", (kernel_ulong_t) &sx1505q_device_data }, 862 + {"sx1506q", (kernel_ulong_t) &sx1506q_device_data }, 863 + {"sx1507q", (kernel_ulong_t) &sx1507q_device_data }, 852 864 {"sx1508q", (kernel_ulong_t) &sx1508q_device_data }, 853 865 {"sx1509q", (kernel_ulong_t) &sx1509q_device_data }, 854 - {"sx1506q", (kernel_ulong_t) &sx1506q_device_data }, 855 - {"sx1502q", (kernel_ulong_t) &sx1502q_device_data }, 856 866 {} 857 867 }; 858 868 859 869 static const struct of_device_id sx150x_of_match[] = { 860 - { .compatible = "semtech,sx1508q" }, 861 - { .compatible = "semtech,sx1509q" }, 862 - { .compatible = "semtech,sx1506q" }, 863 - { .compatible = "semtech,sx1502q" }, 870 + { .compatible = "semtech,sx1501q", .data = &sx1501q_device_data }, 871 + { .compatible = "semtech,sx1502q", .data = &sx1502q_device_data }, 872 + { .compatible = "semtech,sx1503q", .data = &sx1503q_device_data }, 873 + { .compatible = "semtech,sx1504q", .data = &sx1504q_device_data }, 874 + { .compatible = "semtech,sx1505q", .data = &sx1505q_device_data }, 875 + { .compatible = "semtech,sx1506q", .data = &sx1506q_device_data }, 876 + { .compatible = "semtech,sx1507q", .data = &sx1507q_device_data }, 877 + { .compatible = "semtech,sx1508q", .data = &sx1508q_device_data }, 878 + { .compatible = "semtech,sx1509q", .data = &sx1509q_device_data }, 864 879 {}, 865 880 }; 866 - 867 - static int sx150x_init_io(struct sx150x_pinctrl *pctl, u8 base, u16 cfg) 868 - { 869 - int err = 0; 870 - unsigned int n; 871 - 872 - for (n = 0; err >= 0 && n < (pctl->data->ngpios / 8); ++n) 873 - err = sx150x_i2c_write(pctl->client, base - n, cfg >> (n * 8)); 874 - return err; 875 - } 876 881 877 882 static int sx150x_reset(struct sx150x_pinctrl *pctl) 878 883 { ··· 880 885 881 886 err = i2c_smbus_write_byte_data(pctl->client, 882 887 pctl->data->pri.x789.reg_reset, 883 - 0x12); 888 + SX150X_789_RESET_KEY1); 884 889 if (err < 0) 885 890 return err; 886 891 887 892 err = i2c_smbus_write_byte_data(pctl->client, 888 893 pctl->data->pri.x789.reg_reset, 889 - 0x34); 894 + SX150X_789_RESET_KEY2); 890 895 return err; 896 + } 897 + 898 + static int sx150x_init_misc(struct sx150x_pinctrl *pctl) 899 + { 900 + u8 reg, value; 901 + 902 + switch (pctl->data->model) { 903 + case SX150X_789: 904 + reg = pctl->data->pri.x789.reg_misc; 905 + value = SX150X_789_REG_MISC_AUTOCLEAR_OFF; 906 + break; 907 + case SX150X_456: 908 + reg = pctl->data->pri.x456.reg_advanced; 909 + value = 0x00; 910 + 911 + /* 912 + * Only SX1506 has RegAdvanced, SX1504/5 are expected 913 + * to initialize this offset to zero 914 + */ 915 + if (!reg) 916 + return 0; 917 + break; 918 + case SX150X_123: 919 + reg = pctl->data->pri.x123.reg_advanced; 920 + value = 0x00; 921 + break; 922 + default: 923 + WARN(1, "Unknown chip model %d\n", pctl->data->model); 924 + return -EINVAL; 925 + } 926 + 927 + return regmap_write(pctl->regmap, reg, value); 891 928 } 892 929 893 930 static int sx150x_init_hw(struct sx150x_pinctrl *pctl) 894 931 { 932 + const u8 reg[] = { 933 + [SX150X_789] = pctl->data->pri.x789.reg_polarity, 934 + [SX150X_456] = pctl->data->pri.x456.reg_pld_mode, 935 + [SX150X_123] = pctl->data->pri.x123.reg_pld_mode, 936 + }; 895 937 int err; 896 938 897 939 if (pctl->data->model == SX150X_789 && ··· 938 906 return err; 939 907 } 940 908 941 - if (pctl->data->model == SX150X_789) 942 - err = sx150x_i2c_write(pctl->client, 943 - pctl->data->pri.x789.reg_misc, 944 - 0x01); 945 - else if (pctl->data->model == SX150X_456) 946 - err = sx150x_i2c_write(pctl->client, 947 - pctl->data->pri.x456.reg_advance, 948 - 0x04); 949 - else 950 - err = sx150x_i2c_write(pctl->client, 951 - pctl->data->pri.x123.reg_advance, 952 - 0x00); 909 + err = sx150x_init_misc(pctl); 953 910 if (err < 0) 954 911 return err; 955 912 956 913 /* Set all pins to work in normal mode */ 957 - if (pctl->data->model == SX150X_789) { 958 - err = sx150x_init_io(pctl, 959 - pctl->data->pri.x789.reg_polarity, 960 - 0); 961 - if (err < 0) 962 - return err; 963 - } else if (pctl->data->model == SX150X_456) { 964 - /* Set all pins to work in normal mode */ 965 - err = sx150x_init_io(pctl, 966 - pctl->data->pri.x456.reg_pld_mode, 967 - 0); 968 - if (err < 0) 969 - return err; 914 + return regmap_write(pctl->regmap, reg[pctl->data->model], 0); 915 + } 916 + 917 + static int sx150x_regmap_reg_width(struct sx150x_pinctrl *pctl, 918 + unsigned int reg) 919 + { 920 + const struct sx150x_device_data *data = pctl->data; 921 + 922 + if (reg == data->reg_sense) { 923 + /* 924 + * RegSense packs two bits of configuration per GPIO, 925 + * so we'd need to read twice as many bits as there 926 + * are GPIO in our chip 927 + */ 928 + return 2 * data->ngpios; 929 + } else if ((data->model == SX150X_789 && 930 + (reg == data->pri.x789.reg_misc || 931 + reg == data->pri.x789.reg_clock || 932 + reg == data->pri.x789.reg_reset)) 933 + || 934 + (data->model == SX150X_123 && 935 + reg == data->pri.x123.reg_advanced) 936 + || 937 + (data->model == SX150X_456 && 938 + data->pri.x456.reg_advanced && 939 + reg == data->pri.x456.reg_advanced)) { 940 + return 8; 970 941 } else { 971 - /* Set all pins to work in normal mode */ 972 - err = sx150x_init_io(pctl, 973 - pctl->data->pri.x123.reg_pld_mode, 974 - 0); 975 - if (err < 0) 976 - return err; 942 + return data->ngpios; 977 943 } 944 + } 945 + 946 + static unsigned int sx150x_maybe_swizzle(struct sx150x_pinctrl *pctl, 947 + unsigned int reg, unsigned int val) 948 + { 949 + unsigned int a, b; 950 + const struct sx150x_device_data *data = pctl->data; 951 + 952 + /* 953 + * Whereas SX1509 presents RegSense in a simple layout as such: 954 + * reg [ f f e e d d c c ] 955 + * reg + 1 [ b b a a 9 9 8 8 ] 956 + * reg + 2 [ 7 7 6 6 5 5 4 4 ] 957 + * reg + 3 [ 3 3 2 2 1 1 0 0 ] 958 + * 959 + * SX1503 and SX1506 deviate from that data layout, instead storing 960 + * their contents as follows: 961 + * 962 + * reg [ f f e e d d c c ] 963 + * reg + 1 [ 7 7 6 6 5 5 4 4 ] 964 + * reg + 2 [ b b a a 9 9 8 8 ] 965 + * reg + 3 [ 3 3 2 2 1 1 0 0 ] 966 + * 967 + * so, taking that into account, we swap two 968 + * inner bytes of a 4-byte result 969 + */ 970 + 971 + if (reg == data->reg_sense && 972 + data->ngpios == 16 && 973 + (data->model == SX150X_123 || 974 + data->model == SX150X_456)) { 975 + a = val & 0x00ff0000; 976 + b = val & 0x0000ff00; 977 + 978 + val &= 0xff0000ff; 979 + val |= b << 8; 980 + val |= a >> 8; 981 + } 982 + 983 + return val; 984 + } 985 + 986 + /* 987 + * In order to mask the differences between 16 and 8 bit expander 988 + * devices we set up a sligthly ficticious regmap that pretends to be 989 + * a set of 32-bit (to accomodate RegSenseLow/RegSenseHigh 990 + * pair/quartet) registers and transparently reconstructs those 991 + * registers via multiple I2C/SMBus reads 992 + * 993 + * This way the rest of the driver code, interfacing with the chip via 994 + * regmap API, can work assuming that each GPIO pin is represented by 995 + * a group of bits at an offset proportional to GPIO number within a 996 + * given register. 997 + */ 998 + static int sx150x_regmap_reg_read(void *context, unsigned int reg, 999 + unsigned int *result) 1000 + { 1001 + int ret, n; 1002 + struct sx150x_pinctrl *pctl = context; 1003 + struct i2c_client *i2c = pctl->client; 1004 + const int width = sx150x_regmap_reg_width(pctl, reg); 1005 + unsigned int idx, val; 1006 + 1007 + /* 1008 + * There are four potential cases covered by this function: 1009 + * 1010 + * 1) 8-pin chip, single configuration bit register 1011 + * 1012 + * This is trivial the code below just needs to read: 1013 + * reg [ 7 6 5 4 3 2 1 0 ] 1014 + * 1015 + * 2) 8-pin chip, double configuration bit register (RegSense) 1016 + * 1017 + * The read will be done as follows: 1018 + * reg [ 7 7 6 6 5 5 4 4 ] 1019 + * reg + 1 [ 3 3 2 2 1 1 0 0 ] 1020 + * 1021 + * 3) 16-pin chip, single configuration bit register 1022 + * 1023 + * The read will be done as follows: 1024 + * reg [ f e d c b a 9 8 ] 1025 + * reg + 1 [ 7 6 5 4 3 2 1 0 ] 1026 + * 1027 + * 4) 16-pin chip, double configuration bit register (RegSense) 1028 + * 1029 + * The read will be done as follows: 1030 + * reg [ f f e e d d c c ] 1031 + * reg + 1 [ b b a a 9 9 8 8 ] 1032 + * reg + 2 [ 7 7 6 6 5 5 4 4 ] 1033 + * reg + 3 [ 3 3 2 2 1 1 0 0 ] 1034 + */ 1035 + 1036 + for (n = width, val = 0, idx = reg; n > 0; n -= 8, idx++) { 1037 + val <<= 8; 1038 + 1039 + ret = i2c_smbus_read_byte_data(i2c, idx); 1040 + if (ret < 0) 1041 + return ret; 1042 + 1043 + val |= ret; 1044 + } 1045 + 1046 + *result = sx150x_maybe_swizzle(pctl, reg, val); 978 1047 979 1048 return 0; 980 1049 } 1050 + 1051 + static int sx150x_regmap_reg_write(void *context, unsigned int reg, 1052 + unsigned int val) 1053 + { 1054 + int ret, n; 1055 + struct sx150x_pinctrl *pctl = context; 1056 + struct i2c_client *i2c = pctl->client; 1057 + const int width = sx150x_regmap_reg_width(pctl, reg); 1058 + 1059 + val = sx150x_maybe_swizzle(pctl, reg, val); 1060 + 1061 + n = (width - 1) & ~7; 1062 + do { 1063 + const u8 byte = (val >> n) & 0xff; 1064 + 1065 + ret = i2c_smbus_write_byte_data(i2c, reg, byte); 1066 + if (ret < 0) 1067 + return ret; 1068 + 1069 + reg++; 1070 + n -= 8; 1071 + } while (n >= 0); 1072 + 1073 + return 0; 1074 + } 1075 + 1076 + static bool sx150x_reg_volatile(struct device *dev, unsigned int reg) 1077 + { 1078 + struct sx150x_pinctrl *pctl = i2c_get_clientdata(to_i2c_client(dev)); 1079 + 1080 + return reg == pctl->data->reg_irq_src || reg == pctl->data->reg_data; 1081 + } 1082 + 1083 + const struct regmap_config sx150x_regmap_config = { 1084 + .reg_bits = 8, 1085 + .val_bits = 32, 1086 + 1087 + .cache_type = REGCACHE_RBTREE, 1088 + 1089 + .reg_read = sx150x_regmap_reg_read, 1090 + .reg_write = sx150x_regmap_reg_write, 1091 + 1092 + .max_register = SX150X_MAX_REGISTER, 1093 + .volatile_reg = sx150x_reg_volatile, 1094 + }; 981 1095 982 1096 static int sx150x_probe(struct i2c_client *client, 983 1097 const struct i2c_device_id *id) ··· 1134 956 struct sx150x_pinctrl *pctl; 1135 957 int ret; 1136 958 1137 - if (!id->driver_data) 1138 - return -EINVAL; 1139 - 1140 959 if (!i2c_check_functionality(client->adapter, i2c_funcs)) 1141 960 return -ENOSYS; 1142 961 ··· 1141 966 if (!pctl) 1142 967 return -ENOMEM; 1143 968 969 + i2c_set_clientdata(client, pctl); 970 + 1144 971 pctl->dev = dev; 1145 972 pctl->client = client; 1146 - pctl->data = (void *)id->driver_data; 973 + 974 + if (dev->of_node) 975 + pctl->data = of_device_get_match_data(dev); 976 + else 977 + pctl->data = (struct sx150x_device_data *)id->driver_data; 978 + 979 + if (!pctl->data) 980 + return -EINVAL; 981 + 982 + pctl->regmap = devm_regmap_init(dev, NULL, pctl, 983 + &sx150x_regmap_config); 984 + if (IS_ERR(pctl->regmap)) { 985 + ret = PTR_ERR(pctl->regmap); 986 + dev_err(dev, "Failed to allocate register map: %d\n", 987 + ret); 988 + return ret; 989 + } 1147 990 1148 991 mutex_init(&pctl->lock); 1149 992 ··· 1184 991 pctl->gpio.of_node = dev->of_node; 1185 992 #endif 1186 993 pctl->gpio.can_sleep = true; 994 + /* 995 + * Setting multiple pins is not safe when all pins are not 996 + * handled by the same regmap register. The oscio pin (present 997 + * on the SX150X_789 chips) lives in its own register, so 998 + * would require locking that is not in place at this time. 999 + */ 1000 + if (pctl->data->model != SX150X_789) 1001 + pctl->gpio.set_multiple = sx150x_gpio_set_multiple; 1187 1002 1188 1003 ret = devm_gpiochip_add_data(dev, &pctl->gpio, pctl); 1189 1004 if (ret) ··· 1209 1008 1210 1009 pctl->irq.masked = ~0; 1211 1010 pctl->irq.sense = 0; 1212 - pctl->irq.dev_masked = ~0; 1213 - pctl->irq.dev_sense = 0; 1214 - pctl->irq.update = -1; 1215 1011 1216 - ret = gpiochip_irqchip_add(&pctl->gpio, 1217 - &pctl->irq_chip, 0, 1218 - handle_edge_irq, IRQ_TYPE_NONE); 1012 + /* 1013 + * Because sx150x_irq_threaded_fn invokes all of the 1014 + * nested interrrupt handlers via handle_nested_irq, 1015 + * any "handler" passed to gpiochip_irqchip_add() 1016 + * below is going to be ignored, so the choice of the 1017 + * function does not matter that much. 1018 + * 1019 + * We set it to handle_bad_irq to avoid confusion, 1020 + * plus it will be instantly noticeable if it is ever 1021 + * called (should not happen) 1022 + */ 1023 + ret = gpiochip_irqchip_add_nested(&pctl->gpio, 1024 + &pctl->irq_chip, 0, 1025 + handle_bad_irq, IRQ_TYPE_NONE); 1219 1026 if (ret) { 1220 1027 dev_err(dev, "could not connect irqchip to gpiochip\n"); 1221 1028 return ret; ··· 1236 1027 pctl->irq_chip.name, pctl); 1237 1028 if (ret < 0) 1238 1029 return ret; 1030 + 1031 + gpiochip_set_nested_irqchip(&pctl->gpio, 1032 + &pctl->irq_chip, 1033 + client->irq); 1239 1034 } 1240 1035 1241 1036 /* Pinctrl_desc */
+5 -1
drivers/pinctrl/pinctrl-zynq.c
··· 247 247 static const unsigned int smc0_nand_pins[] = {0, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 248 248 12, 13, 14, 16, 17, 18, 19, 20, 249 249 21, 22, 23}; 250 + static const unsigned int smc0_nand8_pins[] = {0, 2, 3, 4, 5, 6, 7, 251 + 8, 9, 10, 11, 12, 13, 14}; 250 252 /* Note: CAN MIO clock inputs are modeled in the clock framework */ 251 253 static const unsigned int can0_0_pins[] = {10, 11}; 252 254 static const unsigned int can0_1_pins[] = {14, 15}; ··· 447 445 DEFINE_ZYNQ_PINCTRL_GRP(smc0_nor_cs1), 448 446 DEFINE_ZYNQ_PINCTRL_GRP(smc0_nor_addr25), 449 447 DEFINE_ZYNQ_PINCTRL_GRP(smc0_nand), 448 + DEFINE_ZYNQ_PINCTRL_GRP(smc0_nand8), 450 449 DEFINE_ZYNQ_PINCTRL_GRP(can0_0), 451 450 DEFINE_ZYNQ_PINCTRL_GRP(can0_1), 452 451 DEFINE_ZYNQ_PINCTRL_GRP(can0_2), ··· 712 709 static const char * const smc0_nor_groups[] = {"smc0_nor_grp"}; 713 710 static const char * const smc0_nor_cs1_groups[] = {"smc0_nor_cs1_grp"}; 714 711 static const char * const smc0_nor_addr25_groups[] = {"smc0_nor_addr25_grp"}; 715 - static const char * const smc0_nand_groups[] = {"smc0_nand_grp"}; 712 + static const char * const smc0_nand_groups[] = {"smc0_nand_grp", 713 + "smc0_nand8_grp"}; 716 714 static const char * const can0_groups[] = {"can0_0_grp", "can0_1_grp", 717 715 "can0_2_grp", "can0_3_grp", "can0_4_grp", "can0_5_grp", 718 716 "can0_6_grp", "can0_7_grp", "can0_8_grp", "can0_9_grp",
+9
drivers/pinctrl/qcom/Kconfig
··· 79 79 This is the pinctrl, pinmux, pinconf and gpiolib driver for the 80 80 Qualcomm TLMM block found on the Qualcomm 8916 platform. 81 81 82 + config PINCTRL_MSM8994 83 + tristate "Qualcomm 8994 pin controller driver" 84 + depends on GPIOLIB && OF 85 + select PINCTRL_MSM 86 + help 87 + This is the pinctrl, pinmux, pinconf and gpiolib driver for the 88 + Qualcomm TLMM block found in the Qualcomm 8994 platform. The 89 + Qualcomm 8992 platform is also supported by this driver. 90 + 82 91 config PINCTRL_MSM8996 83 92 tristate "Qualcomm MSM8996 pin controller driver" 84 93 depends on GPIOLIB && OF
+1
drivers/pinctrl/qcom/Makefile
··· 8 8 obj-$(CONFIG_PINCTRL_MSM8960) += pinctrl-msm8960.o 9 9 obj-$(CONFIG_PINCTRL_MSM8X74) += pinctrl-msm8x74.o 10 10 obj-$(CONFIG_PINCTRL_MSM8916) += pinctrl-msm8916.o 11 + obj-$(CONFIG_PINCTRL_MSM8994) += pinctrl-msm8994.o 11 12 obj-$(CONFIG_PINCTRL_MSM8996) += pinctrl-msm8996.o 12 13 obj-$(CONFIG_PINCTRL_QDF2XXX) += pinctrl-qdf2xxx.o 13 14 obj-$(CONFIG_PINCTRL_MDM9615) += pinctrl-mdm9615.o
+1379
drivers/pinctrl/qcom/pinctrl-msm8994.c
··· 1 + /* 2 + * Copyright (c) 2016, The Linux Foundation. All rights reserved. 3 + * 4 + * This program is free software; you can redistribute it and/or modify 5 + * it under the terms of the GNU General Public License version 2 and 6 + * only version 2 as published by the Free Software Foundation. 7 + * 8 + * This program is distributed in the hope that it will be useful, 9 + * but WITHOUT ANY WARRANTY; without even the implied warranty of 10 + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 11 + * GNU General Public License for more details. 12 + */ 13 + 14 + #include <linux/module.h> 15 + #include <linux/of.h> 16 + #include <linux/platform_device.h> 17 + #include <linux/pinctrl/pinctrl.h> 18 + 19 + #include "pinctrl-msm.h" 20 + 21 + #define FUNCTION(fname) \ 22 + [MSM_MUX_##fname] = { \ 23 + .name = #fname, \ 24 + .groups = fname##_groups, \ 25 + .ngroups = ARRAY_SIZE(fname##_groups), \ 26 + } 27 + 28 + #define PINGROUP(id, f1, f2, f3, f4, f5, f6, f7, f8, f9, f10, f11) \ 29 + { \ 30 + .name = "gpio" #id, \ 31 + .pins = gpio##id##_pins, \ 32 + .npins = ARRAY_SIZE(gpio##id##_pins), \ 33 + .funcs = (int[]){ \ 34 + MSM_MUX_gpio, \ 35 + MSM_MUX_##f1, \ 36 + MSM_MUX_##f2, \ 37 + MSM_MUX_##f3, \ 38 + MSM_MUX_##f4, \ 39 + MSM_MUX_##f5, \ 40 + MSM_MUX_##f6, \ 41 + MSM_MUX_##f7, \ 42 + MSM_MUX_##f8, \ 43 + MSM_MUX_##f9, \ 44 + MSM_MUX_##f10, \ 45 + MSM_MUX_##f11 \ 46 + }, \ 47 + .nfuncs = 12, \ 48 + .ctl_reg = 0x1000 + 0x10 * id, \ 49 + .io_reg = 0x1004 + 0x10 * id, \ 50 + .intr_cfg_reg = 0x1008 + 0x10 * id, \ 51 + .intr_status_reg = 0x100c + 0x10 * id, \ 52 + .intr_target_reg = 0x1008 + 0x10 * id, \ 53 + .mux_bit = 2, \ 54 + .pull_bit = 0, \ 55 + .drv_bit = 6, \ 56 + .oe_bit = 9, \ 57 + .in_bit = 0, \ 58 + .out_bit = 1, \ 59 + .intr_enable_bit = 0, \ 60 + .intr_status_bit = 0, \ 61 + .intr_target_bit = 5, \ 62 + .intr_target_kpss_val = 4, \ 63 + .intr_raw_status_bit = 4, \ 64 + .intr_polarity_bit = 1, \ 65 + .intr_detection_bit = 2, \ 66 + .intr_detection_width = 2, \ 67 + } 68 + 69 + #define SDC_PINGROUP(pg_name, ctl, pull, drv) \ 70 + { \ 71 + .name = #pg_name, \ 72 + .pins = pg_name##_pins, \ 73 + .npins = ARRAY_SIZE(pg_name##_pins), \ 74 + .ctl_reg = ctl, \ 75 + .io_reg = 0, \ 76 + .intr_cfg_reg = 0, \ 77 + .intr_status_reg = 0, \ 78 + .intr_target_reg = 0, \ 79 + .mux_bit = -1, \ 80 + .pull_bit = pull, \ 81 + .drv_bit = drv, \ 82 + .oe_bit = -1, \ 83 + .in_bit = -1, \ 84 + .out_bit = -1, \ 85 + .intr_enable_bit = -1, \ 86 + .intr_status_bit = -1, \ 87 + .intr_target_bit = -1, \ 88 + .intr_target_kpss_val = -1, \ 89 + .intr_raw_status_bit = -1, \ 90 + .intr_polarity_bit = -1, \ 91 + .intr_detection_bit = -1, \ 92 + .intr_detection_width = -1, \ 93 + } 94 + static const struct pinctrl_pin_desc msm8994_pins[] = { 95 + PINCTRL_PIN(0, "GPIO_0"), 96 + PINCTRL_PIN(1, "GPIO_1"), 97 + PINCTRL_PIN(2, "GPIO_2"), 98 + PINCTRL_PIN(3, "GPIO_3"), 99 + PINCTRL_PIN(4, "GPIO_4"), 100 + PINCTRL_PIN(5, "GPIO_5"), 101 + PINCTRL_PIN(6, "GPIO_6"), 102 + PINCTRL_PIN(7, "GPIO_7"), 103 + PINCTRL_PIN(8, "GPIO_8"), 104 + PINCTRL_PIN(9, "GPIO_9"), 105 + PINCTRL_PIN(10, "GPIO_10"), 106 + PINCTRL_PIN(11, "GPIO_11"), 107 + PINCTRL_PIN(12, "GPIO_12"), 108 + PINCTRL_PIN(13, "GPIO_13"), 109 + PINCTRL_PIN(14, "GPIO_14"), 110 + PINCTRL_PIN(15, "GPIO_15"), 111 + PINCTRL_PIN(16, "GPIO_16"), 112 + PINCTRL_PIN(17, "GPIO_17"), 113 + PINCTRL_PIN(18, "GPIO_18"), 114 + PINCTRL_PIN(19, "GPIO_19"), 115 + PINCTRL_PIN(20, "GPIO_20"), 116 + PINCTRL_PIN(21, "GPIO_21"), 117 + PINCTRL_PIN(22, "GPIO_22"), 118 + PINCTRL_PIN(23, "GPIO_23"), 119 + PINCTRL_PIN(24, "GPIO_24"), 120 + PINCTRL_PIN(25, "GPIO_25"), 121 + PINCTRL_PIN(26, "GPIO_26"), 122 + PINCTRL_PIN(27, "GPIO_27"), 123 + PINCTRL_PIN(28, "GPIO_28"), 124 + PINCTRL_PIN(29, "GPIO_29"), 125 + PINCTRL_PIN(30, "GPIO_30"), 126 + PINCTRL_PIN(31, "GPIO_31"), 127 + PINCTRL_PIN(32, "GPIO_32"), 128 + PINCTRL_PIN(33, "GPIO_33"), 129 + PINCTRL_PIN(34, "GPIO_34"), 130 + PINCTRL_PIN(35, "GPIO_35"), 131 + PINCTRL_PIN(36, "GPIO_36"), 132 + PINCTRL_PIN(37, "GPIO_37"), 133 + PINCTRL_PIN(38, "GPIO_38"), 134 + PINCTRL_PIN(39, "GPIO_39"), 135 + PINCTRL_PIN(40, "GPIO_40"), 136 + PINCTRL_PIN(41, "GPIO_41"), 137 + PINCTRL_PIN(42, "GPIO_42"), 138 + PINCTRL_PIN(43, "GPIO_43"), 139 + PINCTRL_PIN(44, "GPIO_44"), 140 + PINCTRL_PIN(45, "GPIO_45"), 141 + PINCTRL_PIN(46, "GPIO_46"), 142 + PINCTRL_PIN(47, "GPIO_47"), 143 + PINCTRL_PIN(48, "GPIO_48"), 144 + PINCTRL_PIN(49, "GPIO_49"), 145 + PINCTRL_PIN(50, "GPIO_50"), 146 + PINCTRL_PIN(51, "GPIO_51"), 147 + PINCTRL_PIN(52, "GPIO_52"), 148 + PINCTRL_PIN(53, "GPIO_53"), 149 + PINCTRL_PIN(54, "GPIO_54"), 150 + PINCTRL_PIN(55, "GPIO_55"), 151 + PINCTRL_PIN(56, "GPIO_56"), 152 + PINCTRL_PIN(57, "GPIO_57"), 153 + PINCTRL_PIN(58, "GPIO_58"), 154 + PINCTRL_PIN(59, "GPIO_59"), 155 + PINCTRL_PIN(60, "GPIO_60"), 156 + PINCTRL_PIN(61, "GPIO_61"), 157 + PINCTRL_PIN(62, "GPIO_62"), 158 + PINCTRL_PIN(63, "GPIO_63"), 159 + PINCTRL_PIN(64, "GPIO_64"), 160 + PINCTRL_PIN(65, "GPIO_65"), 161 + PINCTRL_PIN(66, "GPIO_66"), 162 + PINCTRL_PIN(67, "GPIO_67"), 163 + PINCTRL_PIN(68, "GPIO_68"), 164 + PINCTRL_PIN(69, "GPIO_69"), 165 + PINCTRL_PIN(70, "GPIO_70"), 166 + PINCTRL_PIN(71, "GPIO_71"), 167 + PINCTRL_PIN(72, "GPIO_72"), 168 + PINCTRL_PIN(73, "GPIO_73"), 169 + PINCTRL_PIN(74, "GPIO_74"), 170 + PINCTRL_PIN(75, "GPIO_75"), 171 + PINCTRL_PIN(76, "GPIO_76"), 172 + PINCTRL_PIN(77, "GPIO_77"), 173 + PINCTRL_PIN(78, "GPIO_78"), 174 + PINCTRL_PIN(79, "GPIO_79"), 175 + PINCTRL_PIN(80, "GPIO_80"), 176 + PINCTRL_PIN(81, "GPIO_81"), 177 + PINCTRL_PIN(82, "GPIO_82"), 178 + PINCTRL_PIN(83, "GPIO_83"), 179 + PINCTRL_PIN(84, "GPIO_84"), 180 + PINCTRL_PIN(85, "GPIO_85"), 181 + PINCTRL_PIN(86, "GPIO_86"), 182 + PINCTRL_PIN(87, "GPIO_87"), 183 + PINCTRL_PIN(88, "GPIO_88"), 184 + PINCTRL_PIN(89, "GPIO_89"), 185 + PINCTRL_PIN(90, "GPIO_90"), 186 + PINCTRL_PIN(91, "GPIO_91"), 187 + PINCTRL_PIN(92, "GPIO_92"), 188 + PINCTRL_PIN(93, "GPIO_93"), 189 + PINCTRL_PIN(94, "GPIO_94"), 190 + PINCTRL_PIN(95, "GPIO_95"), 191 + PINCTRL_PIN(96, "GPIO_96"), 192 + PINCTRL_PIN(97, "GPIO_97"), 193 + PINCTRL_PIN(98, "GPIO_98"), 194 + PINCTRL_PIN(99, "GPIO_99"), 195 + PINCTRL_PIN(100, "GPIO_100"), 196 + PINCTRL_PIN(101, "GPIO_101"), 197 + PINCTRL_PIN(102, "GPIO_102"), 198 + PINCTRL_PIN(103, "GPIO_103"), 199 + PINCTRL_PIN(104, "GPIO_104"), 200 + PINCTRL_PIN(105, "GPIO_105"), 201 + PINCTRL_PIN(106, "GPIO_106"), 202 + PINCTRL_PIN(107, "GPIO_107"), 203 + PINCTRL_PIN(108, "GPIO_108"), 204 + PINCTRL_PIN(109, "GPIO_109"), 205 + PINCTRL_PIN(110, "GPIO_110"), 206 + PINCTRL_PIN(111, "GPIO_111"), 207 + PINCTRL_PIN(112, "GPIO_112"), 208 + PINCTRL_PIN(113, "GPIO_113"), 209 + PINCTRL_PIN(114, "GPIO_114"), 210 + PINCTRL_PIN(115, "GPIO_115"), 211 + PINCTRL_PIN(116, "GPIO_116"), 212 + PINCTRL_PIN(117, "GPIO_117"), 213 + PINCTRL_PIN(118, "GPIO_118"), 214 + PINCTRL_PIN(119, "GPIO_119"), 215 + PINCTRL_PIN(120, "GPIO_120"), 216 + PINCTRL_PIN(121, "GPIO_121"), 217 + PINCTRL_PIN(122, "GPIO_122"), 218 + PINCTRL_PIN(123, "GPIO_123"), 219 + PINCTRL_PIN(124, "GPIO_124"), 220 + PINCTRL_PIN(125, "GPIO_125"), 221 + PINCTRL_PIN(126, "GPIO_126"), 222 + PINCTRL_PIN(127, "GPIO_127"), 223 + PINCTRL_PIN(128, "GPIO_128"), 224 + PINCTRL_PIN(129, "GPIO_129"), 225 + PINCTRL_PIN(130, "GPIO_130"), 226 + PINCTRL_PIN(131, "GPIO_131"), 227 + PINCTRL_PIN(132, "GPIO_132"), 228 + PINCTRL_PIN(133, "GPIO_133"), 229 + PINCTRL_PIN(134, "GPIO_134"), 230 + PINCTRL_PIN(135, "GPIO_135"), 231 + PINCTRL_PIN(136, "GPIO_136"), 232 + PINCTRL_PIN(137, "GPIO_137"), 233 + PINCTRL_PIN(138, "GPIO_138"), 234 + PINCTRL_PIN(139, "GPIO_139"), 235 + PINCTRL_PIN(140, "GPIO_140"), 236 + PINCTRL_PIN(141, "GPIO_141"), 237 + PINCTRL_PIN(142, "GPIO_142"), 238 + PINCTRL_PIN(143, "GPIO_143"), 239 + PINCTRL_PIN(144, "GPIO_144"), 240 + PINCTRL_PIN(145, "GPIO_145"), 241 + PINCTRL_PIN(146, "SDC1_RCLK"), 242 + PINCTRL_PIN(147, "SDC1_CLK"), 243 + PINCTRL_PIN(148, "SDC1_CMD"), 244 + PINCTRL_PIN(149, "SDC1_DATA"), 245 + PINCTRL_PIN(150, "SDC2_CLK"), 246 + PINCTRL_PIN(151, "SDC2_CMD"), 247 + PINCTRL_PIN(152, "SDC2_DATA"), 248 + PINCTRL_PIN(153, "SDC3_CLK"), 249 + PINCTRL_PIN(154, "SDC3_CMD"), 250 + PINCTRL_PIN(155, "SDC3_DATA"), 251 + }; 252 + 253 + #define DECLARE_MSM_GPIO_PINS(pin) \ 254 + static const unsigned int gpio##pin##_pins[] = { pin } 255 + DECLARE_MSM_GPIO_PINS(0); 256 + DECLARE_MSM_GPIO_PINS(1); 257 + DECLARE_MSM_GPIO_PINS(2); 258 + DECLARE_MSM_GPIO_PINS(3); 259 + DECLARE_MSM_GPIO_PINS(4); 260 + DECLARE_MSM_GPIO_PINS(5); 261 + DECLARE_MSM_GPIO_PINS(6); 262 + DECLARE_MSM_GPIO_PINS(7); 263 + DECLARE_MSM_GPIO_PINS(8); 264 + DECLARE_MSM_GPIO_PINS(9); 265 + DECLARE_MSM_GPIO_PINS(10); 266 + DECLARE_MSM_GPIO_PINS(11); 267 + DECLARE_MSM_GPIO_PINS(12); 268 + DECLARE_MSM_GPIO_PINS(13); 269 + DECLARE_MSM_GPIO_PINS(14); 270 + DECLARE_MSM_GPIO_PINS(15); 271 + DECLARE_MSM_GPIO_PINS(16); 272 + DECLARE_MSM_GPIO_PINS(17); 273 + DECLARE_MSM_GPIO_PINS(18); 274 + DECLARE_MSM_GPIO_PINS(19); 275 + DECLARE_MSM_GPIO_PINS(20); 276 + DECLARE_MSM_GPIO_PINS(21); 277 + DECLARE_MSM_GPIO_PINS(22); 278 + DECLARE_MSM_GPIO_PINS(23); 279 + DECLARE_MSM_GPIO_PINS(24); 280 + DECLARE_MSM_GPIO_PINS(25); 281 + DECLARE_MSM_GPIO_PINS(26); 282 + DECLARE_MSM_GPIO_PINS(27); 283 + DECLARE_MSM_GPIO_PINS(28); 284 + DECLARE_MSM_GPIO_PINS(29); 285 + DECLARE_MSM_GPIO_PINS(30); 286 + DECLARE_MSM_GPIO_PINS(31); 287 + DECLARE_MSM_GPIO_PINS(32); 288 + DECLARE_MSM_GPIO_PINS(33); 289 + DECLARE_MSM_GPIO_PINS(34); 290 + DECLARE_MSM_GPIO_PINS(35); 291 + DECLARE_MSM_GPIO_PINS(36); 292 + DECLARE_MSM_GPIO_PINS(37); 293 + DECLARE_MSM_GPIO_PINS(38); 294 + DECLARE_MSM_GPIO_PINS(39); 295 + DECLARE_MSM_GPIO_PINS(40); 296 + DECLARE_MSM_GPIO_PINS(41); 297 + DECLARE_MSM_GPIO_PINS(42); 298 + DECLARE_MSM_GPIO_PINS(43); 299 + DECLARE_MSM_GPIO_PINS(44); 300 + DECLARE_MSM_GPIO_PINS(45); 301 + DECLARE_MSM_GPIO_PINS(46); 302 + DECLARE_MSM_GPIO_PINS(47); 303 + DECLARE_MSM_GPIO_PINS(48); 304 + DECLARE_MSM_GPIO_PINS(49); 305 + DECLARE_MSM_GPIO_PINS(50); 306 + DECLARE_MSM_GPIO_PINS(51); 307 + DECLARE_MSM_GPIO_PINS(52); 308 + DECLARE_MSM_GPIO_PINS(53); 309 + DECLARE_MSM_GPIO_PINS(54); 310 + DECLARE_MSM_GPIO_PINS(55); 311 + DECLARE_MSM_GPIO_PINS(56); 312 + DECLARE_MSM_GPIO_PINS(57); 313 + DECLARE_MSM_GPIO_PINS(58); 314 + DECLARE_MSM_GPIO_PINS(59); 315 + DECLARE_MSM_GPIO_PINS(60); 316 + DECLARE_MSM_GPIO_PINS(61); 317 + DECLARE_MSM_GPIO_PINS(62); 318 + DECLARE_MSM_GPIO_PINS(63); 319 + DECLARE_MSM_GPIO_PINS(64); 320 + DECLARE_MSM_GPIO_PINS(65); 321 + DECLARE_MSM_GPIO_PINS(66); 322 + DECLARE_MSM_GPIO_PINS(67); 323 + DECLARE_MSM_GPIO_PINS(68); 324 + DECLARE_MSM_GPIO_PINS(69); 325 + DECLARE_MSM_GPIO_PINS(70); 326 + DECLARE_MSM_GPIO_PINS(71); 327 + DECLARE_MSM_GPIO_PINS(72); 328 + DECLARE_MSM_GPIO_PINS(73); 329 + DECLARE_MSM_GPIO_PINS(74); 330 + DECLARE_MSM_GPIO_PINS(75); 331 + DECLARE_MSM_GPIO_PINS(76); 332 + DECLARE_MSM_GPIO_PINS(77); 333 + DECLARE_MSM_GPIO_PINS(78); 334 + DECLARE_MSM_GPIO_PINS(79); 335 + DECLARE_MSM_GPIO_PINS(80); 336 + DECLARE_MSM_GPIO_PINS(81); 337 + DECLARE_MSM_GPIO_PINS(82); 338 + DECLARE_MSM_GPIO_PINS(83); 339 + DECLARE_MSM_GPIO_PINS(84); 340 + DECLARE_MSM_GPIO_PINS(85); 341 + DECLARE_MSM_GPIO_PINS(86); 342 + DECLARE_MSM_GPIO_PINS(87); 343 + DECLARE_MSM_GPIO_PINS(88); 344 + DECLARE_MSM_GPIO_PINS(89); 345 + DECLARE_MSM_GPIO_PINS(90); 346 + DECLARE_MSM_GPIO_PINS(91); 347 + DECLARE_MSM_GPIO_PINS(92); 348 + DECLARE_MSM_GPIO_PINS(93); 349 + DECLARE_MSM_GPIO_PINS(94); 350 + DECLARE_MSM_GPIO_PINS(95); 351 + DECLARE_MSM_GPIO_PINS(96); 352 + DECLARE_MSM_GPIO_PINS(97); 353 + DECLARE_MSM_GPIO_PINS(98); 354 + DECLARE_MSM_GPIO_PINS(99); 355 + DECLARE_MSM_GPIO_PINS(100); 356 + DECLARE_MSM_GPIO_PINS(101); 357 + DECLARE_MSM_GPIO_PINS(102); 358 + DECLARE_MSM_GPIO_PINS(103); 359 + DECLARE_MSM_GPIO_PINS(104); 360 + DECLARE_MSM_GPIO_PINS(105); 361 + DECLARE_MSM_GPIO_PINS(106); 362 + DECLARE_MSM_GPIO_PINS(107); 363 + DECLARE_MSM_GPIO_PINS(108); 364 + DECLARE_MSM_GPIO_PINS(109); 365 + DECLARE_MSM_GPIO_PINS(110); 366 + DECLARE_MSM_GPIO_PINS(111); 367 + DECLARE_MSM_GPIO_PINS(112); 368 + DECLARE_MSM_GPIO_PINS(113); 369 + DECLARE_MSM_GPIO_PINS(114); 370 + DECLARE_MSM_GPIO_PINS(115); 371 + DECLARE_MSM_GPIO_PINS(116); 372 + DECLARE_MSM_GPIO_PINS(117); 373 + DECLARE_MSM_GPIO_PINS(118); 374 + DECLARE_MSM_GPIO_PINS(119); 375 + DECLARE_MSM_GPIO_PINS(120); 376 + DECLARE_MSM_GPIO_PINS(121); 377 + DECLARE_MSM_GPIO_PINS(122); 378 + DECLARE_MSM_GPIO_PINS(123); 379 + DECLARE_MSM_GPIO_PINS(124); 380 + DECLARE_MSM_GPIO_PINS(125); 381 + DECLARE_MSM_GPIO_PINS(126); 382 + DECLARE_MSM_GPIO_PINS(127); 383 + DECLARE_MSM_GPIO_PINS(128); 384 + DECLARE_MSM_GPIO_PINS(129); 385 + DECLARE_MSM_GPIO_PINS(130); 386 + DECLARE_MSM_GPIO_PINS(131); 387 + DECLARE_MSM_GPIO_PINS(132); 388 + DECLARE_MSM_GPIO_PINS(133); 389 + DECLARE_MSM_GPIO_PINS(134); 390 + DECLARE_MSM_GPIO_PINS(135); 391 + DECLARE_MSM_GPIO_PINS(136); 392 + DECLARE_MSM_GPIO_PINS(137); 393 + DECLARE_MSM_GPIO_PINS(138); 394 + DECLARE_MSM_GPIO_PINS(139); 395 + DECLARE_MSM_GPIO_PINS(140); 396 + DECLARE_MSM_GPIO_PINS(141); 397 + DECLARE_MSM_GPIO_PINS(142); 398 + DECLARE_MSM_GPIO_PINS(143); 399 + DECLARE_MSM_GPIO_PINS(144); 400 + DECLARE_MSM_GPIO_PINS(145); 401 + 402 + static const unsigned int sdc1_rclk_pins[] = { 146 }; 403 + static const unsigned int sdc1_clk_pins[] = { 147 }; 404 + static const unsigned int sdc1_cmd_pins[] = { 148 }; 405 + static const unsigned int sdc1_data_pins[] = { 149 }; 406 + static const unsigned int sdc2_clk_pins[] = { 150 }; 407 + static const unsigned int sdc2_cmd_pins[] = { 151 }; 408 + static const unsigned int sdc2_data_pins[] = { 152 }; 409 + static const unsigned int sdc3_clk_pins[] = { 153 }; 410 + static const unsigned int sdc3_cmd_pins[] = { 154 }; 411 + static const unsigned int sdc3_data_pins[] = { 155 }; 412 + 413 + enum msm8994_functions { 414 + MSM_MUX_audio_ref_clk, 415 + MSM_MUX_blsp_i2c1, 416 + MSM_MUX_blsp_i2c2, 417 + MSM_MUX_blsp_i2c3, 418 + MSM_MUX_blsp_i2c4, 419 + MSM_MUX_blsp_i2c5, 420 + MSM_MUX_blsp_i2c6, 421 + MSM_MUX_blsp_i2c7, 422 + MSM_MUX_blsp_i2c8, 423 + MSM_MUX_blsp_i2c9, 424 + MSM_MUX_blsp_i2c10, 425 + MSM_MUX_blsp_i2c11, 426 + MSM_MUX_blsp_i2c12, 427 + MSM_MUX_blsp_spi1, 428 + MSM_MUX_blsp_spi1_cs1, 429 + MSM_MUX_blsp_spi1_cs2, 430 + MSM_MUX_blsp_spi1_cs3, 431 + MSM_MUX_blsp_spi2, 432 + MSM_MUX_blsp_spi2_cs1, 433 + MSM_MUX_blsp_spi2_cs2, 434 + MSM_MUX_blsp_spi2_cs3, 435 + MSM_MUX_blsp_spi3, 436 + MSM_MUX_blsp_spi4, 437 + MSM_MUX_blsp_spi5, 438 + MSM_MUX_blsp_spi6, 439 + MSM_MUX_blsp_spi7, 440 + MSM_MUX_blsp_spi8, 441 + MSM_MUX_blsp_spi9, 442 + MSM_MUX_blsp_spi10, 443 + MSM_MUX_blsp_spi10_cs1, 444 + MSM_MUX_blsp_spi10_cs2, 445 + MSM_MUX_blsp_spi10_cs3, 446 + MSM_MUX_blsp_spi11, 447 + MSM_MUX_blsp_spi12, 448 + MSM_MUX_blsp_uart1, 449 + MSM_MUX_blsp_uart2, 450 + MSM_MUX_blsp_uart3, 451 + MSM_MUX_blsp_uart4, 452 + MSM_MUX_blsp_uart5, 453 + MSM_MUX_blsp_uart6, 454 + MSM_MUX_blsp_uart7, 455 + MSM_MUX_blsp_uart8, 456 + MSM_MUX_blsp_uart9, 457 + MSM_MUX_blsp_uart10, 458 + MSM_MUX_blsp_uart11, 459 + MSM_MUX_blsp_uart12, 460 + MSM_MUX_blsp_uim1, 461 + MSM_MUX_blsp_uim2, 462 + MSM_MUX_blsp_uim3, 463 + MSM_MUX_blsp_uim4, 464 + MSM_MUX_blsp_uim5, 465 + MSM_MUX_blsp_uim6, 466 + MSM_MUX_blsp_uim7, 467 + MSM_MUX_blsp_uim8, 468 + MSM_MUX_blsp_uim9, 469 + MSM_MUX_blsp_uim10, 470 + MSM_MUX_blsp_uim11, 471 + MSM_MUX_blsp_uim12, 472 + MSM_MUX_blsp11_i2c_scl_b, 473 + MSM_MUX_blsp11_i2c_sda_b, 474 + MSM_MUX_blsp11_uart_rx_b, 475 + MSM_MUX_blsp11_uart_tx_b, 476 + MSM_MUX_cam_mclk0, 477 + MSM_MUX_cam_mclk1, 478 + MSM_MUX_cam_mclk2, 479 + MSM_MUX_cam_mclk3, 480 + MSM_MUX_cci_async_in0, 481 + MSM_MUX_cci_async_in1, 482 + MSM_MUX_cci_async_in2, 483 + MSM_MUX_cci_i2c0, 484 + MSM_MUX_cci_i2c1, 485 + MSM_MUX_cci_timer0, 486 + MSM_MUX_cci_timer1, 487 + MSM_MUX_cci_timer2, 488 + MSM_MUX_cci_timer3, 489 + MSM_MUX_cci_timer4, 490 + MSM_MUX_gcc_gp1_clk_a, 491 + MSM_MUX_gcc_gp1_clk_b, 492 + MSM_MUX_gcc_gp2_clk_a, 493 + MSM_MUX_gcc_gp2_clk_b, 494 + MSM_MUX_gcc_gp3_clk_a, 495 + MSM_MUX_gcc_gp3_clk_b, 496 + MSM_MUX_gp_mn, 497 + MSM_MUX_gp_pdm0, 498 + MSM_MUX_gp_pdm1, 499 + MSM_MUX_gp_pdm2, 500 + MSM_MUX_gp0_clk, 501 + MSM_MUX_gp1_clk, 502 + MSM_MUX_gps_tx, 503 + MSM_MUX_gsm_tx, 504 + MSM_MUX_hdmi_cec, 505 + MSM_MUX_hdmi_ddc, 506 + MSM_MUX_hdmi_hpd, 507 + MSM_MUX_hdmi_rcv, 508 + MSM_MUX_mdp_vsync, 509 + MSM_MUX_mss_lte, 510 + MSM_MUX_nav_pps, 511 + MSM_MUX_nav_tsync, 512 + MSM_MUX_qdss_cti_trig_in_a, 513 + MSM_MUX_qdss_cti_trig_in_b, 514 + MSM_MUX_qdss_cti_trig_in_c, 515 + MSM_MUX_qdss_cti_trig_in_d, 516 + MSM_MUX_qdss_cti_trig_out_a, 517 + MSM_MUX_qdss_cti_trig_out_b, 518 + MSM_MUX_qdss_cti_trig_out_c, 519 + MSM_MUX_qdss_cti_trig_out_d, 520 + MSM_MUX_qdss_traceclk_a, 521 + MSM_MUX_qdss_traceclk_b, 522 + MSM_MUX_qdss_tracectl_a, 523 + MSM_MUX_qdss_tracectl_b, 524 + MSM_MUX_qdss_tracedata_a, 525 + MSM_MUX_qdss_tracedata_b, 526 + MSM_MUX_qua_mi2s, 527 + MSM_MUX_pci_e0, 528 + MSM_MUX_pci_e1, 529 + MSM_MUX_pri_mi2s, 530 + MSM_MUX_sdc4, 531 + MSM_MUX_sec_mi2s, 532 + MSM_MUX_slimbus, 533 + MSM_MUX_spkr_i2s, 534 + MSM_MUX_ter_mi2s, 535 + MSM_MUX_tsif1, 536 + MSM_MUX_tsif2, 537 + MSM_MUX_uim1, 538 + MSM_MUX_uim2, 539 + MSM_MUX_uim3, 540 + MSM_MUX_uim4, 541 + MSM_MUX_uim_batt_alarm, 542 + MSM_MUX_gpio, 543 + MSM_MUX_NA, 544 + }; 545 + 546 + static const char * const gpio_groups[] = { 547 + "gpio0", "gpio1", "gpio2", "gpio3", "gpio4", "gpio5", "gpio6", "gpio7", 548 + "gpio8", "gpio9", "gpio10", "gpio11", "gpio12", "gpio13", "gpio14", 549 + "gpio15", "gpio16", "gpio17", "gpio18", "gpio19", "gpio20", "gpio21", 550 + "gpio22", "gpio23", "gpio24", "gpio25", "gpio26", "gpio27", "gpio28", 551 + "gpio29", "gpio30", "gpio31", "gpio32", "gpio33", "gpio34", "gpio35", 552 + "gpio36", "gpio37", "gpio38", "gpio39", "gpio40", "gpio41", "gpio42", 553 + "gpio43", "gpio44", "gpio45", "gpio46", "gpio47", "gpio48", "gpio49", 554 + "gpio50", "gpio51", "gpio52", "gpio53", "gpio54", "gpio55", "gpio56", 555 + "gpio57", "gpio58", "gpio59", "gpio60", "gpio61", "gpio62", "gpio63", 556 + "gpio64", "gpio65", "gpio66", "gpio67", "gpio68", "gpio69", "gpio70", 557 + "gpio71", "gpio72", "gpio73", "gpio74", "gpio75", "gpio76", "gpio77", 558 + "gpio78", "gpio79", "gpio80", "gpio81", "gpio82", "gpio83", "gpio84", 559 + "gpio85", "gpio86", "gpio87", "gpio88", "gpio89", "gpio90", "gpio91", 560 + "gpio92", "gpio93", "gpio94", "gpio95", "gpio96", "gpio97", "gpio98", 561 + "gpio99", "gpio100", "gpio101", "gpio102", "gpio103", "gpio104", 562 + "gpio105", "gpio106", "gpio107", "gpio108", "gpio109", "gpio110", 563 + "gpio111", "gpio112", "gpio113", "gpio114", "gpio115", "gpio116", 564 + "gpio117", "gpio118", "gpio119", "gpio120", "gpio121", "gpio122", 565 + "gpio123", "gpio124", "gpio125", "gpio126", "gpio127", "gpio128", 566 + "gpio129", "gpio130", "gpio131", "gpio132", "gpio133", "gpio134", 567 + "gpio135", "gpio136", "gpio137", "gpio138", "gpio139", "gpio140", 568 + "gpio141", "gpio142", "gpio143", "gpio144", "gpio145", 569 + }; 570 + 571 + static const char * const blsp_spi1_groups[] = { 572 + "gpio0", "gpio1", "gpio2", "gpio3" 573 + }; 574 + static const char * const blsp_uart1_groups[] = { 575 + "gpio0", "gpio1", "gpio2", "gpio3" 576 + }; 577 + static const char * const blsp_uim1_groups[] = { 578 + "gpio0", "gpio1" 579 + }; 580 + static const char * const hdmi_rcv_groups[] = { 581 + "gpio0" 582 + }; 583 + static const char * const blsp_i2c1_groups[] = { 584 + "gpio2", "gpio3" 585 + }; 586 + static const char * const blsp_spi2_groups[] = { 587 + "gpio4", "gpio5", "gpio6", "gpio7" 588 + }; 589 + static const char * const blsp_uart2_groups[] = { 590 + "gpio4", "gpio5", "gpio6", "gpio7" 591 + }; 592 + static const char * const blsp_uim2_groups[] = { 593 + "gpio4", "gpio5" 594 + }; 595 + static const char * const qdss_cti_trig_out_b_groups[] = { 596 + "gpio4", 597 + }; 598 + static const char * const qdss_cti_trig_in_b_groups[] = { 599 + "gpio5", 600 + }; 601 + static const char * const blsp_i2c2_groups[] = { 602 + "gpio6", "gpio7" 603 + }; 604 + static const char * const blsp_spi3_groups[] = { 605 + "gpio8", "gpio9", "gpio10", "gpio11" 606 + }; 607 + static const char * const blsp_uart3_groups[] = { 608 + "gpio8", "gpio9", "gpio10", "gpio11" 609 + }; 610 + static const char * const blsp_uim3_groups[] = { 611 + "gpio8", "gpio9" 612 + }; 613 + static const char * const blsp_spi1_cs1_groups[] = { 614 + "gpio8" 615 + }; 616 + static const char * const blsp_spi1_cs2_groups[] = { 617 + "gpio9", "gpio11" 618 + }; 619 + static const char * const mdp_vsync_groups[] = { 620 + "gpio10", "gpio11", "gpio12" 621 + }; 622 + static const char * const blsp_i2c3_groups[] = { 623 + "gpio10", "gpio11" 624 + }; 625 + static const char * const blsp_spi1_cs3_groups[] = { 626 + "gpio10" 627 + }; 628 + static const char * const qdss_tracedata_b_groups[] = { 629 + "gpio13", "gpio14", "gpio15", "gpio16", "gpio17", "gpio18", 630 + "gpio19", "gpio21", "gpio22", "gpio23", "gpio25", "gpio26", 631 + "gpio57", "gpio58", "gpio92", "gpio93", 632 + }; 633 + static const char * const cam_mclk0_groups[] = { 634 + "gpio13" 635 + }; 636 + static const char * const cam_mclk1_groups[] = { 637 + "gpio14" 638 + }; 639 + static const char * const cam_mclk2_groups[] = { 640 + "gpio15" 641 + }; 642 + static const char * const cam_mclk3_groups[] = { 643 + "gpio16" 644 + }; 645 + static const char * const cci_i2c0_groups[] = { 646 + "gpio17", "gpio18" 647 + }; 648 + static const char * const blsp_spi4_groups[] = { 649 + "gpio17", "gpio18", "gpio19", "gpio20" 650 + }; 651 + static const char * const blsp_uart4_groups[] = { 652 + "gpio17", "gpio18", "gpio19", "gpio20" 653 + }; 654 + static const char * const blsp_uim4_groups[] = { 655 + "gpio17", "gpio18" 656 + }; 657 + static const char * const cci_i2c1_groups[] = { 658 + "gpio19", "gpio20" 659 + }; 660 + static const char * const blsp_i2c4_groups[] = { 661 + "gpio19", "gpio20" 662 + }; 663 + static const char * const cci_timer0_groups[] = { 664 + "gpio21" 665 + }; 666 + static const char * const blsp_spi5_groups[] = { 667 + "gpio21", "gpio22", "gpio23", "gpio24" 668 + }; 669 + static const char * const blsp_uart5_groups[] = { 670 + "gpio21", "gpio22", "gpio23", "gpio24" 671 + }; 672 + static const char * const blsp_uim5_groups[] = { 673 + "gpio21", "gpio22" 674 + }; 675 + static const char * const cci_timer1_groups[] = { 676 + "gpio22" 677 + }; 678 + static const char * const cci_timer2_groups[] = { 679 + "gpio23" 680 + }; 681 + static const char * const blsp_i2c5_groups[] = { 682 + "gpio23", "gpio24" 683 + }; 684 + static const char * const cci_timer3_groups[] = { 685 + "gpio24" 686 + }; 687 + static const char * const cci_async_in1_groups[] = { 688 + "gpio24" 689 + }; 690 + static const char * const cci_timer4_groups[] = { 691 + "gpio25" 692 + }; 693 + static const char * const cci_async_in2_groups[] = { 694 + "gpio25" 695 + }; 696 + static const char * const blsp_spi6_groups[] = { 697 + "gpio25", "gpio26", "gpio27", "gpio28" 698 + }; 699 + static const char * const blsp_uart6_groups[] = { 700 + "gpio25", "gpio26", "gpio27", "gpio28" 701 + }; 702 + static const char * const blsp_uim6_groups[] = { 703 + "gpio25", "gpio26" 704 + }; 705 + static const char * const cci_async_in0_groups[] = { 706 + "gpio26" 707 + }; 708 + static const char * const gp0_clk_groups[] = { 709 + "gpio26" 710 + }; 711 + static const char * const gp1_clk_groups[] = { 712 + "gpio27", "gpio57", "gpio78" 713 + }; 714 + static const char * const blsp_i2c6_groups[] = { 715 + "gpio27", "gpio28" 716 + }; 717 + static const char * const qdss_tracectl_a_groups[] = { 718 + "gpio27", 719 + }; 720 + static const char * const qdss_traceclk_a_groups[] = { 721 + "gpio28", 722 + }; 723 + static const char * const gp_mn_groups[] = { 724 + "gpio29" 725 + }; 726 + static const char * const hdmi_cec_groups[] = { 727 + "gpio31" 728 + }; 729 + static const char * const hdmi_ddc_groups[] = { 730 + "gpio32", "gpio33" 731 + }; 732 + static const char * const hdmi_hpd_groups[] = { 733 + "gpio34" 734 + }; 735 + static const char * const uim3_groups[] = { 736 + "gpio35", "gpio36", "gpio37", "gpio38" 737 + }; 738 + static const char * const pci_e1_groups[] = { 739 + "gpio35", "gpio36", 740 + }; 741 + static const char * const blsp_spi7_groups[] = { 742 + "gpio41", "gpio42", "gpio43", "gpio44" 743 + }; 744 + static const char * const blsp_uart7_groups[] = { 745 + "gpio41", "gpio42", "gpio43", "gpio44" 746 + }; 747 + static const char * const blsp_uim7_groups[] = { 748 + "gpio41", "gpio42" 749 + }; 750 + static const char * const qdss_cti_trig_out_c_groups[] = { 751 + "gpio41", 752 + }; 753 + static const char * const qdss_cti_trig_in_c_groups[] = { 754 + "gpio42", 755 + }; 756 + static const char * const blsp_i2c7_groups[] = { 757 + "gpio43", "gpio44" 758 + }; 759 + static const char * const blsp_spi8_groups[] = { 760 + "gpio45", "gpio46", "gpio47", "gpio48" 761 + }; 762 + static const char * const blsp_uart8_groups[] = { 763 + "gpio45", "gpio46", "gpio47", "gpio48" 764 + }; 765 + static const char * const blsp_uim8_groups[] = { 766 + "gpio45", "gpio46" 767 + }; 768 + static const char * const blsp_i2c8_groups[] = { 769 + "gpio47", "gpio48" 770 + }; 771 + static const char * const blsp_spi10_cs1_groups[] = { 772 + "gpio47", "gpio67" 773 + }; 774 + static const char * const blsp_spi10_cs2_groups[] = { 775 + "gpio48", "gpio68" 776 + }; 777 + static const char * const uim2_groups[] = { 778 + "gpio49", "gpio50", "gpio51", "gpio52" 779 + }; 780 + static const char * const blsp_spi9_groups[] = { 781 + "gpio49", "gpio50", "gpio51", "gpio52" 782 + }; 783 + static const char * const blsp_uart9_groups[] = { 784 + "gpio49", "gpio50", "gpio51", "gpio52" 785 + }; 786 + static const char * const blsp_uim9_groups[] = { 787 + "gpio49", "gpio50" 788 + }; 789 + static const char * const blsp_i2c9_groups[] = { 790 + "gpio51", "gpio52" 791 + }; 792 + static const char * const pci_e0_groups[] = { 793 + "gpio53", "gpio54", 794 + }; 795 + static const char * const uim4_groups[] = { 796 + "gpio53", "gpio54", "gpio55", "gpio56" 797 + }; 798 + static const char * const blsp_spi10_groups[] = { 799 + "gpio53", "gpio54", "gpio55", "gpio56" 800 + }; 801 + static const char * const blsp_uart10_groups[] = { 802 + "gpio53", "gpio54", "gpio55", "gpio56" 803 + }; 804 + static const char * const blsp_uim10_groups[] = { 805 + "gpio53", "gpio54" 806 + }; 807 + static const char * const qdss_tracedata_a_groups[] = { 808 + "gpio53", "gpio54", "gpio63", "gpio64", "gpio65", 809 + "gpio66", "gpio67", "gpio74", "gpio75", "gpio76", 810 + "gpio77", "gpio85", "gpio86", "gpio87", "gpio89", 811 + "gpio90" 812 + }; 813 + static const char * const gp_pdm0_groups[] = { 814 + "gpio54", "gpio95" 815 + }; 816 + static const char * const blsp_i2c10_groups[] = { 817 + "gpio55", "gpio56" 818 + }; 819 + static const char * const qdss_cti_trig_in_a_groups[] = { 820 + "gpio55", 821 + }; 822 + static const char * const qdss_cti_trig_out_a_groups[] = { 823 + "gpio56", 824 + }; 825 + static const char * const qua_mi2s_groups[] = { 826 + "gpio57", "gpio58", "gpio59", "gpio60", "gpio61", "gpio62", "gpio63", 827 + }; 828 + static const char * const gcc_gp1_clk_a_groups[] = { 829 + "gpio57" 830 + }; 831 + static const char * const gcc_gp2_clk_a_groups[] = { 832 + "gpio58" 833 + }; 834 + static const char * const gcc_gp3_clk_a_groups[] = { 835 + "gpio59" 836 + }; 837 + static const char * const blsp_spi2_cs1_groups[] = { 838 + "gpio62" 839 + }; 840 + static const char * const blsp_spi2_cs2_groups[] = { 841 + "gpio63" 842 + }; 843 + static const char * const gp_pdm2_groups[] = { 844 + "gpio63", "gpio79" 845 + }; 846 + static const char * const pri_mi2s_groups[] = { 847 + "gpio64", "gpio65", "gpio66", "gpio67", "gpio68" 848 + }; 849 + static const char * const blsp_spi2_cs3_groups[] = { 850 + "gpio66" 851 + }; 852 + static const char * const spkr_i2s_groups[] = { 853 + "gpio69", "gpio70", "gpio71", "gpio72" 854 + }; 855 + static const char * const audio_ref_clk_groups[] = { 856 + "gpio69" 857 + }; 858 + static const char * const slimbus_groups[] = { 859 + "gpio70", "gpio71" 860 + }; 861 + static const char * const ter_mi2s_groups[] = { 862 + "gpio73", "gpio74", "gpio75", "gpio76", "gpio77" 863 + }; 864 + static const char * const gp_pdm1_groups[] = { 865 + "gpio74", "gpio86" 866 + }; 867 + static const char * const sec_mi2s_groups[] = { 868 + "gpio78", "gpio79", "gpio80", "gpio81", "gpio82" 869 + }; 870 + static const char * const gcc_gp1_clk_b_groups[] = { 871 + "gpio78" 872 + }; 873 + static const char * const blsp_spi11_groups[] = { 874 + "gpio81", "gpio82", "gpio83", "gpio84" 875 + }; 876 + static const char * const blsp_uart11_groups[] = { 877 + "gpio81", "gpio82", "gpio83", "gpio84" 878 + }; 879 + static const char * const blsp_uim11_groups[] = { 880 + "gpio81", "gpio82" 881 + }; 882 + static const char * const gcc_gp2_clk_b_groups[] = { 883 + "gpio81" 884 + }; 885 + static const char * const gcc_gp3_clk_b_groups[] = { 886 + "gpio82" 887 + }; 888 + static const char * const blsp_i2c11_groups[] = { 889 + "gpio83", "gpio84" 890 + }; 891 + static const char * const blsp_uart12_groups[] = { 892 + "gpio85", "gpio86", "gpio87", "gpio88" 893 + }; 894 + static const char * const blsp_uim12_groups[] = { 895 + "gpio85", "gpio86" 896 + }; 897 + static const char * const blsp_i2c12_groups[] = { 898 + "gpio87", "gpio88" 899 + }; 900 + static const char * const blsp_spi12_groups[] = { 901 + "gpio85", "gpio86", "gpio87", "gpio88" 902 + }; 903 + static const char * const tsif1_groups[] = { 904 + "gpio89", "gpio90", "gpio91", "gpio110", "gpio111" 905 + }; 906 + static const char * const blsp_spi10_cs3_groups[] = { 907 + "gpio90" 908 + }; 909 + static const char * const sdc4_groups[] = { 910 + "gpio91", "gpio92", "gpio93", "gpio94", "gpio95", "gpio96" 911 + }; 912 + static const char * const qdss_traceclk_b_groups[] = { 913 + "gpio91", 914 + }; 915 + static const char * const tsif2_groups[] = { 916 + "gpio92", "gpio93", "gpio94", "gpio95", "gpio96" 917 + }; 918 + static const char * const qdss_tracectl_b_groups[] = { 919 + "gpio94", 920 + }; 921 + static const char * const qdss_cti_trig_out_d_groups[] = { 922 + "gpio95", 923 + }; 924 + static const char * const qdss_cti_trig_in_d_groups[] = { 925 + "gpio96", 926 + }; 927 + static const char * const uim1_groups[] = { 928 + "gpio97", "gpio98", "gpio99", "gpio100" 929 + }; 930 + static const char * const uim_batt_alarm_groups[] = { 931 + "gpio101" 932 + }; 933 + static const char * const blsp11_uart_tx_b_groups[] = { 934 + "gpio111" 935 + }; 936 + static const char * const blsp11_uart_rx_b_groups[] = { 937 + "gpio112" 938 + }; 939 + static const char * const blsp11_i2c_sda_b_groups[] = { 940 + "gpio113" 941 + }; 942 + static const char * const blsp11_i2c_scl_b_groups[] = { 943 + "gpio114" 944 + }; 945 + static const char * const gsm_tx_groups[] = { 946 + "gpio126", "gpio131", "gpio132", "gpio133" 947 + }; 948 + static const char * const nav_tsync_groups[] = { 949 + "gpio127" 950 + }; 951 + static const char * const nav_pps_groups[] = { 952 + "gpio127" 953 + }; 954 + static const char * const gps_tx_groups[] = { 955 + "gpio130" 956 + }; 957 + static const char * const mss_lte_groups[] = { 958 + "gpio134", "gpio135" 959 + }; 960 + 961 + static const struct msm_function msm8994_functions[] = { 962 + FUNCTION(audio_ref_clk), 963 + FUNCTION(blsp_i2c1), 964 + FUNCTION(blsp_i2c2), 965 + FUNCTION(blsp_i2c3), 966 + FUNCTION(blsp_i2c4), 967 + FUNCTION(blsp_i2c5), 968 + FUNCTION(blsp_i2c6), 969 + FUNCTION(blsp_i2c7), 970 + FUNCTION(blsp_i2c8), 971 + FUNCTION(blsp_i2c9), 972 + FUNCTION(blsp_i2c10), 973 + FUNCTION(blsp_i2c11), 974 + FUNCTION(blsp_i2c12), 975 + FUNCTION(blsp_spi1), 976 + FUNCTION(blsp_spi1_cs1), 977 + FUNCTION(blsp_spi1_cs2), 978 + FUNCTION(blsp_spi1_cs3), 979 + FUNCTION(blsp_spi2), 980 + FUNCTION(blsp_spi2_cs1), 981 + FUNCTION(blsp_spi2_cs2), 982 + FUNCTION(blsp_spi2_cs3), 983 + FUNCTION(blsp_spi3), 984 + FUNCTION(blsp_spi4), 985 + FUNCTION(blsp_spi5), 986 + FUNCTION(blsp_spi6), 987 + FUNCTION(blsp_spi7), 988 + FUNCTION(blsp_spi8), 989 + FUNCTION(blsp_spi9), 990 + FUNCTION(blsp_spi10), 991 + FUNCTION(blsp_spi10_cs1), 992 + FUNCTION(blsp_spi10_cs2), 993 + FUNCTION(blsp_spi10_cs3), 994 + FUNCTION(blsp_spi11), 995 + FUNCTION(blsp_spi12), 996 + FUNCTION(blsp_uart1), 997 + FUNCTION(blsp_uart2), 998 + FUNCTION(blsp_uart3), 999 + FUNCTION(blsp_uart4), 1000 + FUNCTION(blsp_uart5), 1001 + FUNCTION(blsp_uart6), 1002 + FUNCTION(blsp_uart7), 1003 + FUNCTION(blsp_uart8), 1004 + FUNCTION(blsp_uart9), 1005 + FUNCTION(blsp_uart10), 1006 + FUNCTION(blsp_uart11), 1007 + FUNCTION(blsp_uart12), 1008 + FUNCTION(blsp_uim1), 1009 + FUNCTION(blsp_uim2), 1010 + FUNCTION(blsp_uim3), 1011 + FUNCTION(blsp_uim4), 1012 + FUNCTION(blsp_uim5), 1013 + FUNCTION(blsp_uim6), 1014 + FUNCTION(blsp_uim7), 1015 + FUNCTION(blsp_uim8), 1016 + FUNCTION(blsp_uim9), 1017 + FUNCTION(blsp_uim10), 1018 + FUNCTION(blsp_uim11), 1019 + FUNCTION(blsp_uim12), 1020 + FUNCTION(blsp11_i2c_scl_b), 1021 + FUNCTION(blsp11_i2c_sda_b), 1022 + FUNCTION(blsp11_uart_rx_b), 1023 + FUNCTION(blsp11_uart_tx_b), 1024 + FUNCTION(cam_mclk0), 1025 + FUNCTION(cam_mclk1), 1026 + FUNCTION(cam_mclk2), 1027 + FUNCTION(cam_mclk3), 1028 + FUNCTION(cci_async_in0), 1029 + FUNCTION(cci_async_in1), 1030 + FUNCTION(cci_async_in2), 1031 + FUNCTION(cci_i2c0), 1032 + FUNCTION(cci_i2c1), 1033 + FUNCTION(cci_timer0), 1034 + FUNCTION(cci_timer1), 1035 + FUNCTION(cci_timer2), 1036 + FUNCTION(cci_timer3), 1037 + FUNCTION(cci_timer4), 1038 + FUNCTION(gcc_gp1_clk_a), 1039 + FUNCTION(gcc_gp1_clk_b), 1040 + FUNCTION(gcc_gp2_clk_a), 1041 + FUNCTION(gcc_gp2_clk_b), 1042 + FUNCTION(gcc_gp3_clk_a), 1043 + FUNCTION(gcc_gp3_clk_b), 1044 + FUNCTION(gp_mn), 1045 + FUNCTION(gp_pdm0), 1046 + FUNCTION(gp_pdm1), 1047 + FUNCTION(gp_pdm2), 1048 + FUNCTION(gp0_clk), 1049 + FUNCTION(gp1_clk), 1050 + FUNCTION(gps_tx), 1051 + FUNCTION(gsm_tx), 1052 + FUNCTION(hdmi_cec), 1053 + FUNCTION(hdmi_ddc), 1054 + FUNCTION(hdmi_hpd), 1055 + FUNCTION(hdmi_rcv), 1056 + FUNCTION(mdp_vsync), 1057 + FUNCTION(mss_lte), 1058 + FUNCTION(nav_pps), 1059 + FUNCTION(nav_tsync), 1060 + FUNCTION(qdss_cti_trig_in_a), 1061 + FUNCTION(qdss_cti_trig_in_b), 1062 + FUNCTION(qdss_cti_trig_in_c), 1063 + FUNCTION(qdss_cti_trig_in_d), 1064 + FUNCTION(qdss_cti_trig_out_a), 1065 + FUNCTION(qdss_cti_trig_out_b), 1066 + FUNCTION(qdss_cti_trig_out_c), 1067 + FUNCTION(qdss_cti_trig_out_d), 1068 + FUNCTION(qdss_traceclk_a), 1069 + FUNCTION(qdss_traceclk_b), 1070 + FUNCTION(qdss_tracectl_a), 1071 + FUNCTION(qdss_tracectl_b), 1072 + FUNCTION(qdss_tracedata_a), 1073 + FUNCTION(qdss_tracedata_b), 1074 + FUNCTION(qua_mi2s), 1075 + FUNCTION(pci_e0), 1076 + FUNCTION(pci_e1), 1077 + FUNCTION(pri_mi2s), 1078 + FUNCTION(sdc4), 1079 + FUNCTION(sec_mi2s), 1080 + FUNCTION(slimbus), 1081 + FUNCTION(spkr_i2s), 1082 + FUNCTION(ter_mi2s), 1083 + FUNCTION(tsif1), 1084 + FUNCTION(tsif2), 1085 + FUNCTION(uim_batt_alarm), 1086 + FUNCTION(uim1), 1087 + FUNCTION(uim2), 1088 + FUNCTION(uim3), 1089 + FUNCTION(uim4), 1090 + FUNCTION(gpio), 1091 + }; 1092 + 1093 + static const struct msm_pingroup msm8994_groups[] = { 1094 + PINGROUP(0, blsp_spi1, blsp_uart1, blsp_uim1, hdmi_rcv, NA, NA, NA, 1095 + NA, NA, NA, NA), 1096 + PINGROUP(1, blsp_spi1, blsp_uart1, blsp_uim1, NA, NA, NA, NA, NA, NA, 1097 + NA, NA), 1098 + PINGROUP(2, blsp_spi1, blsp_uart1, blsp_i2c1, NA, NA, NA, NA, NA, NA, 1099 + NA, NA), 1100 + PINGROUP(3, blsp_spi1, blsp_uart1, blsp_i2c1, NA, NA, NA, NA, NA, NA, 1101 + NA, NA), 1102 + PINGROUP(4, blsp_spi2, blsp_uart2, blsp_uim2, NA, qdss_cti_trig_out_b, 1103 + NA, NA, NA, NA, NA, NA), 1104 + PINGROUP(5, blsp_spi2, blsp_uart2, blsp_uim2, NA, qdss_cti_trig_in_b, 1105 + NA, NA, NA, NA, NA, NA), 1106 + PINGROUP(6, blsp_spi2, blsp_uart2, blsp_i2c2, NA, NA, NA, NA, NA, NA, 1107 + NA, NA), 1108 + PINGROUP(7, blsp_spi2, blsp_uart2, blsp_i2c2, NA, NA, NA, NA, NA, NA, 1109 + NA, NA), 1110 + PINGROUP(8, blsp_spi3, blsp_uart3, blsp_uim3, blsp_spi1_cs1, NA, NA, 1111 + NA, NA, NA, NA, NA), 1112 + PINGROUP(9, blsp_spi3, blsp_uart3, blsp_uim3, blsp_spi1_cs2, NA, NA, 1113 + NA, NA, NA, NA, NA), 1114 + PINGROUP(10, mdp_vsync, blsp_spi3, blsp_uart3, blsp_i2c3, 1115 + blsp_spi1_cs3, NA, NA, NA, NA, NA, NA), 1116 + PINGROUP(11, mdp_vsync, blsp_spi3, blsp_uart3, blsp_i2c3, 1117 + blsp_spi1_cs2, NA, NA, NA, NA, NA, NA), 1118 + PINGROUP(12, mdp_vsync, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA), 1119 + PINGROUP(13, cam_mclk0, NA, NA, qdss_tracedata_b, NA, NA, NA, NA, NA, 1120 + NA, NA), 1121 + PINGROUP(14, cam_mclk1, NA, NA, qdss_tracedata_b, NA, NA, NA, NA, NA, 1122 + NA, NA), 1123 + PINGROUP(15, cam_mclk2, NA, qdss_tracedata_b, NA, NA, NA, NA, NA, NA, 1124 + NA, NA), 1125 + PINGROUP(16, cam_mclk3, NA, qdss_tracedata_b, NA, NA, NA, NA, NA, NA, 1126 + NA, NA), 1127 + PINGROUP(17, cci_i2c0, blsp_spi4, blsp_uart4, blsp_uim4, NA, 1128 + qdss_tracedata_b, NA, NA, NA, NA, NA), 1129 + PINGROUP(18, cci_i2c0, blsp_spi4, blsp_uart4, blsp_uim4, NA, 1130 + qdss_tracedata_b, NA, NA, NA, NA, NA), 1131 + PINGROUP(19, cci_i2c1, blsp_spi4, blsp_uart4, blsp_i2c4, NA, 1132 + qdss_tracedata_b, NA, NA, NA, NA, NA), 1133 + PINGROUP(20, cci_i2c1, blsp_spi4, blsp_uart4, blsp_i2c4, NA, NA, NA, 1134 + NA, NA, NA, NA), 1135 + PINGROUP(21, cci_timer0, blsp_spi5, blsp_uart5, blsp_uim5, NA, 1136 + qdss_tracedata_b, NA, NA, NA, NA, NA), 1137 + PINGROUP(22, cci_timer1, blsp_spi5, blsp_uart5, blsp_uim5, NA, 1138 + qdss_tracedata_b, NA, NA, NA, NA, NA), 1139 + PINGROUP(23, cci_timer2, blsp_spi5, blsp_uart5, blsp_i2c5, NA, NA, 1140 + qdss_tracedata_b, NA, NA, NA, NA), 1141 + PINGROUP(24, cci_timer3, cci_async_in1, blsp_spi5, blsp_uart5, 1142 + blsp_i2c5, NA, NA, NA, NA, NA, NA), 1143 + PINGROUP(25, cci_timer4, cci_async_in2, blsp_spi6, blsp_uart6, 1144 + blsp_uim6, NA, NA, qdss_tracedata_b, NA, NA, NA), 1145 + PINGROUP(26, cci_async_in0, blsp_spi6, blsp_uart6, blsp_uim6, gp0_clk, 1146 + NA, qdss_tracedata_b, NA, NA, NA, NA), 1147 + PINGROUP(27, blsp_spi6, blsp_uart6, blsp_i2c6, gp1_clk, 1148 + qdss_tracectl_a, NA, NA, NA, NA, NA, NA), 1149 + PINGROUP(28, blsp_spi6, blsp_uart6, blsp_i2c6, qdss_traceclk_a, NA, 1150 + NA, NA, NA, NA, NA, NA), 1151 + PINGROUP(29, gp_mn, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA), 1152 + PINGROUP(30, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA), 1153 + PINGROUP(31, hdmi_cec, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA), 1154 + PINGROUP(32, hdmi_ddc, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA), 1155 + PINGROUP(33, hdmi_ddc, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA), 1156 + PINGROUP(34, hdmi_hpd, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA), 1157 + PINGROUP(35, uim3, pci_e1, NA, NA, NA, NA, NA, NA, NA, NA, NA), 1158 + PINGROUP(36, uim3, pci_e1, NA, NA, NA, NA, NA, NA, NA, NA, NA), 1159 + PINGROUP(37, uim3, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA), 1160 + PINGROUP(38, uim3, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA), 1161 + PINGROUP(39, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA), 1162 + PINGROUP(40, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA), 1163 + PINGROUP(41, blsp_spi7, blsp_uart7, blsp_uim7, qdss_cti_trig_out_c, 1164 + NA, NA, NA, NA, NA, NA, NA), 1165 + PINGROUP(42, blsp_spi7, blsp_uart7, blsp_uim7, qdss_cti_trig_in_c, NA, 1166 + NA, NA, NA, NA, NA, NA), 1167 + PINGROUP(43, blsp_spi7, blsp_uart7, blsp_i2c7, NA, NA, NA, NA, NA, NA, 1168 + NA, NA), 1169 + PINGROUP(44, blsp_spi7, blsp_uart7, blsp_i2c7, NA, NA, NA, NA, NA, NA, 1170 + NA, NA), 1171 + PINGROUP(45, blsp_spi8, blsp_uart8, blsp_uim8, NA, NA, NA, NA, NA, NA, 1172 + NA, NA), 1173 + PINGROUP(46, blsp_spi8, blsp_uart8, blsp_uim8, NA, NA, NA, NA, NA, NA, 1174 + NA, NA), 1175 + PINGROUP(47, blsp_spi8, blsp_uart8, blsp_i2c8, blsp_spi10_cs1, NA, NA, 1176 + NA, NA, NA, NA, NA), 1177 + PINGROUP(48, blsp_spi8, blsp_uart8, blsp_i2c8, blsp_spi10_cs2, NA, NA, 1178 + NA, NA, NA, NA, NA), 1179 + PINGROUP(49, uim2, blsp_spi9, blsp_uart9, blsp_uim9, NA, NA, NA, NA, 1180 + NA, NA, NA), 1181 + PINGROUP(50, uim2, blsp_spi9, blsp_uart9, blsp_uim9, NA, NA, NA, NA, 1182 + NA, NA, NA), 1183 + PINGROUP(51, uim2, blsp_spi9, blsp_uart9, blsp_i2c9, NA, NA, NA, NA, 1184 + NA, NA, NA), 1185 + PINGROUP(52, uim2, blsp_spi9, blsp_uart9, blsp_i2c9, NA, NA, NA, NA, 1186 + NA, NA, NA), 1187 + PINGROUP(53, uim4, pci_e0, blsp_spi10, blsp_uart10, blsp_uim10, NA, 1188 + NA, qdss_tracedata_a, NA, NA, NA), 1189 + PINGROUP(54, uim4, pci_e0, blsp_spi10, blsp_uart10, blsp_uim10, 1190 + gp_pdm0, NA, NA, qdss_tracedata_a, NA, NA), 1191 + PINGROUP(55, uim4, blsp_spi10, blsp_uart10, blsp_i2c10, NA, NA, NA, 1192 + qdss_cti_trig_in_a, NA, NA, NA), 1193 + PINGROUP(56, uim4, blsp_spi10, blsp_uart10, blsp_i2c10, NA, NA, 1194 + qdss_cti_trig_out_a, NA, NA, NA, NA), 1195 + PINGROUP(57, qua_mi2s, gcc_gp1_clk_a, NA, NA, qdss_tracedata_b, NA, NA, 1196 + NA, NA, NA, NA), 1197 + PINGROUP(58, qua_mi2s, gcc_gp2_clk_a, NA, NA, qdss_tracedata_b, NA, NA, 1198 + NA, NA, NA, NA), 1199 + PINGROUP(59, qua_mi2s, gcc_gp3_clk_a, NA, NA, NA, NA, NA, NA, NA, NA, 1200 + NA), 1201 + PINGROUP(60, qua_mi2s, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA), 1202 + PINGROUP(61, qua_mi2s, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA), 1203 + PINGROUP(62, qua_mi2s, blsp_spi2_cs1, NA, NA, NA, NA, NA, NA, NA, NA, 1204 + NA), 1205 + PINGROUP(63, qua_mi2s, blsp_spi2_cs2, gp_pdm2, NA, NA, NA, NA, NA, 1206 + qdss_tracedata_a, NA, NA), 1207 + PINGROUP(64, pri_mi2s, NA, NA, NA, qdss_tracedata_a, NA, NA, NA, NA, 1208 + NA, NA), 1209 + PINGROUP(65, pri_mi2s, NA, NA, NA, qdss_tracedata_a, NA, NA, NA, NA, 1210 + NA, NA), 1211 + PINGROUP(66, pri_mi2s, blsp_spi2_cs3, NA, NA, NA, qdss_tracedata_a, 1212 + NA, NA, NA, NA, NA), 1213 + PINGROUP(67, pri_mi2s, blsp_spi10_cs1, NA, NA, NA, qdss_tracedata_a, 1214 + NA, NA, NA, NA, NA), 1215 + PINGROUP(68, pri_mi2s, blsp_spi10_cs2, NA, NA, NA, NA, NA, NA, NA, NA, 1216 + NA), 1217 + PINGROUP(69, spkr_i2s, audio_ref_clk, NA, NA, NA, NA, NA, NA, NA, NA, 1218 + NA), 1219 + PINGROUP(70, slimbus, spkr_i2s, NA, NA, NA, NA, NA, NA, NA, NA, NA), 1220 + PINGROUP(71, slimbus, spkr_i2s, NA, NA, NA, NA, NA, NA, NA, NA, NA), 1221 + PINGROUP(72, spkr_i2s, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA), 1222 + PINGROUP(73, ter_mi2s, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA), 1223 + PINGROUP(74, ter_mi2s, gp_pdm1, NA, NA, NA, qdss_tracedata_a, NA, NA, 1224 + NA, NA, NA), 1225 + PINGROUP(75, ter_mi2s, NA, NA, qdss_tracedata_a, NA, NA, NA, NA, NA, 1226 + NA, NA), 1227 + PINGROUP(76, ter_mi2s, NA, NA, qdss_tracedata_a, NA, NA, NA, NA, NA, 1228 + NA, NA), 1229 + PINGROUP(77, ter_mi2s, NA, NA, qdss_tracedata_a, NA, NA, NA, NA, NA, 1230 + NA, NA), 1231 + PINGROUP(78, sec_mi2s, gcc_gp1_clk_b, NA, NA, NA, NA, NA, NA, NA, NA, 1232 + NA), 1233 + PINGROUP(79, sec_mi2s, gp_pdm2, NA, NA, NA, NA, NA, NA, NA, NA, NA), 1234 + PINGROUP(80, sec_mi2s, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA), 1235 + PINGROUP(81, sec_mi2s, blsp_spi11, blsp_uart11, blsp_uim11, 1236 + gcc_gp2_clk_b, NA, NA, NA, NA, NA, NA), 1237 + PINGROUP(82, sec_mi2s, blsp_spi11, blsp_uart11, blsp_uim11, 1238 + gcc_gp3_clk_b, NA, NA, NA, NA, NA, NA), 1239 + PINGROUP(83, blsp_spi11, blsp_uart11, blsp_i2c11, NA, NA, NA, NA, NA, 1240 + NA, NA, NA), 1241 + PINGROUP(84, blsp_spi11, blsp_uart11, blsp_i2c11, NA, NA, NA, NA, NA, 1242 + NA, NA, NA), 1243 + PINGROUP(85, blsp_spi12, blsp_uart12, blsp_uim12, NA, NA, 1244 + qdss_tracedata_a, NA, NA, NA, NA, NA), 1245 + PINGROUP(86, blsp_spi12, blsp_uart12, blsp_uim12, gp_pdm1, NA, 1246 + qdss_tracedata_a, NA, NA, NA, NA, NA), 1247 + PINGROUP(87, blsp_spi12, blsp_uart12, blsp_i2c12, NA, 1248 + qdss_tracedata_a, NA, NA, NA, NA, NA, NA), 1249 + PINGROUP(88, blsp_spi12, blsp_uart12, blsp_i2c12, NA, NA, NA, NA, NA, 1250 + NA, NA, NA), 1251 + PINGROUP(89, tsif1, NA, qdss_tracedata_a, NA, NA, NA, NA, NA, NA, NA, 1252 + NA), 1253 + PINGROUP(90, tsif1, blsp_spi10_cs3, qdss_tracedata_a, NA, NA, NA, NA, 1254 + NA, NA, NA, NA), 1255 + PINGROUP(91, tsif1, sdc4, NA, NA, NA, NA, qdss_traceclk_b, NA, NA, NA, 1256 + NA), 1257 + PINGROUP(92, tsif2, sdc4, NA, NA, qdss_tracedata_b, NA, NA, NA, NA, 1258 + NA, NA), 1259 + PINGROUP(93, tsif2, sdc4, NA, NA, NA, NA, qdss_tracedata_b, NA, NA, 1260 + NA, NA), 1261 + PINGROUP(94, tsif2, sdc4, NA, NA, NA, NA, qdss_tracectl_b, NA, NA, NA, 1262 + NA), 1263 + PINGROUP(95, tsif2, sdc4, gp_pdm0, NA, NA, NA, qdss_cti_trig_out_d, 1264 + NA, NA, NA, NA), 1265 + PINGROUP(96, tsif2, sdc4, qdss_cti_trig_in_d, NA, NA, NA, NA, NA, NA, 1266 + NA, NA), 1267 + PINGROUP(97, uim1, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA), 1268 + PINGROUP(98, uim1, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA), 1269 + PINGROUP(99, uim1, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA), 1270 + PINGROUP(100, uim1, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA), 1271 + PINGROUP(101, uim_batt_alarm, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA), 1272 + PINGROUP(102, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA), 1273 + PINGROUP(103, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA), 1274 + PINGROUP(104, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA), 1275 + PINGROUP(105, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA), 1276 + PINGROUP(106, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA), 1277 + PINGROUP(107, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA), 1278 + PINGROUP(108, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA), 1279 + PINGROUP(109, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA), 1280 + PINGROUP(110, tsif1, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA), 1281 + PINGROUP(111, tsif1, blsp11_uart_tx_b, NA, NA, NA, NA, NA, NA, NA, NA, 1282 + NA), 1283 + PINGROUP(112, blsp11_uart_rx_b, NA, NA, NA, NA, NA, NA, NA, NA, NA, 1284 + NA), 1285 + PINGROUP(113, blsp11_i2c_sda_b, NA, NA, NA, NA, NA, NA, NA, NA, NA, 1286 + NA), 1287 + PINGROUP(114, blsp11_i2c_scl_b, NA, NA, NA, NA, NA, NA, NA, NA, NA, 1288 + NA), 1289 + PINGROUP(115, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA), 1290 + PINGROUP(116, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA), 1291 + PINGROUP(117, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA), 1292 + PINGROUP(118, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA), 1293 + PINGROUP(119, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA), 1294 + PINGROUP(120, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA), 1295 + PINGROUP(121, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA), 1296 + PINGROUP(122, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA), 1297 + PINGROUP(123, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA), 1298 + PINGROUP(124, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA), 1299 + PINGROUP(125, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA), 1300 + PINGROUP(126, NA, gsm_tx, NA, NA, NA, NA, NA, NA, NA, NA, NA), 1301 + PINGROUP(127, NA, nav_tsync, nav_pps, NA, NA, NA, NA, NA, NA, NA, 1302 + NA), 1303 + PINGROUP(128, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA), 1304 + PINGROUP(129, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA), 1305 + PINGROUP(130, gps_tx, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA), 1306 + PINGROUP(131, gsm_tx, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA), 1307 + PINGROUP(132, gsm_tx, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA), 1308 + PINGROUP(133, gsm_tx, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA), 1309 + PINGROUP(134, mss_lte, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA), 1310 + PINGROUP(135, mss_lte, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA), 1311 + PINGROUP(136, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA), 1312 + PINGROUP(137, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA), 1313 + PINGROUP(138, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA), 1314 + PINGROUP(139, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA), 1315 + PINGROUP(140, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA), 1316 + PINGROUP(141, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA), 1317 + PINGROUP(142, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA), 1318 + PINGROUP(143, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA), 1319 + PINGROUP(144, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA), 1320 + PINGROUP(145, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA), 1321 + SDC_PINGROUP(sdc1_rclk, 0x2044, 15, 0), 1322 + SDC_PINGROUP(sdc1_clk, 0x2044, 13, 6), 1323 + SDC_PINGROUP(sdc1_cmd, 0x2044, 11, 3), 1324 + SDC_PINGROUP(sdc1_data, 0x2044, 9, 0), 1325 + SDC_PINGROUP(sdc2_clk, 0x2048, 14, 6), 1326 + SDC_PINGROUP(sdc2_cmd, 0x2048, 11, 3), 1327 + SDC_PINGROUP(sdc2_data, 0x2048, 9, 0), 1328 + SDC_PINGROUP(sdc3_clk, 0x206c, 14, 6), 1329 + SDC_PINGROUP(sdc3_cmd, 0x206c, 11, 3), 1330 + SDC_PINGROUP(sdc3_data, 0x206c, 9, 0), 1331 + }; 1332 + 1333 + #define NUM_GPIO_PINGROUPS 146 1334 + 1335 + static const struct msm_pinctrl_soc_data msm8994_pinctrl = { 1336 + .pins = msm8994_pins, 1337 + .npins = ARRAY_SIZE(msm8994_pins), 1338 + .functions = msm8994_functions, 1339 + .nfunctions = ARRAY_SIZE(msm8994_functions), 1340 + .groups = msm8994_groups, 1341 + .ngroups = ARRAY_SIZE(msm8994_groups), 1342 + .ngpios = NUM_GPIO_PINGROUPS, 1343 + }; 1344 + 1345 + static int msm8994_pinctrl_probe(struct platform_device *pdev) 1346 + { 1347 + return msm_pinctrl_probe(pdev, &msm8994_pinctrl); 1348 + } 1349 + 1350 + static const struct of_device_id msm8994_pinctrl_of_match[] = { 1351 + { .compatible = "qcom,msm8992-pinctrl", }, 1352 + { .compatible = "qcom,msm8994-pinctrl", }, 1353 + { } 1354 + }; 1355 + 1356 + static struct platform_driver msm8994_pinctrl_driver = { 1357 + .driver = { 1358 + .name = "msm8994-pinctrl", 1359 + .of_match_table = msm8994_pinctrl_of_match, 1360 + }, 1361 + .probe = msm8994_pinctrl_probe, 1362 + .remove = msm_pinctrl_remove, 1363 + }; 1364 + 1365 + static int __init msm8994_pinctrl_init(void) 1366 + { 1367 + return platform_driver_register(&msm8994_pinctrl_driver); 1368 + } 1369 + arch_initcall(msm8994_pinctrl_init); 1370 + 1371 + static void __exit msm8994_pinctrl_exit(void) 1372 + { 1373 + platform_driver_unregister(&msm8994_pinctrl_driver); 1374 + } 1375 + module_exit(msm8994_pinctrl_exit); 1376 + 1377 + MODULE_DESCRIPTION("Qualcomm MSM8994 pinctrl driver"); 1378 + MODULE_LICENSE("GPL v2"); 1379 + MODULE_DEVICE_TABLE(of, msm8994_pinctrl_of_match);
+22 -23
drivers/pinctrl/samsung/pinctrl-exynos.c
··· 61 61 struct irq_chip *chip = irq_data_get_irq_chip(irqd); 62 62 struct exynos_irq_chip *our_chip = to_exynos_irq_chip(chip); 63 63 struct samsung_pin_bank *bank = irq_data_get_irq_chip_data(irqd); 64 - struct samsung_pinctrl_drv_data *d = bank->drvdata; 65 64 unsigned long reg_mask = our_chip->eint_mask + bank->eint_offset; 66 65 unsigned long mask; 67 66 unsigned long flags; 68 67 69 68 spin_lock_irqsave(&bank->slock, flags); 70 69 71 - mask = readl(d->virt_base + reg_mask); 70 + mask = readl(bank->eint_base + reg_mask); 72 71 mask |= 1 << irqd->hwirq; 73 - writel(mask, d->virt_base + reg_mask); 72 + writel(mask, bank->eint_base + reg_mask); 74 73 75 74 spin_unlock_irqrestore(&bank->slock, flags); 76 75 } ··· 79 80 struct irq_chip *chip = irq_data_get_irq_chip(irqd); 80 81 struct exynos_irq_chip *our_chip = to_exynos_irq_chip(chip); 81 82 struct samsung_pin_bank *bank = irq_data_get_irq_chip_data(irqd); 82 - struct samsung_pinctrl_drv_data *d = bank->drvdata; 83 83 unsigned long reg_pend = our_chip->eint_pend + bank->eint_offset; 84 84 85 - writel(1 << irqd->hwirq, d->virt_base + reg_pend); 85 + writel(1 << irqd->hwirq, bank->eint_base + reg_pend); 86 86 } 87 87 88 88 static void exynos_irq_unmask(struct irq_data *irqd) ··· 89 91 struct irq_chip *chip = irq_data_get_irq_chip(irqd); 90 92 struct exynos_irq_chip *our_chip = to_exynos_irq_chip(chip); 91 93 struct samsung_pin_bank *bank = irq_data_get_irq_chip_data(irqd); 92 - struct samsung_pinctrl_drv_data *d = bank->drvdata; 93 94 unsigned long reg_mask = our_chip->eint_mask + bank->eint_offset; 94 95 unsigned long mask; 95 96 unsigned long flags; ··· 106 109 107 110 spin_lock_irqsave(&bank->slock, flags); 108 111 109 - mask = readl(d->virt_base + reg_mask); 112 + mask = readl(bank->eint_base + reg_mask); 110 113 mask &= ~(1 << irqd->hwirq); 111 - writel(mask, d->virt_base + reg_mask); 114 + writel(mask, bank->eint_base + reg_mask); 112 115 113 116 spin_unlock_irqrestore(&bank->slock, flags); 114 117 } ··· 118 121 struct irq_chip *chip = irq_data_get_irq_chip(irqd); 119 122 struct exynos_irq_chip *our_chip = to_exynos_irq_chip(chip); 120 123 struct samsung_pin_bank *bank = irq_data_get_irq_chip_data(irqd); 121 - struct samsung_pinctrl_drv_data *d = bank->drvdata; 122 124 unsigned int shift = EXYNOS_EINT_CON_LEN * irqd->hwirq; 123 125 unsigned int con, trig_type; 124 126 unsigned long reg_con = our_chip->eint_con + bank->eint_offset; ··· 148 152 else 149 153 irq_set_handler_locked(irqd, handle_level_irq); 150 154 151 - con = readl(d->virt_base + reg_con); 155 + con = readl(bank->eint_base + reg_con); 152 156 con &= ~(EXYNOS_EINT_CON_MASK << shift); 153 157 con |= trig_type << shift; 154 - writel(con, d->virt_base + reg_con); 158 + writel(con, bank->eint_base + reg_con); 155 159 156 160 return 0; 157 161 } ··· 162 166 struct exynos_irq_chip *our_chip = to_exynos_irq_chip(chip); 163 167 struct samsung_pin_bank *bank = irq_data_get_irq_chip_data(irqd); 164 168 const struct samsung_pin_bank_type *bank_type = bank->type; 165 - struct samsung_pinctrl_drv_data *d = bank->drvdata; 166 169 unsigned int shift = EXYNOS_EINT_CON_LEN * irqd->hwirq; 167 170 unsigned long reg_con = our_chip->eint_con + bank->eint_offset; 168 171 unsigned long flags; ··· 183 188 184 189 spin_lock_irqsave(&bank->slock, flags); 185 190 186 - con = readl(d->virt_base + reg_con); 191 + con = readl(bank->eint_base + reg_con); 187 192 con &= ~(mask << shift); 188 193 con |= EXYNOS_EINT_FUNC << shift; 189 - writel(con, d->virt_base + reg_con); 194 + writel(con, bank->eint_base + reg_con); 190 195 191 196 spin_unlock_irqrestore(&bank->slock, flags); 192 197 ··· 201 206 struct exynos_irq_chip *our_chip = to_exynos_irq_chip(chip); 202 207 struct samsung_pin_bank *bank = irq_data_get_irq_chip_data(irqd); 203 208 const struct samsung_pin_bank_type *bank_type = bank->type; 204 - struct samsung_pinctrl_drv_data *d = bank->drvdata; 205 209 unsigned int shift = EXYNOS_EINT_CON_LEN * irqd->hwirq; 206 210 unsigned long reg_con = our_chip->eint_con + bank->eint_offset; 207 211 unsigned long flags; ··· 215 221 216 222 spin_lock_irqsave(&bank->slock, flags); 217 223 218 - con = readl(d->virt_base + reg_con); 224 + con = readl(bank->eint_base + reg_con); 219 225 con &= ~(mask << shift); 220 226 con |= FUNC_INPUT << shift; 221 - writel(con, d->virt_base + reg_con); 227 + writel(con, bank->eint_base + reg_con); 222 228 223 229 spin_unlock_irqrestore(&bank->slock, flags); 224 230 ··· 268 274 struct samsung_pin_bank *bank = d->pin_banks; 269 275 unsigned int svc, group, pin, virq; 270 276 271 - svc = readl(d->virt_base + EXYNOS_SVC_OFFSET); 277 + svc = readl(bank->eint_base + EXYNOS_SVC_OFFSET); 272 278 group = EXYNOS_SVC_GROUP(svc); 273 279 pin = svc & EXYNOS_SVC_NUM_MASK; 274 280 ··· 446 452 { 447 453 struct irq_chip *chip = irq_desc_get_chip(desc); 448 454 struct exynos_muxed_weint_data *eintd = irq_desc_get_handler_data(desc); 449 - struct samsung_pinctrl_drv_data *d = eintd->banks[0]->drvdata; 450 455 unsigned long pend; 451 456 unsigned long mask; 452 457 int i; ··· 454 461 455 462 for (i = 0; i < eintd->nr_banks; ++i) { 456 463 struct samsung_pin_bank *b = eintd->banks[i]; 457 - pend = readl(d->virt_base + b->irq_chip->eint_pend 464 + pend = readl(b->eint_base + b->irq_chip->eint_pend 458 465 + b->eint_offset); 459 - mask = readl(d->virt_base + b->irq_chip->eint_mask 466 + mask = readl(b->eint_base + b->irq_chip->eint_mask 460 467 + b->eint_offset); 461 468 exynos_irq_demux_eint(pend & ~mask, b->irq_domain); 462 469 } ··· 574 581 struct samsung_pin_bank *bank) 575 582 { 576 583 struct exynos_eint_gpio_save *save = bank->soc_priv; 577 - void __iomem *regs = drvdata->virt_base; 584 + void __iomem *regs = bank->eint_base; 578 585 579 586 save->eint_con = readl(regs + EXYNOS_GPIO_ECON_OFFSET 580 587 + bank->eint_offset); ··· 603 610 struct samsung_pin_bank *bank) 604 611 { 605 612 struct exynos_eint_gpio_save *save = bank->soc_priv; 606 - void __iomem *regs = drvdata->virt_base; 613 + void __iomem *regs = bank->eint_base; 607 614 608 615 pr_debug("%s: con %#010x => %#010x\n", bank->name, 609 616 readl(regs + EXYNOS_GPIO_ECON_OFFSET ··· 1339 1346 EXYNOS_PIN_BANK_EINTW(8, 0x020, "gpa1", 0x04), 1340 1347 EXYNOS_PIN_BANK_EINTW(8, 0x040, "gpa2", 0x08), 1341 1348 EXYNOS_PIN_BANK_EINTW(8, 0x060, "gpa3", 0x0c), 1349 + EXYNOS_PIN_BANK_EINTW_EXT(8, 0x020, "gpf1", 0x1004, 1), 1350 + EXYNOS_PIN_BANK_EINTW_EXT(4, 0x040, "gpf2", 0x1008, 1), 1351 + EXYNOS_PIN_BANK_EINTW_EXT(4, 0x060, "gpf3", 0x100c, 1), 1352 + EXYNOS_PIN_BANK_EINTW_EXT(8, 0x080, "gpf4", 0x1010, 1), 1353 + EXYNOS_PIN_BANK_EINTW_EXT(8, 0x0a0, "gpf5", 0x1014, 1), 1342 1354 }; 1343 1355 1344 1356 /* pin banks of exynos5433 pin-controller - AUD */ ··· 1425 1427 .eint_wkup_init = exynos_eint_wkup_init, 1426 1428 .suspend = exynos_pinctrl_suspend, 1427 1429 .resume = exynos_pinctrl_resume, 1430 + .nr_ext_resources = 1, 1428 1431 }, { 1429 1432 /* pin-controller instance 1 data */ 1430 1433 .pin_banks = exynos5433_pin_banks1,
+11
drivers/pinctrl/samsung/pinctrl-exynos.h
··· 79 79 .name = id \ 80 80 } 81 81 82 + #define EXYNOS_PIN_BANK_EINTW_EXT(pins, reg, id, offs, pctl_idx) \ 83 + { \ 84 + .type = &bank_type_alive, \ 85 + .pctl_offset = reg, \ 86 + .nr_pins = pins, \ 87 + .eint_type = EINT_TYPE_WKUP, \ 88 + .eint_offset = offs, \ 89 + .name = id, \ 90 + .pctl_res_idx = pctl_idx, \ 91 + } \ 92 + 82 93 /** 83 94 * struct exynos_weint_data: irq specific data for all the wakeup interrupts 84 95 * generated by the external wakeup interrupt controller.
+16 -21
drivers/pinctrl/samsung/pinctrl-s3c24xx.c
··· 151 151 u32 val; 152 152 153 153 /* Make sure that pin is configured as interrupt */ 154 - reg = d->virt_base + bank->pctl_offset; 154 + reg = bank->pctl_base + bank->pctl_offset; 155 155 shift = pin * bank_type->fld_width[PINCFG_TYPE_FUNC]; 156 156 mask = (1 << bank_type->fld_width[PINCFG_TYPE_FUNC]) - 1; 157 157 ··· 184 184 s3c24xx_eint_set_handler(data, type); 185 185 186 186 /* Set up interrupt trigger */ 187 - reg = d->virt_base + EINT_REG(index); 187 + reg = bank->eint_base + EINT_REG(index); 188 188 shift = EINT_OFFS(index); 189 189 190 190 val = readl(reg); ··· 259 259 static void s3c2412_eint0_3_ack(struct irq_data *data) 260 260 { 261 261 struct samsung_pin_bank *bank = irq_data_get_irq_chip_data(data); 262 - struct samsung_pinctrl_drv_data *d = bank->drvdata; 263 262 264 263 unsigned long bitval = 1UL << data->hwirq; 265 - writel(bitval, d->virt_base + EINTPEND_REG); 264 + writel(bitval, bank->eint_base + EINTPEND_REG); 266 265 } 267 266 268 267 static void s3c2412_eint0_3_mask(struct irq_data *data) 269 268 { 270 269 struct samsung_pin_bank *bank = irq_data_get_irq_chip_data(data); 271 - struct samsung_pinctrl_drv_data *d = bank->drvdata; 272 270 unsigned long mask; 273 271 274 - mask = readl(d->virt_base + EINTMASK_REG); 272 + mask = readl(bank->eint_base + EINTMASK_REG); 275 273 mask |= (1UL << data->hwirq); 276 - writel(mask, d->virt_base + EINTMASK_REG); 274 + writel(mask, bank->eint_base + EINTMASK_REG); 277 275 } 278 276 279 277 static void s3c2412_eint0_3_unmask(struct irq_data *data) 280 278 { 281 279 struct samsung_pin_bank *bank = irq_data_get_irq_chip_data(data); 282 - struct samsung_pinctrl_drv_data *d = bank->drvdata; 283 280 unsigned long mask; 284 281 285 - mask = readl(d->virt_base + EINTMASK_REG); 282 + mask = readl(bank->eint_base + EINTMASK_REG); 286 283 mask &= ~(1UL << data->hwirq); 287 - writel(mask, d->virt_base + EINTMASK_REG); 284 + writel(mask, bank->eint_base + EINTMASK_REG); 288 285 } 289 286 290 287 static struct irq_chip s3c2412_eint0_3_chip = { ··· 316 319 static void s3c24xx_eint_ack(struct irq_data *data) 317 320 { 318 321 struct samsung_pin_bank *bank = irq_data_get_irq_chip_data(data); 319 - struct samsung_pinctrl_drv_data *d = bank->drvdata; 320 322 unsigned char index = bank->eint_offset + data->hwirq; 321 323 322 - writel(1UL << index, d->virt_base + EINTPEND_REG); 324 + writel(1UL << index, bank->eint_base + EINTPEND_REG); 323 325 } 324 326 325 327 static void s3c24xx_eint_mask(struct irq_data *data) 326 328 { 327 329 struct samsung_pin_bank *bank = irq_data_get_irq_chip_data(data); 328 - struct samsung_pinctrl_drv_data *d = bank->drvdata; 329 330 unsigned char index = bank->eint_offset + data->hwirq; 330 331 unsigned long mask; 331 332 332 - mask = readl(d->virt_base + EINTMASK_REG); 333 + mask = readl(bank->eint_base + EINTMASK_REG); 333 334 mask |= (1UL << index); 334 - writel(mask, d->virt_base + EINTMASK_REG); 335 + writel(mask, bank->eint_base + EINTMASK_REG); 335 336 } 336 337 337 338 static void s3c24xx_eint_unmask(struct irq_data *data) 338 339 { 339 340 struct samsung_pin_bank *bank = irq_data_get_irq_chip_data(data); 340 - struct samsung_pinctrl_drv_data *d = bank->drvdata; 341 341 unsigned char index = bank->eint_offset + data->hwirq; 342 342 unsigned long mask; 343 343 344 - mask = readl(d->virt_base + EINTMASK_REG); 344 + mask = readl(bank->eint_base + EINTMASK_REG); 345 345 mask &= ~(1UL << index); 346 - writel(mask, d->virt_base + EINTMASK_REG); 346 + writel(mask, bank->eint_base + EINTMASK_REG); 347 347 } 348 348 349 349 static struct irq_chip s3c24xx_eint_chip = { ··· 356 362 { 357 363 struct s3c24xx_eint_data *data = irq_desc_get_handler_data(desc); 358 364 struct irq_chip *chip = irq_desc_get_chip(desc); 359 - struct samsung_pinctrl_drv_data *d = data->drvdata; 365 + struct irq_data *irqd = irq_desc_get_irq_data(desc); 366 + struct samsung_pin_bank *bank = irq_data_get_irq_chip_data(irqd); 360 367 unsigned int pend, mask; 361 368 362 369 chained_irq_enter(chip, desc); 363 370 364 - pend = readl(d->virt_base + EINTPEND_REG); 365 - mask = readl(d->virt_base + EINTMASK_REG); 371 + pend = readl(bank->eint_base + EINTPEND_REG); 372 + mask = readl(bank->eint_base + EINTMASK_REG); 366 373 367 374 pend &= ~mask; 368 375 pend &= range;
+22 -18
drivers/pinctrl/samsung/pinctrl-s3c64xx.c
··· 280 280 u32 val; 281 281 282 282 /* Make sure that pin is configured as interrupt */ 283 - reg = d->virt_base + bank->pctl_offset; 283 + reg = bank->pctl_base + bank->pctl_offset; 284 284 shift = pin; 285 285 if (bank_type->fld_width[PINCFG_TYPE_FUNC] * shift >= 32) { 286 286 /* 4-bit bank type with 2 con regs */ ··· 308 308 static inline void s3c64xx_gpio_irq_set_mask(struct irq_data *irqd, bool mask) 309 309 { 310 310 struct samsung_pin_bank *bank = irq_data_get_irq_chip_data(irqd); 311 - struct samsung_pinctrl_drv_data *d = bank->drvdata; 312 311 unsigned char index = EINT_OFFS(bank->eint_offset) + irqd->hwirq; 313 - void __iomem *reg = d->virt_base + EINTMASK_REG(bank->eint_offset); 312 + void __iomem *reg = bank->eint_base + EINTMASK_REG(bank->eint_offset); 314 313 u32 val; 315 314 316 315 val = readl(reg); ··· 333 334 static void s3c64xx_gpio_irq_ack(struct irq_data *irqd) 334 335 { 335 336 struct samsung_pin_bank *bank = irq_data_get_irq_chip_data(irqd); 336 - struct samsung_pinctrl_drv_data *d = bank->drvdata; 337 337 unsigned char index = EINT_OFFS(bank->eint_offset) + irqd->hwirq; 338 - void __iomem *reg = d->virt_base + EINTPEND_REG(bank->eint_offset); 338 + void __iomem *reg = bank->eint_base + EINTPEND_REG(bank->eint_offset); 339 339 340 340 writel(1 << index, reg); 341 341 } ··· 357 359 s3c64xx_irq_set_handler(irqd, type); 358 360 359 361 /* Set up interrupt trigger */ 360 - reg = d->virt_base + EINTCON_REG(bank->eint_offset); 362 + reg = bank->eint_base + EINTCON_REG(bank->eint_offset); 361 363 shift = EINT_OFFS(bank->eint_offset) + irqd->hwirq; 362 364 shift = 4 * (shift / 4); /* 4 EINTs per trigger selector */ 363 365 ··· 409 411 { 410 412 struct irq_chip *chip = irq_desc_get_chip(desc); 411 413 struct s3c64xx_eint_gpio_data *data = irq_desc_get_handler_data(desc); 412 - struct samsung_pinctrl_drv_data *drvdata = data->drvdata; 414 + struct irq_data *irqd = irq_desc_get_irq_data(desc); 415 + struct samsung_pin_bank *bank = irq_data_get_irq_chip_data(irqd); 413 416 414 417 chained_irq_enter(chip, desc); 415 418 ··· 420 421 unsigned int pin; 421 422 unsigned int virq; 422 423 423 - svc = readl(drvdata->virt_base + SERVICE_REG); 424 + svc = readl(bank->eint_base + SERVICE_REG); 424 425 group = SVC_GROUP(svc); 425 426 pin = svc & SVC_NUM_MASK; 426 427 ··· 517 518 { 518 519 struct s3c64xx_eint0_domain_data *ddata = 519 520 irq_data_get_irq_chip_data(irqd); 520 - struct samsung_pinctrl_drv_data *d = ddata->bank->drvdata; 521 + struct samsung_pin_bank *bank = ddata->bank; 521 522 u32 val; 522 523 523 - val = readl(d->virt_base + EINT0MASK_REG); 524 + val = readl(bank->eint_base + EINT0MASK_REG); 524 525 if (mask) 525 526 val |= 1 << ddata->eints[irqd->hwirq]; 526 527 else 527 528 val &= ~(1 << ddata->eints[irqd->hwirq]); 528 - writel(val, d->virt_base + EINT0MASK_REG); 529 + writel(val, bank->eint_base + EINT0MASK_REG); 529 530 } 530 531 531 532 static void s3c64xx_eint0_irq_unmask(struct irq_data *irqd) ··· 542 543 { 543 544 struct s3c64xx_eint0_domain_data *ddata = 544 545 irq_data_get_irq_chip_data(irqd); 545 - struct samsung_pinctrl_drv_data *d = ddata->bank->drvdata; 546 + struct samsung_pin_bank *bank = ddata->bank; 546 547 547 548 writel(1 << ddata->eints[irqd->hwirq], 548 - d->virt_base + EINT0PEND_REG); 549 + bank->eint_base + EINT0PEND_REG); 549 550 } 550 551 551 552 static int s3c64xx_eint0_irq_set_type(struct irq_data *irqd, unsigned int type) ··· 553 554 struct s3c64xx_eint0_domain_data *ddata = 554 555 irq_data_get_irq_chip_data(irqd); 555 556 struct samsung_pin_bank *bank = ddata->bank; 556 - struct samsung_pinctrl_drv_data *d = bank->drvdata; 557 + struct samsung_pinctrl_drv_data *d = ddata->bank->drvdata; 557 558 void __iomem *reg; 558 559 int trigger; 559 560 u8 shift; ··· 568 569 s3c64xx_irq_set_handler(irqd, type); 569 570 570 571 /* Set up interrupt trigger */ 571 - reg = d->virt_base + EINT0CON0_REG; 572 + reg = bank->eint_base + EINT0CON0_REG; 572 573 shift = ddata->eints[irqd->hwirq]; 573 574 if (shift >= EINT_MAX_PER_REG) { 574 575 reg += 4; ··· 600 601 static inline void s3c64xx_irq_demux_eint(struct irq_desc *desc, u32 range) 601 602 { 602 603 struct irq_chip *chip = irq_desc_get_chip(desc); 604 + struct irq_data *irqd = irq_desc_get_irq_data(desc); 605 + struct s3c64xx_eint0_domain_data *ddata = 606 + irq_data_get_irq_chip_data(irqd); 607 + struct samsung_pin_bank *bank = ddata->bank; 608 + 603 609 struct s3c64xx_eint0_data *data = irq_desc_get_handler_data(desc); 604 - struct samsung_pinctrl_drv_data *drvdata = data->drvdata; 610 + 605 611 unsigned int pend, mask; 606 612 607 613 chained_irq_enter(chip, desc); 608 614 609 - pend = readl(drvdata->virt_base + EINT0PEND_REG); 610 - mask = readl(drvdata->virt_base + EINT0MASK_REG); 615 + pend = readl(bank->eint_base + EINT0PEND_REG); 616 + mask = readl(bank->eint_base + EINT0MASK_REG); 611 617 612 618 pend = pend & range & ~mask; 613 619 pend &= range;
+26 -14
drivers/pinctrl/samsung/pinctrl-samsung.c
··· 33 33 #include "../core.h" 34 34 #include "pinctrl-samsung.h" 35 35 36 + /* maximum number of the memory resources */ 37 + #define SAMSUNG_PINCTRL_NUM_RESOURCES 2 38 + 36 39 /* list of all possible config options supported */ 37 40 static struct pin_config { 38 41 const char *property; ··· 348 345 ((b->pin_base + b->nr_pins - 1) < pin)) 349 346 b++; 350 347 351 - *reg = drvdata->virt_base + b->pctl_offset; 348 + *reg = b->pctl_base + b->pctl_offset; 352 349 *offset = pin - b->pin_base; 353 350 if (bank) 354 351 *bank = b; ··· 529 526 void __iomem *reg; 530 527 u32 data; 531 528 532 - reg = bank->drvdata->virt_base + bank->pctl_offset; 529 + reg = bank->pctl_base + bank->pctl_offset; 533 530 534 531 data = readl(reg + type->reg_offset[PINCFG_TYPE_DAT]); 535 532 data &= ~(1 << offset); ··· 557 554 struct samsung_pin_bank *bank = gpiochip_get_data(gc); 558 555 const struct samsung_pin_bank_type *type = bank->type; 559 556 560 - reg = bank->drvdata->virt_base + bank->pctl_offset; 557 + reg = bank->pctl_base + bank->pctl_offset; 561 558 562 559 data = readl(reg + type->reg_offset[PINCFG_TYPE_DAT]); 563 560 data >>= offset; ··· 584 581 type = bank->type; 585 582 drvdata = bank->drvdata; 586 583 587 - reg = drvdata->virt_base + bank->pctl_offset + 588 - type->reg_offset[PINCFG_TYPE_FUNC]; 584 + reg = bank->pctl_base + bank->pctl_offset 585 + + type->reg_offset[PINCFG_TYPE_FUNC]; 589 586 590 587 mask = (1 << type->fld_width[PINCFG_TYPE_FUNC]) - 1; 591 588 shift = offset * type->fld_width[PINCFG_TYPE_FUNC]; ··· 982 979 const struct samsung_pin_bank_data *bdata; 983 980 const struct samsung_pin_ctrl *ctrl; 984 981 struct samsung_pin_bank *bank; 982 + struct resource *res; 983 + void __iomem *virt_base[SAMSUNG_PINCTRL_NUM_RESOURCES]; 985 984 int i; 986 985 987 986 id = of_alias_get_id(node, "pinctrl"); ··· 1002 997 if (!d->pin_banks) 1003 998 return ERR_PTR(-ENOMEM); 1004 999 1000 + if (ctrl->nr_ext_resources + 1 > SAMSUNG_PINCTRL_NUM_RESOURCES) 1001 + return ERR_PTR(-EINVAL); 1002 + 1003 + for (i = 0; i < ctrl->nr_ext_resources + 1; i++) { 1004 + res = platform_get_resource(pdev, IORESOURCE_MEM, i); 1005 + virt_base[i] = devm_ioremap(&pdev->dev, res->start, 1006 + resource_size(res)); 1007 + if (IS_ERR(virt_base[i])) 1008 + return ERR_PTR(-EIO); 1009 + } 1010 + 1005 1011 bank = d->pin_banks; 1006 1012 bdata = ctrl->pin_banks; 1007 1013 for (i = 0; i < ctrl->nr_banks; ++i, ++bdata, ++bank) { ··· 1029 1013 bank->drvdata = d; 1030 1014 bank->pin_base = d->nr_pins; 1031 1015 d->nr_pins += bank->nr_pins; 1016 + 1017 + bank->eint_base = virt_base[0]; 1018 + bank->pctl_base = virt_base[bdata->pctl_res_idx]; 1032 1019 } 1033 1020 1034 1021 for_each_child_of_node(node, np) { ··· 1071 1052 } 1072 1053 drvdata->dev = dev; 1073 1054 1074 - res = platform_get_resource(pdev, IORESOURCE_MEM, 0); 1075 - drvdata->virt_base = devm_ioremap_resource(&pdev->dev, res); 1076 - if (IS_ERR(drvdata->virt_base)) 1077 - return PTR_ERR(drvdata->virt_base); 1078 - 1079 1055 res = platform_get_resource(pdev, IORESOURCE_IRQ, 0); 1080 1056 if (res) 1081 1057 drvdata->irq = res->start; ··· 1108 1094 static void samsung_pinctrl_suspend_dev( 1109 1095 struct samsung_pinctrl_drv_data *drvdata) 1110 1096 { 1111 - void __iomem *virt_base = drvdata->virt_base; 1112 1097 int i; 1113 1098 1114 1099 for (i = 0; i < drvdata->nr_banks; i++) { 1115 1100 struct samsung_pin_bank *bank = &drvdata->pin_banks[i]; 1116 - void __iomem *reg = virt_base + bank->pctl_offset; 1101 + void __iomem *reg = bank->pctl_base + bank->pctl_offset; 1117 1102 const u8 *offs = bank->type->reg_offset; 1118 1103 const u8 *widths = bank->type->fld_width; 1119 1104 enum pincfg_type type; ··· 1153 1140 */ 1154 1141 static void samsung_pinctrl_resume_dev(struct samsung_pinctrl_drv_data *drvdata) 1155 1142 { 1156 - void __iomem *virt_base = drvdata->virt_base; 1157 1143 int i; 1158 1144 1159 1145 if (drvdata->resume) ··· 1160 1148 1161 1149 for (i = 0; i < drvdata->nr_banks; i++) { 1162 1150 struct samsung_pin_bank *bank = &drvdata->pin_banks[i]; 1163 - void __iomem *reg = virt_base + bank->pctl_offset; 1151 + void __iomem *reg = bank->pctl_base + bank->pctl_offset; 1164 1152 const u8 *offs = bank->type->reg_offset; 1165 1153 const u8 *widths = bank->type->fld_width; 1166 1154 enum pincfg_type type;
+8 -2
drivers/pinctrl/samsung/pinctrl-samsung.h
··· 116 116 * struct samsung_pin_bank_data: represent a controller pin-bank (init data). 117 117 * @type: type of the bank (register offsets and bitfield widths) 118 118 * @pctl_offset: starting offset of the pin-bank registers. 119 + * @pctl_res_idx: index of base address for pin-bank registers. 119 120 * @nr_pins: number of pins included in this bank. 120 121 * @eint_func: function to set in CON register to configure pin as EINT. 121 122 * @eint_type: type of the external interrupt supported by the bank. ··· 127 126 struct samsung_pin_bank_data { 128 127 const struct samsung_pin_bank_type *type; 129 128 u32 pctl_offset; 129 + u8 pctl_res_idx; 130 130 u8 nr_pins; 131 131 u8 eint_func; 132 132 enum eint_type eint_type; ··· 139 137 /** 140 138 * struct samsung_pin_bank: represent a controller pin-bank. 141 139 * @type: type of the bank (register offsets and bitfield widths) 140 + * @pctl_base: base address of the pin-bank registers 142 141 * @pctl_offset: starting offset of the pin-bank registers. 143 142 * @nr_pins: number of pins included in this bank. 143 + * @eint_base: base address of the pin-bank EINT registers. 144 144 * @eint_func: function to set in CON register to configure pin as EINT. 145 145 * @eint_type: type of the external interrupt supported by the bank. 146 146 * @eint_mask: bit mask of pins which support EINT function. ··· 161 157 */ 162 158 struct samsung_pin_bank { 163 159 const struct samsung_pin_bank_type *type; 160 + void __iomem *pctl_base; 164 161 u32 pctl_offset; 165 162 u8 nr_pins; 163 + void __iomem *eint_base; 166 164 u8 eint_func; 167 165 enum eint_type eint_type; 168 166 u32 eint_mask; ··· 188 182 * struct samsung_pin_ctrl: represent a pin controller. 189 183 * @pin_banks: list of pin banks included in this controller. 190 184 * @nr_banks: number of pin banks. 185 + * @nr_ext_resources: number of the extra base address for pin banks. 191 186 * @eint_gpio_init: platform specific callback to setup the external gpio 192 187 * interrupts for the controller. 193 188 * @eint_wkup_init: platform specific callback to setup the external wakeup ··· 197 190 struct samsung_pin_ctrl { 198 191 const struct samsung_pin_bank_data *pin_banks; 199 192 u32 nr_banks; 193 + int nr_ext_resources; 200 194 201 195 int (*eint_gpio_init)(struct samsung_pinctrl_drv_data *); 202 196 int (*eint_wkup_init)(struct samsung_pinctrl_drv_data *); ··· 208 200 /** 209 201 * struct samsung_pinctrl_drv_data: wrapper for holding driver data together. 210 202 * @node: global list node 211 - * @virt_base: register base address of the controller. 212 203 * @dev: device instance representing the controller. 213 204 * @irq: interrpt number used by the controller to notify gpio interrupts. 214 205 * @ctrl: pin controller instance managed by the driver. ··· 222 215 */ 223 216 struct samsung_pinctrl_drv_data { 224 217 struct list_head node; 225 - void __iomem *virt_base; 226 218 struct device *dev; 227 219 int irq; 228 220
+15
drivers/pinctrl/sh-pfc/core.c
··· 389 389 return 0; 390 390 } 391 391 392 + const struct sh_pfc_bias_info * 393 + sh_pfc_pin_to_bias_info(const struct sh_pfc_bias_info *info, 394 + unsigned int num, unsigned int pin) 395 + { 396 + unsigned int i; 397 + 398 + for (i = 0; i < num; i++) 399 + if (info[i].pin == pin) 400 + return &info[i]; 401 + 402 + WARN_ONCE(1, "Pin %u is not in bias info list\n", pin); 403 + 404 + return NULL; 405 + } 406 + 392 407 static int sh_pfc_init_ranges(struct sh_pfc *pfc) 393 408 { 394 409 struct sh_pfc_pin_range *range;
+4
drivers/pinctrl/sh-pfc/core.h
··· 33 33 int sh_pfc_get_pin_index(struct sh_pfc *pfc, unsigned int pin); 34 34 int sh_pfc_config_mux(struct sh_pfc *pfc, unsigned mark, int pinmux_type); 35 35 36 + const struct sh_pfc_bias_info * 37 + sh_pfc_pin_to_bias_info(const struct sh_pfc_bias_info *info, 38 + unsigned int num, unsigned int pin); 39 + 36 40 #endif /* __SH_PFC_CORE_H__ */
+167 -165
drivers/pinctrl/sh-pfc/pfc-r8a7778.c
··· 24 24 #include <linux/kernel.h> 25 25 #include <linux/pinctrl/pinconf-generic.h> 26 26 27 + #include "core.h" 27 28 #include "sh_pfc.h" 28 29 29 30 #define PORT_GP_PUP_1(bank, pin, fn, sfx) \ ··· 2919 2918 #define PUPR4 0x110 2920 2919 #define PUPR5 0x114 2921 2920 2922 - static const struct { 2923 - u16 reg : 11; 2924 - u16 bit : 5; 2925 - } pullups[] = { 2926 - [RCAR_GP_PIN(0, 6)] = { PUPR0, 0 }, /* A0 */ 2927 - [RCAR_GP_PIN(0, 7)] = { PUPR0, 1 }, /* A1 */ 2928 - [RCAR_GP_PIN(0, 8)] = { PUPR0, 2 }, /* A2 */ 2929 - [RCAR_GP_PIN(0, 9)] = { PUPR0, 3 }, /* A3 */ 2930 - [RCAR_GP_PIN(0, 10)] = { PUPR0, 4 }, /* A4 */ 2931 - [RCAR_GP_PIN(0, 11)] = { PUPR0, 5 }, /* A5 */ 2932 - [RCAR_GP_PIN(0, 12)] = { PUPR0, 6 }, /* A6 */ 2933 - [RCAR_GP_PIN(0, 13)] = { PUPR0, 7 }, /* A7 */ 2934 - [RCAR_GP_PIN(0, 14)] = { PUPR0, 8 }, /* A8 */ 2935 - [RCAR_GP_PIN(0, 15)] = { PUPR0, 9 }, /* A9 */ 2936 - [RCAR_GP_PIN(0, 16)] = { PUPR0, 10 }, /* A10 */ 2937 - [RCAR_GP_PIN(0, 17)] = { PUPR0, 11 }, /* A11 */ 2938 - [RCAR_GP_PIN(0, 18)] = { PUPR0, 12 }, /* A12 */ 2939 - [RCAR_GP_PIN(0, 19)] = { PUPR0, 13 }, /* A13 */ 2940 - [RCAR_GP_PIN(0, 20)] = { PUPR0, 14 }, /* A14 */ 2941 - [RCAR_GP_PIN(0, 21)] = { PUPR0, 15 }, /* A15 */ 2942 - [RCAR_GP_PIN(0, 22)] = { PUPR0, 16 }, /* A16 */ 2943 - [RCAR_GP_PIN(0, 23)] = { PUPR0, 17 }, /* A17 */ 2944 - [RCAR_GP_PIN(0, 24)] = { PUPR0, 18 }, /* A18 */ 2945 - [RCAR_GP_PIN(0, 25)] = { PUPR0, 19 }, /* A19 */ 2946 - [RCAR_GP_PIN(0, 26)] = { PUPR0, 20 }, /* A20 */ 2947 - [RCAR_GP_PIN(0, 27)] = { PUPR0, 21 }, /* A21 */ 2948 - [RCAR_GP_PIN(0, 28)] = { PUPR0, 22 }, /* A22 */ 2949 - [RCAR_GP_PIN(0, 29)] = { PUPR0, 23 }, /* A23 */ 2950 - [RCAR_GP_PIN(0, 30)] = { PUPR0, 24 }, /* A24 */ 2951 - [RCAR_GP_PIN(0, 31)] = { PUPR0, 25 }, /* A25 */ 2952 - [RCAR_GP_PIN(1, 3)] = { PUPR0, 26 }, /* /EX_CS0 */ 2953 - [RCAR_GP_PIN(1, 4)] = { PUPR0, 27 }, /* /EX_CS1 */ 2954 - [RCAR_GP_PIN(1, 5)] = { PUPR0, 28 }, /* /EX_CS2 */ 2955 - [RCAR_GP_PIN(1, 6)] = { PUPR0, 29 }, /* /EX_CS3 */ 2956 - [RCAR_GP_PIN(1, 7)] = { PUPR0, 30 }, /* /EX_CS4 */ 2957 - [RCAR_GP_PIN(1, 8)] = { PUPR0, 31 }, /* /EX_CS5 */ 2921 + static const struct sh_pfc_bias_info bias_info[] = { 2922 + { RCAR_GP_PIN(0, 6), PUPR0, 0 }, /* A0 */ 2923 + { RCAR_GP_PIN(0, 7), PUPR0, 1 }, /* A1 */ 2924 + { RCAR_GP_PIN(0, 8), PUPR0, 2 }, /* A2 */ 2925 + { RCAR_GP_PIN(0, 9), PUPR0, 3 }, /* A3 */ 2926 + { RCAR_GP_PIN(0, 10), PUPR0, 4 }, /* A4 */ 2927 + { RCAR_GP_PIN(0, 11), PUPR0, 5 }, /* A5 */ 2928 + { RCAR_GP_PIN(0, 12), PUPR0, 6 }, /* A6 */ 2929 + { RCAR_GP_PIN(0, 13), PUPR0, 7 }, /* A7 */ 2930 + { RCAR_GP_PIN(0, 14), PUPR0, 8 }, /* A8 */ 2931 + { RCAR_GP_PIN(0, 15), PUPR0, 9 }, /* A9 */ 2932 + { RCAR_GP_PIN(0, 16), PUPR0, 10 }, /* A10 */ 2933 + { RCAR_GP_PIN(0, 17), PUPR0, 11 }, /* A11 */ 2934 + { RCAR_GP_PIN(0, 18), PUPR0, 12 }, /* A12 */ 2935 + { RCAR_GP_PIN(0, 19), PUPR0, 13 }, /* A13 */ 2936 + { RCAR_GP_PIN(0, 20), PUPR0, 14 }, /* A14 */ 2937 + { RCAR_GP_PIN(0, 21), PUPR0, 15 }, /* A15 */ 2938 + { RCAR_GP_PIN(0, 22), PUPR0, 16 }, /* A16 */ 2939 + { RCAR_GP_PIN(0, 23), PUPR0, 17 }, /* A17 */ 2940 + { RCAR_GP_PIN(0, 24), PUPR0, 18 }, /* A18 */ 2941 + { RCAR_GP_PIN(0, 25), PUPR0, 19 }, /* A19 */ 2942 + { RCAR_GP_PIN(0, 26), PUPR0, 20 }, /* A20 */ 2943 + { RCAR_GP_PIN(0, 27), PUPR0, 21 }, /* A21 */ 2944 + { RCAR_GP_PIN(0, 28), PUPR0, 22 }, /* A22 */ 2945 + { RCAR_GP_PIN(0, 29), PUPR0, 23 }, /* A23 */ 2946 + { RCAR_GP_PIN(0, 30), PUPR0, 24 }, /* A24 */ 2947 + { RCAR_GP_PIN(0, 31), PUPR0, 25 }, /* A25 */ 2948 + { RCAR_GP_PIN(1, 3), PUPR0, 26 }, /* /EX_CS0 */ 2949 + { RCAR_GP_PIN(1, 4), PUPR0, 27 }, /* /EX_CS1 */ 2950 + { RCAR_GP_PIN(1, 5), PUPR0, 28 }, /* /EX_CS2 */ 2951 + { RCAR_GP_PIN(1, 6), PUPR0, 29 }, /* /EX_CS3 */ 2952 + { RCAR_GP_PIN(1, 7), PUPR0, 30 }, /* /EX_CS4 */ 2953 + { RCAR_GP_PIN(1, 8), PUPR0, 31 }, /* /EX_CS5 */ 2958 2954 2959 - [RCAR_GP_PIN(0, 0)] = { PUPR1, 0 }, /* /PRESETOUT */ 2960 - [RCAR_GP_PIN(0, 5)] = { PUPR1, 1 }, /* /BS */ 2961 - [RCAR_GP_PIN(1, 0)] = { PUPR1, 2 }, /* RD//WR */ 2962 - [RCAR_GP_PIN(1, 1)] = { PUPR1, 3 }, /* /WE0 */ 2963 - [RCAR_GP_PIN(1, 2)] = { PUPR1, 4 }, /* /WE1 */ 2964 - [RCAR_GP_PIN(1, 11)] = { PUPR1, 5 }, /* EX_WAIT0 */ 2965 - [RCAR_GP_PIN(1, 9)] = { PUPR1, 6 }, /* DREQ0 */ 2966 - [RCAR_GP_PIN(1, 10)] = { PUPR1, 7 }, /* DACK0 */ 2967 - [RCAR_GP_PIN(1, 12)] = { PUPR1, 8 }, /* IRQ0 */ 2968 - [RCAR_GP_PIN(1, 13)] = { PUPR1, 9 }, /* IRQ1 */ 2955 + { RCAR_GP_PIN(0, 0), PUPR1, 0 }, /* /PRESETOUT */ 2956 + { RCAR_GP_PIN(0, 5), PUPR1, 1 }, /* /BS */ 2957 + { RCAR_GP_PIN(1, 0), PUPR1, 2 }, /* RD//WR */ 2958 + { RCAR_GP_PIN(1, 1), PUPR1, 3 }, /* /WE0 */ 2959 + { RCAR_GP_PIN(1, 2), PUPR1, 4 }, /* /WE1 */ 2960 + { RCAR_GP_PIN(1, 11), PUPR1, 5 }, /* EX_WAIT0 */ 2961 + { RCAR_GP_PIN(1, 9), PUPR1, 6 }, /* DREQ0 */ 2962 + { RCAR_GP_PIN(1, 10), PUPR1, 7 }, /* DACK0 */ 2963 + { RCAR_GP_PIN(1, 12), PUPR1, 8 }, /* IRQ0 */ 2964 + { RCAR_GP_PIN(1, 13), PUPR1, 9 }, /* IRQ1 */ 2969 2965 2970 - [RCAR_GP_PIN(1, 22)] = { PUPR2, 0 }, /* DU0_DR0 */ 2971 - [RCAR_GP_PIN(1, 23)] = { PUPR2, 1 }, /* DU0_DR1 */ 2972 - [RCAR_GP_PIN(1, 24)] = { PUPR2, 2 }, /* DU0_DR2 */ 2973 - [RCAR_GP_PIN(1, 25)] = { PUPR2, 3 }, /* DU0_DR3 */ 2974 - [RCAR_GP_PIN(1, 26)] = { PUPR2, 4 }, /* DU0_DR4 */ 2975 - [RCAR_GP_PIN(1, 27)] = { PUPR2, 5 }, /* DU0_DR5 */ 2976 - [RCAR_GP_PIN(1, 28)] = { PUPR2, 6 }, /* DU0_DR6 */ 2977 - [RCAR_GP_PIN(1, 29)] = { PUPR2, 7 }, /* DU0_DR7 */ 2978 - [RCAR_GP_PIN(1, 30)] = { PUPR2, 8 }, /* DU0_DG0 */ 2979 - [RCAR_GP_PIN(1, 31)] = { PUPR2, 9 }, /* DU0_DG1 */ 2980 - [RCAR_GP_PIN(2, 0)] = { PUPR2, 10 }, /* DU0_DG2 */ 2981 - [RCAR_GP_PIN(2, 1)] = { PUPR2, 11 }, /* DU0_DG3 */ 2982 - [RCAR_GP_PIN(2, 2)] = { PUPR2, 12 }, /* DU0_DG4 */ 2983 - [RCAR_GP_PIN(2, 3)] = { PUPR2, 13 }, /* DU0_DG5 */ 2984 - [RCAR_GP_PIN(2, 4)] = { PUPR2, 14 }, /* DU0_DG6 */ 2985 - [RCAR_GP_PIN(2, 5)] = { PUPR2, 15 }, /* DU0_DG7 */ 2986 - [RCAR_GP_PIN(2, 6)] = { PUPR2, 16 }, /* DU0_DB0 */ 2987 - [RCAR_GP_PIN(2, 7)] = { PUPR2, 17 }, /* DU0_DB1 */ 2988 - [RCAR_GP_PIN(2, 8)] = { PUPR2, 18 }, /* DU0_DB2 */ 2989 - [RCAR_GP_PIN(2, 9)] = { PUPR2, 19 }, /* DU0_DB3 */ 2990 - [RCAR_GP_PIN(2, 10)] = { PUPR2, 20 }, /* DU0_DB4 */ 2991 - [RCAR_GP_PIN(2, 11)] = { PUPR2, 21 }, /* DU0_DB5 */ 2992 - [RCAR_GP_PIN(2, 12)] = { PUPR2, 22 }, /* DU0_DB6 */ 2993 - [RCAR_GP_PIN(2, 13)] = { PUPR2, 23 }, /* DU0_DB7 */ 2994 - [RCAR_GP_PIN(2, 14)] = { PUPR2, 24 }, /* DU0_DOTCLKIN */ 2995 - [RCAR_GP_PIN(2, 15)] = { PUPR2, 25 }, /* DU0_DOTCLKOUT0 */ 2996 - [RCAR_GP_PIN(2, 17)] = { PUPR2, 26 }, /* DU0_HSYNC */ 2997 - [RCAR_GP_PIN(2, 18)] = { PUPR2, 27 }, /* DU0_VSYNC */ 2998 - [RCAR_GP_PIN(2, 19)] = { PUPR2, 28 }, /* DU0_EXODDF */ 2999 - [RCAR_GP_PIN(2, 20)] = { PUPR2, 29 }, /* DU0_DISP */ 3000 - [RCAR_GP_PIN(2, 21)] = { PUPR2, 30 }, /* DU0_CDE */ 3001 - [RCAR_GP_PIN(2, 16)] = { PUPR2, 31 }, /* DU0_DOTCLKOUT1 */ 2966 + { RCAR_GP_PIN(1, 22), PUPR2, 0 }, /* DU0_DR0 */ 2967 + { RCAR_GP_PIN(1, 23), PUPR2, 1 }, /* DU0_DR1 */ 2968 + { RCAR_GP_PIN(1, 24), PUPR2, 2 }, /* DU0_DR2 */ 2969 + { RCAR_GP_PIN(1, 25), PUPR2, 3 }, /* DU0_DR3 */ 2970 + { RCAR_GP_PIN(1, 26), PUPR2, 4 }, /* DU0_DR4 */ 2971 + { RCAR_GP_PIN(1, 27), PUPR2, 5 }, /* DU0_DR5 */ 2972 + { RCAR_GP_PIN(1, 28), PUPR2, 6 }, /* DU0_DR6 */ 2973 + { RCAR_GP_PIN(1, 29), PUPR2, 7 }, /* DU0_DR7 */ 2974 + { RCAR_GP_PIN(1, 30), PUPR2, 8 }, /* DU0_DG0 */ 2975 + { RCAR_GP_PIN(1, 31), PUPR2, 9 }, /* DU0_DG1 */ 2976 + { RCAR_GP_PIN(2, 0), PUPR2, 10 }, /* DU0_DG2 */ 2977 + { RCAR_GP_PIN(2, 1), PUPR2, 11 }, /* DU0_DG3 */ 2978 + { RCAR_GP_PIN(2, 2), PUPR2, 12 }, /* DU0_DG4 */ 2979 + { RCAR_GP_PIN(2, 3), PUPR2, 13 }, /* DU0_DG5 */ 2980 + { RCAR_GP_PIN(2, 4), PUPR2, 14 }, /* DU0_DG6 */ 2981 + { RCAR_GP_PIN(2, 5), PUPR2, 15 }, /* DU0_DG7 */ 2982 + { RCAR_GP_PIN(2, 6), PUPR2, 16 }, /* DU0_DB0 */ 2983 + { RCAR_GP_PIN(2, 7), PUPR2, 17 }, /* DU0_DB1 */ 2984 + { RCAR_GP_PIN(2, 8), PUPR2, 18 }, /* DU0_DB2 */ 2985 + { RCAR_GP_PIN(2, 9), PUPR2, 19 }, /* DU0_DB3 */ 2986 + { RCAR_GP_PIN(2, 10), PUPR2, 20 }, /* DU0_DB4 */ 2987 + { RCAR_GP_PIN(2, 11), PUPR2, 21 }, /* DU0_DB5 */ 2988 + { RCAR_GP_PIN(2, 12), PUPR2, 22 }, /* DU0_DB6 */ 2989 + { RCAR_GP_PIN(2, 13), PUPR2, 23 }, /* DU0_DB7 */ 2990 + { RCAR_GP_PIN(2, 14), PUPR2, 24 }, /* DU0_DOTCLKIN */ 2991 + { RCAR_GP_PIN(2, 15), PUPR2, 25 }, /* DU0_DOTCLKOUT0 */ 2992 + { RCAR_GP_PIN(2, 17), PUPR2, 26 }, /* DU0_HSYNC */ 2993 + { RCAR_GP_PIN(2, 18), PUPR2, 27 }, /* DU0_VSYNC */ 2994 + { RCAR_GP_PIN(2, 19), PUPR2, 28 }, /* DU0_EXODDF */ 2995 + { RCAR_GP_PIN(2, 20), PUPR2, 29 }, /* DU0_DISP */ 2996 + { RCAR_GP_PIN(2, 21), PUPR2, 30 }, /* DU0_CDE */ 2997 + { RCAR_GP_PIN(2, 16), PUPR2, 31 }, /* DU0_DOTCLKOUT1 */ 3002 2998 3003 - [RCAR_GP_PIN(3, 24)] = { PUPR3, 0 }, /* VI0_CLK */ 3004 - [RCAR_GP_PIN(3, 25)] = { PUPR3, 1 }, /* VI0_CLKENB */ 3005 - [RCAR_GP_PIN(3, 26)] = { PUPR3, 2 }, /* VI0_FIELD */ 3006 - [RCAR_GP_PIN(3, 27)] = { PUPR3, 3 }, /* /VI0_HSYNC */ 3007 - [RCAR_GP_PIN(3, 28)] = { PUPR3, 4 }, /* /VI0_VSYNC */ 3008 - [RCAR_GP_PIN(3, 29)] = { PUPR3, 5 }, /* VI0_DATA0 */ 3009 - [RCAR_GP_PIN(3, 30)] = { PUPR3, 6 }, /* VI0_DATA1 */ 3010 - [RCAR_GP_PIN(3, 31)] = { PUPR3, 7 }, /* VI0_DATA2 */ 3011 - [RCAR_GP_PIN(4, 0)] = { PUPR3, 8 }, /* VI0_DATA3 */ 3012 - [RCAR_GP_PIN(4, 1)] = { PUPR3, 9 }, /* VI0_DATA4 */ 3013 - [RCAR_GP_PIN(4, 2)] = { PUPR3, 10 }, /* VI0_DATA5 */ 3014 - [RCAR_GP_PIN(4, 3)] = { PUPR3, 11 }, /* VI0_DATA6 */ 3015 - [RCAR_GP_PIN(4, 4)] = { PUPR3, 12 }, /* VI0_DATA7 */ 3016 - [RCAR_GP_PIN(4, 5)] = { PUPR3, 13 }, /* VI0_G2 */ 3017 - [RCAR_GP_PIN(4, 6)] = { PUPR3, 14 }, /* VI0_G3 */ 3018 - [RCAR_GP_PIN(4, 7)] = { PUPR3, 15 }, /* VI0_G4 */ 3019 - [RCAR_GP_PIN(4, 8)] = { PUPR3, 16 }, /* VI0_G5 */ 3020 - [RCAR_GP_PIN(4, 21)] = { PUPR3, 17 }, /* VI1_DATA12 */ 3021 - [RCAR_GP_PIN(4, 22)] = { PUPR3, 18 }, /* VI1_DATA13 */ 3022 - [RCAR_GP_PIN(4, 23)] = { PUPR3, 19 }, /* VI1_DATA14 */ 3023 - [RCAR_GP_PIN(4, 24)] = { PUPR3, 20 }, /* VI1_DATA15 */ 3024 - [RCAR_GP_PIN(4, 9)] = { PUPR3, 21 }, /* ETH_REF_CLK */ 3025 - [RCAR_GP_PIN(4, 10)] = { PUPR3, 22 }, /* ETH_TXD0 */ 3026 - [RCAR_GP_PIN(4, 11)] = { PUPR3, 23 }, /* ETH_TXD1 */ 3027 - [RCAR_GP_PIN(4, 12)] = { PUPR3, 24 }, /* ETH_CRS_DV */ 3028 - [RCAR_GP_PIN(4, 13)] = { PUPR3, 25 }, /* ETH_TX_EN */ 3029 - [RCAR_GP_PIN(4, 14)] = { PUPR3, 26 }, /* ETH_RX_ER */ 3030 - [RCAR_GP_PIN(4, 15)] = { PUPR3, 27 }, /* ETH_RXD0 */ 3031 - [RCAR_GP_PIN(4, 16)] = { PUPR3, 28 }, /* ETH_RXD1 */ 3032 - [RCAR_GP_PIN(4, 17)] = { PUPR3, 29 }, /* ETH_MDC */ 3033 - [RCAR_GP_PIN(4, 18)] = { PUPR3, 30 }, /* ETH_MDIO */ 3034 - [RCAR_GP_PIN(4, 19)] = { PUPR3, 31 }, /* ETH_LINK */ 2999 + { RCAR_GP_PIN(3, 24), PUPR3, 0 }, /* VI0_CLK */ 3000 + { RCAR_GP_PIN(3, 25), PUPR3, 1 }, /* VI0_CLKENB */ 3001 + { RCAR_GP_PIN(3, 26), PUPR3, 2 }, /* VI0_FIELD */ 3002 + { RCAR_GP_PIN(3, 27), PUPR3, 3 }, /* /VI0_HSYNC */ 3003 + { RCAR_GP_PIN(3, 28), PUPR3, 4 }, /* /VI0_VSYNC */ 3004 + { RCAR_GP_PIN(3, 29), PUPR3, 5 }, /* VI0_DATA0 */ 3005 + { RCAR_GP_PIN(3, 30), PUPR3, 6 }, /* VI0_DATA1 */ 3006 + { RCAR_GP_PIN(3, 31), PUPR3, 7 }, /* VI0_DATA2 */ 3007 + { RCAR_GP_PIN(4, 0), PUPR3, 8 }, /* VI0_DATA3 */ 3008 + { RCAR_GP_PIN(4, 1), PUPR3, 9 }, /* VI0_DATA4 */ 3009 + { RCAR_GP_PIN(4, 2), PUPR3, 10 }, /* VI0_DATA5 */ 3010 + { RCAR_GP_PIN(4, 3), PUPR3, 11 }, /* VI0_DATA6 */ 3011 + { RCAR_GP_PIN(4, 4), PUPR3, 12 }, /* VI0_DATA7 */ 3012 + { RCAR_GP_PIN(4, 5), PUPR3, 13 }, /* VI0_G2 */ 3013 + { RCAR_GP_PIN(4, 6), PUPR3, 14 }, /* VI0_G3 */ 3014 + { RCAR_GP_PIN(4, 7), PUPR3, 15 }, /* VI0_G4 */ 3015 + { RCAR_GP_PIN(4, 8), PUPR3, 16 }, /* VI0_G5 */ 3016 + { RCAR_GP_PIN(4, 21), PUPR3, 17 }, /* VI1_DATA12 */ 3017 + { RCAR_GP_PIN(4, 22), PUPR3, 18 }, /* VI1_DATA13 */ 3018 + { RCAR_GP_PIN(4, 23), PUPR3, 19 }, /* VI1_DATA14 */ 3019 + { RCAR_GP_PIN(4, 24), PUPR3, 20 }, /* VI1_DATA15 */ 3020 + { RCAR_GP_PIN(4, 9), PUPR3, 21 }, /* ETH_REF_CLK */ 3021 + { RCAR_GP_PIN(4, 10), PUPR3, 22 }, /* ETH_TXD0 */ 3022 + { RCAR_GP_PIN(4, 11), PUPR3, 23 }, /* ETH_TXD1 */ 3023 + { RCAR_GP_PIN(4, 12), PUPR3, 24 }, /* ETH_CRS_DV */ 3024 + { RCAR_GP_PIN(4, 13), PUPR3, 25 }, /* ETH_TX_EN */ 3025 + { RCAR_GP_PIN(4, 14), PUPR3, 26 }, /* ETH_RX_ER */ 3026 + { RCAR_GP_PIN(4, 15), PUPR3, 27 }, /* ETH_RXD0 */ 3027 + { RCAR_GP_PIN(4, 16), PUPR3, 28 }, /* ETH_RXD1 */ 3028 + { RCAR_GP_PIN(4, 17), PUPR3, 29 }, /* ETH_MDC */ 3029 + { RCAR_GP_PIN(4, 18), PUPR3, 30 }, /* ETH_MDIO */ 3030 + { RCAR_GP_PIN(4, 19), PUPR3, 31 }, /* ETH_LINK */ 3035 3031 3036 - [RCAR_GP_PIN(3, 6)] = { PUPR4, 0 }, /* SSI_SCK012 */ 3037 - [RCAR_GP_PIN(3, 7)] = { PUPR4, 1 }, /* SSI_WS012 */ 3038 - [RCAR_GP_PIN(3, 10)] = { PUPR4, 2 }, /* SSI_SDATA0 */ 3039 - [RCAR_GP_PIN(3, 9)] = { PUPR4, 3 }, /* SSI_SDATA1 */ 3040 - [RCAR_GP_PIN(3, 8)] = { PUPR4, 4 }, /* SSI_SDATA2 */ 3041 - [RCAR_GP_PIN(3, 2)] = { PUPR4, 5 }, /* SSI_SCK34 */ 3042 - [RCAR_GP_PIN(3, 3)] = { PUPR4, 6 }, /* SSI_WS34 */ 3043 - [RCAR_GP_PIN(3, 5)] = { PUPR4, 7 }, /* SSI_SDATA3 */ 3044 - [RCAR_GP_PIN(3, 4)] = { PUPR4, 8 }, /* SSI_SDATA4 */ 3045 - [RCAR_GP_PIN(2, 31)] = { PUPR4, 9 }, /* SSI_SCK5 */ 3046 - [RCAR_GP_PIN(3, 0)] = { PUPR4, 10 }, /* SSI_WS5 */ 3047 - [RCAR_GP_PIN(3, 1)] = { PUPR4, 11 }, /* SSI_SDATA5 */ 3048 - [RCAR_GP_PIN(2, 28)] = { PUPR4, 12 }, /* SSI_SCK6 */ 3049 - [RCAR_GP_PIN(2, 29)] = { PUPR4, 13 }, /* SSI_WS6 */ 3050 - [RCAR_GP_PIN(2, 30)] = { PUPR4, 14 }, /* SSI_SDATA6 */ 3051 - [RCAR_GP_PIN(2, 24)] = { PUPR4, 15 }, /* SSI_SCK78 */ 3052 - [RCAR_GP_PIN(2, 25)] = { PUPR4, 16 }, /* SSI_WS78 */ 3053 - [RCAR_GP_PIN(2, 27)] = { PUPR4, 17 }, /* SSI_SDATA7 */ 3054 - [RCAR_GP_PIN(2, 26)] = { PUPR4, 18 }, /* SSI_SDATA8 */ 3055 - [RCAR_GP_PIN(3, 23)] = { PUPR4, 19 }, /* TCLK0 */ 3056 - [RCAR_GP_PIN(3, 11)] = { PUPR4, 20 }, /* SD0_CLK */ 3057 - [RCAR_GP_PIN(3, 12)] = { PUPR4, 21 }, /* SD0_CMD */ 3058 - [RCAR_GP_PIN(3, 13)] = { PUPR4, 22 }, /* SD0_DAT0 */ 3059 - [RCAR_GP_PIN(3, 14)] = { PUPR4, 23 }, /* SD0_DAT1 */ 3060 - [RCAR_GP_PIN(3, 15)] = { PUPR4, 24 }, /* SD0_DAT2 */ 3061 - [RCAR_GP_PIN(3, 16)] = { PUPR4, 25 }, /* SD0_DAT3 */ 3062 - [RCAR_GP_PIN(3, 17)] = { PUPR4, 26 }, /* SD0_CD */ 3063 - [RCAR_GP_PIN(3, 18)] = { PUPR4, 27 }, /* SD0_WP */ 3064 - [RCAR_GP_PIN(2, 22)] = { PUPR4, 28 }, /* AUDIO_CLKA */ 3065 - [RCAR_GP_PIN(2, 23)] = { PUPR4, 29 }, /* AUDIO_CLKB */ 3066 - [RCAR_GP_PIN(1, 14)] = { PUPR4, 30 }, /* IRQ2 */ 3067 - [RCAR_GP_PIN(1, 15)] = { PUPR4, 31 }, /* IRQ3 */ 3032 + { RCAR_GP_PIN(3, 6), PUPR4, 0 }, /* SSI_SCK012 */ 3033 + { RCAR_GP_PIN(3, 7), PUPR4, 1 }, /* SSI_WS012 */ 3034 + { RCAR_GP_PIN(3, 10), PUPR4, 2 }, /* SSI_SDATA0 */ 3035 + { RCAR_GP_PIN(3, 9), PUPR4, 3 }, /* SSI_SDATA1 */ 3036 + { RCAR_GP_PIN(3, 8), PUPR4, 4 }, /* SSI_SDATA2 */ 3037 + { RCAR_GP_PIN(3, 2), PUPR4, 5 }, /* SSI_SCK34 */ 3038 + { RCAR_GP_PIN(3, 3), PUPR4, 6 }, /* SSI_WS34 */ 3039 + { RCAR_GP_PIN(3, 5), PUPR4, 7 }, /* SSI_SDATA3 */ 3040 + { RCAR_GP_PIN(3, 4), PUPR4, 8 }, /* SSI_SDATA4 */ 3041 + { RCAR_GP_PIN(2, 31), PUPR4, 9 }, /* SSI_SCK5 */ 3042 + { RCAR_GP_PIN(3, 0), PUPR4, 10 }, /* SSI_WS5 */ 3043 + { RCAR_GP_PIN(3, 1), PUPR4, 11 }, /* SSI_SDATA5 */ 3044 + { RCAR_GP_PIN(2, 28), PUPR4, 12 }, /* SSI_SCK6 */ 3045 + { RCAR_GP_PIN(2, 29), PUPR4, 13 }, /* SSI_WS6 */ 3046 + { RCAR_GP_PIN(2, 30), PUPR4, 14 }, /* SSI_SDATA6 */ 3047 + { RCAR_GP_PIN(2, 24), PUPR4, 15 }, /* SSI_SCK78 */ 3048 + { RCAR_GP_PIN(2, 25), PUPR4, 16 }, /* SSI_WS78 */ 3049 + { RCAR_GP_PIN(2, 27), PUPR4, 17 }, /* SSI_SDATA7 */ 3050 + { RCAR_GP_PIN(2, 26), PUPR4, 18 }, /* SSI_SDATA8 */ 3051 + { RCAR_GP_PIN(3, 23), PUPR4, 19 }, /* TCLK0 */ 3052 + { RCAR_GP_PIN(3, 11), PUPR4, 20 }, /* SD0_CLK */ 3053 + { RCAR_GP_PIN(3, 12), PUPR4, 21 }, /* SD0_CMD */ 3054 + { RCAR_GP_PIN(3, 13), PUPR4, 22 }, /* SD0_DAT0 */ 3055 + { RCAR_GP_PIN(3, 14), PUPR4, 23 }, /* SD0_DAT1 */ 3056 + { RCAR_GP_PIN(3, 15), PUPR4, 24 }, /* SD0_DAT2 */ 3057 + { RCAR_GP_PIN(3, 16), PUPR4, 25 }, /* SD0_DAT3 */ 3058 + { RCAR_GP_PIN(3, 17), PUPR4, 26 }, /* SD0_CD */ 3059 + { RCAR_GP_PIN(3, 18), PUPR4, 27 }, /* SD0_WP */ 3060 + { RCAR_GP_PIN(2, 22), PUPR4, 28 }, /* AUDIO_CLKA */ 3061 + { RCAR_GP_PIN(2, 23), PUPR4, 29 }, /* AUDIO_CLKB */ 3062 + { RCAR_GP_PIN(1, 14), PUPR4, 30 }, /* IRQ2 */ 3063 + { RCAR_GP_PIN(1, 15), PUPR4, 31 }, /* IRQ3 */ 3068 3064 3069 - [RCAR_GP_PIN(0, 1)] = { PUPR5, 0 }, /* PENC0 */ 3070 - [RCAR_GP_PIN(0, 2)] = { PUPR5, 1 }, /* PENC1 */ 3071 - [RCAR_GP_PIN(0, 3)] = { PUPR5, 2 }, /* USB_OVC0 */ 3072 - [RCAR_GP_PIN(0, 4)] = { PUPR5, 3 }, /* USB_OVC1 */ 3073 - [RCAR_GP_PIN(1, 16)] = { PUPR5, 4 }, /* SCIF_CLK */ 3074 - [RCAR_GP_PIN(1, 17)] = { PUPR5, 5 }, /* TX0 */ 3075 - [RCAR_GP_PIN(1, 18)] = { PUPR5, 6 }, /* RX0 */ 3076 - [RCAR_GP_PIN(1, 19)] = { PUPR5, 7 }, /* SCK0 */ 3077 - [RCAR_GP_PIN(1, 20)] = { PUPR5, 8 }, /* /CTS0 */ 3078 - [RCAR_GP_PIN(1, 21)] = { PUPR5, 9 }, /* /RTS0 */ 3079 - [RCAR_GP_PIN(3, 19)] = { PUPR5, 10 }, /* HSPI_CLK0 */ 3080 - [RCAR_GP_PIN(3, 20)] = { PUPR5, 11 }, /* /HSPI_CS0 */ 3081 - [RCAR_GP_PIN(3, 21)] = { PUPR5, 12 }, /* HSPI_RX0 */ 3082 - [RCAR_GP_PIN(3, 22)] = { PUPR5, 13 }, /* HSPI_TX0 */ 3083 - [RCAR_GP_PIN(4, 20)] = { PUPR5, 14 }, /* ETH_MAGIC */ 3084 - [RCAR_GP_PIN(4, 25)] = { PUPR5, 15 }, /* AVS1 */ 3085 - [RCAR_GP_PIN(4, 26)] = { PUPR5, 16 }, /* AVS2 */ 3065 + { RCAR_GP_PIN(0, 1), PUPR5, 0 }, /* PENC0 */ 3066 + { RCAR_GP_PIN(0, 2), PUPR5, 1 }, /* PENC1 */ 3067 + { RCAR_GP_PIN(0, 3), PUPR5, 2 }, /* USB_OVC0 */ 3068 + { RCAR_GP_PIN(0, 4), PUPR5, 3 }, /* USB_OVC1 */ 3069 + { RCAR_GP_PIN(1, 16), PUPR5, 4 }, /* SCIF_CLK */ 3070 + { RCAR_GP_PIN(1, 17), PUPR5, 5 }, /* TX0 */ 3071 + { RCAR_GP_PIN(1, 18), PUPR5, 6 }, /* RX0 */ 3072 + { RCAR_GP_PIN(1, 19), PUPR5, 7 }, /* SCK0 */ 3073 + { RCAR_GP_PIN(1, 20), PUPR5, 8 }, /* /CTS0 */ 3074 + { RCAR_GP_PIN(1, 21), PUPR5, 9 }, /* /RTS0 */ 3075 + { RCAR_GP_PIN(3, 19), PUPR5, 10 }, /* HSPI_CLK0 */ 3076 + { RCAR_GP_PIN(3, 20), PUPR5, 11 }, /* /HSPI_CS0 */ 3077 + { RCAR_GP_PIN(3, 21), PUPR5, 12 }, /* HSPI_RX0 */ 3078 + { RCAR_GP_PIN(3, 22), PUPR5, 13 }, /* HSPI_TX0 */ 3079 + { RCAR_GP_PIN(4, 20), PUPR5, 14 }, /* ETH_MAGIC */ 3080 + { RCAR_GP_PIN(4, 25), PUPR5, 15 }, /* AVS1 */ 3081 + { RCAR_GP_PIN(4, 26), PUPR5, 16 }, /* AVS2 */ 3086 3082 }; 3087 3083 3088 3084 static unsigned int r8a7778_pinmux_get_bias(struct sh_pfc *pfc, 3089 3085 unsigned int pin) 3090 3086 { 3087 + const struct sh_pfc_bias_info *info; 3091 3088 void __iomem *addr; 3092 3089 3093 - if (WARN_ON_ONCE(!pullups[pin].reg)) 3090 + info = sh_pfc_pin_to_bias_info(bias_info, ARRAY_SIZE(bias_info), pin); 3091 + if (!info) 3094 3092 return PIN_CONFIG_BIAS_DISABLE; 3095 3093 3096 - addr = pfc->windows->virt + pullups[pin].reg; 3094 + addr = pfc->windows->virt + info->reg; 3097 3095 3098 - if (ioread32(addr) & BIT(pullups[pin].bit)) 3096 + if (ioread32(addr) & BIT(info->bit)) 3099 3097 return PIN_CONFIG_BIAS_PULL_UP; 3100 3098 else 3101 3099 return PIN_CONFIG_BIAS_DISABLE; ··· 3103 3103 static void r8a7778_pinmux_set_bias(struct sh_pfc *pfc, unsigned int pin, 3104 3104 unsigned int bias) 3105 3105 { 3106 + const struct sh_pfc_bias_info *info; 3106 3107 void __iomem *addr; 3107 3108 u32 value; 3108 3109 u32 bit; 3109 3110 3110 - if (WARN_ON_ONCE(!pullups[pin].reg)) 3111 + info = sh_pfc_pin_to_bias_info(bias_info, ARRAY_SIZE(bias_info), pin); 3112 + if (!info) 3111 3113 return; 3112 3114 3113 - addr = pfc->windows->virt + pullups[pin].reg; 3114 - bit = BIT(pullups[pin].bit); 3115 + addr = pfc->windows->virt + info->reg; 3116 + bit = BIT(info->bit); 3115 3117 3116 3118 value = ioread32(addr) & ~bit; 3117 3119 if (bias == PIN_CONFIG_BIAS_PULL_UP)
+415 -189
drivers/pinctrl/sh-pfc/pfc-r8a7795.c
··· 523 523 MOD_SEL1_1 \ 524 524 MOD_SEL1_0 MOD_SEL2_0 525 525 526 + /* 527 + * These pins are not able to be muxed but have other properties 528 + * that can be set, such as drive-strength or pull-up/pull-down enable. 529 + */ 530 + #define PINMUX_STATIC \ 531 + FM(QSPI0_SPCLK) FM(QSPI0_SSL) FM(QSPI0_MOSI_IO0) FM(QSPI0_MISO_IO1) \ 532 + FM(QSPI0_IO2) FM(QSPI0_IO3) \ 533 + FM(QSPI1_SPCLK) FM(QSPI1_SSL) FM(QSPI1_MOSI_IO0) FM(QSPI1_MISO_IO1) \ 534 + FM(QSPI1_IO2) FM(QSPI1_IO3) \ 535 + FM(RPC_INT) FM(RPC_WP) FM(RPC_RESET) \ 536 + FM(AVB_TX_CTL) FM(AVB_TXC) FM(AVB_TD0) FM(AVB_TD1) FM(AVB_TD2) FM(AVB_TD3) \ 537 + FM(AVB_RX_CTL) FM(AVB_RXC) FM(AVB_RD0) FM(AVB_RD1) FM(AVB_RD2) FM(AVB_RD3) \ 538 + FM(AVB_TXCREFCLK) FM(AVB_MDIO) \ 539 + FM(CLKOUT) FM(PRESETOUT) \ 540 + FM(DU_DOTCLKIN0) FM(DU_DOTCLKIN1) FM(DU_DOTCLKIN2) FM(DU_DOTCLKIN3) \ 541 + FM(TMS) FM(TDO) FM(ASEBRK) FM(MLB_REF) 526 542 527 543 enum { 528 544 PINMUX_RESERVED = 0, ··· 564 548 PINMUX_GPSR 565 549 PINMUX_IPSR 566 550 PINMUX_MOD_SELS 551 + PINMUX_STATIC 567 552 PINMUX_MARK_END, 568 553 #undef F_ 569 554 #undef FM ··· 1429 1412 PINMUX_IPSR_MSEL(IP17_7_4, STP_ISSYNC_0_E, SEL_SSP1_0_4), 1430 1413 PINMUX_IPSR_MSEL(IP17_7_4, RIF2_D1_B, SEL_DRIF2_1), 1431 1414 PINMUX_IPSR_GPSR(IP17_7_4, TPU0TO3), 1415 + 1416 + /* 1417 + * Static pins can not be muxed between different functions but 1418 + * still needs a mark entry in the pinmux list. Add each static 1419 + * pin to the list without an associated function. The sh-pfc 1420 + * core will do the right thing and skip trying to mux then pin 1421 + * while still applying configuration to it 1422 + */ 1423 + #define FM(x) PINMUX_DATA(x##_MARK, 0), 1424 + PINMUX_STATIC 1425 + #undef FM 1432 1426 }; 1427 + 1428 + /* 1429 + * R8A7795 has 8 banks with 32 PGIOS in each => 256 GPIOs. 1430 + * Physical layout rows: A - AW, cols: 1 - 39. 1431 + */ 1432 + #define ROW_GROUP_A(r) ('Z' - 'A' + 1 + (r)) 1433 + #define PIN_NUMBER(r, c) (((r) - 'A') * 39 + (c) + 300) 1434 + #define PIN_A_NUMBER(r, c) PIN_NUMBER(ROW_GROUP_A(r), c) 1433 1435 1434 1436 static const struct sh_pfc_pin pinmux_pins[] = { 1435 1437 PINMUX_GPIO_GP_ALL(), 1438 + 1439 + /* 1440 + * Pins not associated with a GPIO port. 1441 + * 1442 + * The pin positions are different between different r8a7795 1443 + * packages, all that is needed for the pfc driver is a unique 1444 + * number for each pin. To this end use the pin layout from 1445 + * R-Car H3SiP to calculate a unique number for each pin. 1446 + */ 1447 + SH_PFC_PIN_NAMED_CFG('A', 8, AVB_TX_CTL, SH_PFC_PIN_CFG_DRIVE_STRENGTH), 1448 + SH_PFC_PIN_NAMED_CFG('A', 9, AVB_MDIO, SH_PFC_PIN_CFG_DRIVE_STRENGTH), 1449 + SH_PFC_PIN_NAMED_CFG('A', 12, AVB_TXCREFCLK, SH_PFC_PIN_CFG_DRIVE_STRENGTH), 1450 + SH_PFC_PIN_NAMED_CFG('A', 13, AVB_RD0, SH_PFC_PIN_CFG_DRIVE_STRENGTH), 1451 + SH_PFC_PIN_NAMED_CFG('A', 14, AVB_RD2, SH_PFC_PIN_CFG_DRIVE_STRENGTH), 1452 + SH_PFC_PIN_NAMED_CFG('A', 16, AVB_RX_CTL, SH_PFC_PIN_CFG_DRIVE_STRENGTH), 1453 + SH_PFC_PIN_NAMED_CFG('A', 17, AVB_TD2, SH_PFC_PIN_CFG_DRIVE_STRENGTH), 1454 + SH_PFC_PIN_NAMED_CFG('A', 18, AVB_TD0, SH_PFC_PIN_CFG_DRIVE_STRENGTH), 1455 + SH_PFC_PIN_NAMED_CFG('A', 19, AVB_TXC, SH_PFC_PIN_CFG_DRIVE_STRENGTH), 1456 + SH_PFC_PIN_NAMED_CFG('B', 13, AVB_RD1, SH_PFC_PIN_CFG_DRIVE_STRENGTH), 1457 + SH_PFC_PIN_NAMED_CFG('B', 14, AVB_RD3, SH_PFC_PIN_CFG_DRIVE_STRENGTH), 1458 + SH_PFC_PIN_NAMED_CFG('B', 17, AVB_TD3, SH_PFC_PIN_CFG_DRIVE_STRENGTH), 1459 + SH_PFC_PIN_NAMED_CFG('B', 18, AVB_TD1, SH_PFC_PIN_CFG_DRIVE_STRENGTH), 1460 + SH_PFC_PIN_NAMED_CFG('B', 19, AVB_RXC, SH_PFC_PIN_CFG_DRIVE_STRENGTH), 1461 + SH_PFC_PIN_NAMED_CFG('C', 1, PRESETOUT#, SH_PFC_PIN_CFG_DRIVE_STRENGTH), 1462 + SH_PFC_PIN_NAMED_CFG('F', 1, CLKOUT, SH_PFC_PIN_CFG_DRIVE_STRENGTH), 1463 + SH_PFC_PIN_NAMED_CFG('H', 37, MLB_REF, SH_PFC_PIN_CFG_DRIVE_STRENGTH), 1464 + SH_PFC_PIN_NAMED_CFG('V', 3, QSPI1_SPCLK, SH_PFC_PIN_CFG_DRIVE_STRENGTH), 1465 + SH_PFC_PIN_NAMED_CFG('V', 5, QSPI1_SSL, SH_PFC_PIN_CFG_DRIVE_STRENGTH), 1466 + SH_PFC_PIN_NAMED_CFG('V', 6, RPC_WP#, SH_PFC_PIN_CFG_DRIVE_STRENGTH), 1467 + SH_PFC_PIN_NAMED_CFG('V', 7, RPC_RESET#, SH_PFC_PIN_CFG_DRIVE_STRENGTH), 1468 + SH_PFC_PIN_NAMED_CFG('W', 3, QSPI0_SPCLK, SH_PFC_PIN_CFG_DRIVE_STRENGTH), 1469 + SH_PFC_PIN_NAMED_CFG('Y', 3, QSPI0_SSL, SH_PFC_PIN_CFG_DRIVE_STRENGTH), 1470 + SH_PFC_PIN_NAMED_CFG('Y', 6, QSPI0_IO2, SH_PFC_PIN_CFG_DRIVE_STRENGTH), 1471 + SH_PFC_PIN_NAMED_CFG('Y', 7, RPC_INT#, SH_PFC_PIN_CFG_DRIVE_STRENGTH), 1472 + SH_PFC_PIN_NAMED_CFG(ROW_GROUP_A('B'), 4, QSPI0_MISO_IO1, SH_PFC_PIN_CFG_DRIVE_STRENGTH), 1473 + SH_PFC_PIN_NAMED_CFG(ROW_GROUP_A('B'), 6, QSPI0_IO3, SH_PFC_PIN_CFG_DRIVE_STRENGTH), 1474 + SH_PFC_PIN_NAMED_CFG(ROW_GROUP_A('C'), 3, QSPI1_IO3, SH_PFC_PIN_CFG_DRIVE_STRENGTH), 1475 + SH_PFC_PIN_NAMED_CFG(ROW_GROUP_A('C'), 5, QSPI0_MOSI_IO0, SH_PFC_PIN_CFG_DRIVE_STRENGTH), 1476 + SH_PFC_PIN_NAMED_CFG(ROW_GROUP_A('C'), 7, QSPI1_MOSI_IO0, SH_PFC_PIN_CFG_DRIVE_STRENGTH), 1477 + SH_PFC_PIN_NAMED_CFG(ROW_GROUP_A('D'), 38, FSCLKST#, SH_PFC_PIN_CFG_DRIVE_STRENGTH), 1478 + SH_PFC_PIN_NAMED_CFG(ROW_GROUP_A('E'), 4, QSPI1_IO2, SH_PFC_PIN_CFG_DRIVE_STRENGTH), 1479 + SH_PFC_PIN_NAMED_CFG(ROW_GROUP_A('E'), 5, QSPI1_MISO_IO1, SH_PFC_PIN_CFG_DRIVE_STRENGTH), 1480 + SH_PFC_PIN_NAMED_CFG(ROW_GROUP_A('P'), 7, DU_DOTCLKIN0, SH_PFC_PIN_CFG_DRIVE_STRENGTH), 1481 + SH_PFC_PIN_NAMED_CFG(ROW_GROUP_A('P'), 8, DU_DOTCLKIN1, SH_PFC_PIN_CFG_DRIVE_STRENGTH), 1482 + SH_PFC_PIN_NAMED_CFG(ROW_GROUP_A('R'), 7, DU_DOTCLKIN2, SH_PFC_PIN_CFG_DRIVE_STRENGTH), 1483 + SH_PFC_PIN_NAMED_CFG(ROW_GROUP_A('R'), 8, DU_DOTCLKIN3, SH_PFC_PIN_CFG_DRIVE_STRENGTH), 1484 + SH_PFC_PIN_NAMED_CFG(ROW_GROUP_A('R'), 30, TMS, SH_PFC_PIN_CFG_DRIVE_STRENGTH), 1485 + SH_PFC_PIN_NAMED_CFG(ROW_GROUP_A('T'), 28, TDO, SH_PFC_PIN_CFG_DRIVE_STRENGTH), 1486 + SH_PFC_PIN_NAMED_CFG(ROW_GROUP_A('T'), 30, ASEBRK, SH_PFC_PIN_CFG_DRIVE_STRENGTH), 1436 1487 }; 1437 1488 1438 1489 /* - AUDIO CLOCK ------------------------------------------------------------ */ ··· 1648 1563 AVB_PHY_INT_MARK, 1649 1564 }; 1650 1565 static const unsigned int avb_mdc_pins[] = { 1651 - /* AVB_MDC */ 1652 - RCAR_GP_PIN(2, 9), 1566 + /* AVB_MDC, AVB_MDIO */ 1567 + RCAR_GP_PIN(2, 9), PIN_NUMBER('A', 9), 1653 1568 }; 1654 1569 static const unsigned int avb_mdc_mux[] = { 1655 - AVB_MDC_MARK, 1570 + AVB_MDC_MARK, AVB_MDIO_MARK, 1571 + }; 1572 + static const unsigned int avb_mii_pins[] = { 1573 + /* 1574 + * AVB_TX_CTL, AVB_TXC, AVB_TD0, 1575 + * AVB_TD1, AVB_TD2, AVB_TD3, 1576 + * AVB_RX_CTL, AVB_RXC, AVB_RD0, 1577 + * AVB_RD1, AVB_RD2, AVB_RD3, 1578 + * AVB_TXCREFCLK 1579 + */ 1580 + PIN_NUMBER('A', 8), PIN_NUMBER('A', 19), PIN_NUMBER('A', 18), 1581 + PIN_NUMBER('B', 18), PIN_NUMBER('A', 17), PIN_NUMBER('B', 17), 1582 + PIN_NUMBER('A', 16), PIN_NUMBER('B', 19), PIN_NUMBER('A', 13), 1583 + PIN_NUMBER('B', 13), PIN_NUMBER('A', 14), PIN_NUMBER('B', 14), 1584 + PIN_NUMBER('A', 12), 1585 + 1586 + }; 1587 + static const unsigned int avb_mii_mux[] = { 1588 + AVB_TX_CTL_MARK, AVB_TXC_MARK, AVB_TD0_MARK, 1589 + AVB_TD1_MARK, AVB_TD2_MARK, AVB_TD3_MARK, 1590 + AVB_RX_CTL_MARK, AVB_RXC_MARK, AVB_RD0_MARK, 1591 + AVB_RD1_MARK, AVB_RD2_MARK, AVB_RD3_MARK, 1592 + AVB_TXCREFCLK_MARK, 1656 1593 }; 1657 1594 static const unsigned int avb_avtp_pps_pins[] = { 1658 1595 /* AVB_AVTP_PPS */ ··· 3720 3613 USB2_PWEN_MARK, USB2_OVC_MARK, 3721 3614 }; 3722 3615 3616 + /* - QSPI0 ------------------------------------------------------------------ */ 3617 + static const unsigned int qspi0_ctrl_pins[] = { 3618 + /* QSPI0_SPCLK, QSPI0_SSL */ 3619 + PIN_NUMBER('W', 3), PIN_NUMBER('Y', 3), 3620 + }; 3621 + static const unsigned int qspi0_ctrl_mux[] = { 3622 + QSPI0_SPCLK_MARK, QSPI0_SSL_MARK, 3623 + }; 3624 + static const unsigned int qspi0_data2_pins[] = { 3625 + /* QSPI0_MOSI_IO0, QSPI0_MISO_IO1 */ 3626 + PIN_A_NUMBER('C', 5), PIN_A_NUMBER('B', 4), 3627 + }; 3628 + static const unsigned int qspi0_data2_mux[] = { 3629 + QSPI0_MOSI_IO0_MARK, QSPI0_MISO_IO1_MARK, 3630 + }; 3631 + static const unsigned int qspi0_data4_pins[] = { 3632 + /* QSPI0_MOSI_IO0, QSPI0_MISO_IO1, QSPI0_IO2, QSPI0_IO3 */ 3633 + PIN_A_NUMBER('C', 5), PIN_A_NUMBER('B', 4), 3634 + PIN_NUMBER('Y', 6), PIN_A_NUMBER('B', 6), 3635 + }; 3636 + static const unsigned int qspi0_data4_mux[] = { 3637 + QSPI0_MOSI_IO0_MARK, QSPI0_MISO_IO1_MARK, 3638 + QSPI0_IO2_MARK, QSPI0_IO3_MARK, 3639 + }; 3640 + /* - QSPI1 ------------------------------------------------------------------ */ 3641 + static const unsigned int qspi1_ctrl_pins[] = { 3642 + /* QSPI1_SPCLK, QSPI1_SSL */ 3643 + PIN_NUMBER('V', 3), PIN_NUMBER('V', 5), 3644 + }; 3645 + static const unsigned int qspi1_ctrl_mux[] = { 3646 + QSPI1_SPCLK_MARK, QSPI1_SSL_MARK, 3647 + }; 3648 + static const unsigned int qspi1_data2_pins[] = { 3649 + /* QSPI1_MOSI_IO0, QSPI1_MISO_IO1 */ 3650 + PIN_A_NUMBER('C', 7), PIN_A_NUMBER('E', 5), 3651 + }; 3652 + static const unsigned int qspi1_data2_mux[] = { 3653 + QSPI1_MOSI_IO0_MARK, QSPI1_MISO_IO1_MARK, 3654 + }; 3655 + static const unsigned int qspi1_data4_pins[] = { 3656 + /* QSPI1_MOSI_IO0, QSPI1_MISO_IO1, QSPI1_IO2, QSPI1_IO3 */ 3657 + PIN_A_NUMBER('C', 7), PIN_A_NUMBER('E', 5), 3658 + PIN_A_NUMBER('E', 4), PIN_A_NUMBER('C', 3), 3659 + }; 3660 + static const unsigned int qspi1_data4_mux[] = { 3661 + QSPI1_MOSI_IO0_MARK, QSPI1_MISO_IO1_MARK, 3662 + QSPI1_IO2_MARK, QSPI1_IO3_MARK, 3663 + }; 3664 + 3723 3665 static const struct sh_pfc_pin_group pinmux_groups[] = { 3724 3666 SH_PFC_PIN_GROUP(audio_clk_a_a), 3725 3667 SH_PFC_PIN_GROUP(audio_clk_a_b), ··· 3791 3635 SH_PFC_PIN_GROUP(avb_magic), 3792 3636 SH_PFC_PIN_GROUP(avb_phy_int), 3793 3637 SH_PFC_PIN_GROUP(avb_mdc), 3638 + SH_PFC_PIN_GROUP(avb_mii), 3794 3639 SH_PFC_PIN_GROUP(avb_avtp_pps), 3795 3640 SH_PFC_PIN_GROUP(avb_avtp_match_a), 3796 3641 SH_PFC_PIN_GROUP(avb_avtp_capture_a), ··· 4069 3912 SH_PFC_PIN_GROUP(usb0), 4070 3913 SH_PFC_PIN_GROUP(usb1), 4071 3914 SH_PFC_PIN_GROUP(usb2), 3915 + SH_PFC_PIN_GROUP(qspi0_ctrl), 3916 + SH_PFC_PIN_GROUP(qspi0_data2), 3917 + SH_PFC_PIN_GROUP(qspi0_data4), 3918 + SH_PFC_PIN_GROUP(qspi1_ctrl), 3919 + SH_PFC_PIN_GROUP(qspi1_data2), 3920 + SH_PFC_PIN_GROUP(qspi1_data4), 4072 3921 }; 4073 3922 4074 3923 static const char * const audio_clk_groups[] = { ··· 4102 3939 "avb_magic", 4103 3940 "avb_phy_int", 4104 3941 "avb_mdc", 3942 + "avb_mii", 4105 3943 "avb_avtp_pps", 4106 3944 "avb_avtp_match_a", 4107 3945 "avb_avtp_capture_a", ··· 4520 4356 "usb2", 4521 4357 }; 4522 4358 4359 + static const char * const qspi0_groups[] = { 4360 + "qspi0_ctrl", 4361 + "qspi0_data2", 4362 + "qspi0_data4", 4363 + }; 4364 + 4365 + static const char * const qspi1_groups[] = { 4366 + "qspi1_ctrl", 4367 + "qspi1_data2", 4368 + "qspi1_data4", 4369 + }; 4370 + 4523 4371 static const struct sh_pfc_function pinmux_functions[] = { 4524 4372 SH_PFC_FUNCTION(audio_clk), 4525 4373 SH_PFC_FUNCTION(avb), ··· 4581 4405 SH_PFC_FUNCTION(usb0), 4582 4406 SH_PFC_FUNCTION(usb1), 4583 4407 SH_PFC_FUNCTION(usb2), 4408 + SH_PFC_FUNCTION(qspi0), 4409 + SH_PFC_FUNCTION(qspi1), 4584 4410 }; 4585 4411 4586 4412 static const struct pinmux_cfg_reg pinmux_config_regs[] = { ··· 5140 4962 }; 5141 4963 5142 4964 static const struct pinmux_drive_reg pinmux_drive_regs[] = { 4965 + { PINMUX_DRIVE_REG("DRVCTRL0", 0xe6060300) { 4966 + { PIN_NUMBER('W', 3), 28, 2 }, /* QSPI0_SPCLK */ 4967 + { PIN_A_NUMBER('C', 5), 24, 2 }, /* QSPI0_MOSI_IO0 */ 4968 + { PIN_A_NUMBER('B', 4), 20, 2 }, /* QSPI0_MISO_IO1 */ 4969 + { PIN_NUMBER('Y', 6), 16, 2 }, /* QSPI0_IO2 */ 4970 + { PIN_A_NUMBER('B', 6), 12, 2 }, /* QSPI0_IO3 */ 4971 + { PIN_NUMBER('Y', 3), 8, 2 }, /* QSPI0_SSL */ 4972 + { PIN_NUMBER('V', 3), 4, 2 }, /* QSPI1_SPCLK */ 4973 + { PIN_A_NUMBER('C', 7), 0, 2 }, /* QSPI1_MOSI_IO0 */ 4974 + } }, 4975 + { PINMUX_DRIVE_REG("DRVCTRL1", 0xe6060304) { 4976 + { PIN_A_NUMBER('E', 5), 28, 2 }, /* QSPI1_MISO_IO1 */ 4977 + { PIN_A_NUMBER('E', 4), 24, 2 }, /* QSPI1_IO2 */ 4978 + { PIN_A_NUMBER('C', 3), 20, 2 }, /* QSPI1_IO3 */ 4979 + { PIN_NUMBER('V', 5), 16, 2 }, /* QSPI1_SSL */ 4980 + { PIN_NUMBER('Y', 7), 12, 2 }, /* RPC_INT# */ 4981 + { PIN_NUMBER('V', 6), 8, 2 }, /* RPC_WP# */ 4982 + { PIN_NUMBER('V', 7), 4, 2 }, /* RPC_RESET# */ 4983 + { PIN_NUMBER('A', 16), 0, 3 }, /* AVB_RX_CTL */ 4984 + } }, 4985 + { PINMUX_DRIVE_REG("DRVCTRL2", 0xe6060308) { 4986 + { PIN_NUMBER('B', 19), 28, 3 }, /* AVB_RXC */ 4987 + { PIN_NUMBER('A', 13), 24, 3 }, /* AVB_RD0 */ 4988 + { PIN_NUMBER('B', 13), 20, 3 }, /* AVB_RD1 */ 4989 + { PIN_NUMBER('A', 14), 16, 3 }, /* AVB_RD2 */ 4990 + { PIN_NUMBER('B', 14), 12, 3 }, /* AVB_RD3 */ 4991 + { PIN_NUMBER('A', 8), 8, 3 }, /* AVB_TX_CTL */ 4992 + { PIN_NUMBER('A', 19), 4, 3 }, /* AVB_TXC */ 4993 + { PIN_NUMBER('A', 18), 0, 3 }, /* AVB_TD0 */ 4994 + } }, 5143 4995 { PINMUX_DRIVE_REG("DRVCTRL3", 0xe606030c) { 5144 - { RCAR_GP_PIN(2, 9), 8, 3 }, /* AVB_MDC */ 5145 - { RCAR_GP_PIN(2, 10), 4, 3 }, /* AVB_MAGIC */ 5146 - { RCAR_GP_PIN(2, 11), 0, 3 }, /* AVB_PHY_INT */ 4996 + { PIN_NUMBER('B', 18), 28, 3 }, /* AVB_TD1 */ 4997 + { PIN_NUMBER('A', 17), 24, 3 }, /* AVB_TD2 */ 4998 + { PIN_NUMBER('B', 17), 20, 3 }, /* AVB_TD3 */ 4999 + { PIN_NUMBER('A', 12), 16, 3 }, /* AVB_TXCREFCLK */ 5000 + { PIN_NUMBER('A', 9), 12, 3 }, /* AVB_MDIO */ 5001 + { RCAR_GP_PIN(2, 9), 8, 3 }, /* AVB_MDC */ 5002 + { RCAR_GP_PIN(2, 10), 4, 3 }, /* AVB_MAGIC */ 5003 + { RCAR_GP_PIN(2, 11), 0, 3 }, /* AVB_PHY_INT */ 5147 5004 } }, 5148 5005 { PINMUX_DRIVE_REG("DRVCTRL4", 0xe6060310) { 5149 5006 { RCAR_GP_PIN(2, 12), 28, 3 }, /* AVB_LINK */ ··· 5221 5008 { RCAR_GP_PIN(1, 19), 0, 3 }, /* A19 */ 5222 5009 } }, 5223 5010 { PINMUX_DRIVE_REG("DRVCTRL8", 0xe6060320) { 5011 + { PIN_NUMBER('F', 1), 28, 3 }, /* CLKOUT */ 5224 5012 { RCAR_GP_PIN(1, 20), 24, 3 }, /* CS0 */ 5225 5013 { RCAR_GP_PIN(1, 21), 20, 3 }, /* CS1_A26 */ 5226 5014 { RCAR_GP_PIN(1, 22), 16, 3 }, /* BS */ ··· 5232 5018 } }, 5233 5019 { PINMUX_DRIVE_REG("DRVCTRL9", 0xe6060324) { 5234 5020 { RCAR_GP_PIN(1, 27), 28, 3 }, /* EX_WAIT0 */ 5021 + { PIN_NUMBER('C', 1), 24, 3 }, /* PRESETOUT# */ 5235 5022 { RCAR_GP_PIN(0, 0), 20, 3 }, /* D0 */ 5236 5023 { RCAR_GP_PIN(0, 1), 16, 3 }, /* D1 */ 5237 5024 { RCAR_GP_PIN(0, 2), 12, 3 }, /* D2 */ ··· 5251 5036 { RCAR_GP_PIN(0, 13), 0, 3 }, /* D13 */ 5252 5037 } }, 5253 5038 { PINMUX_DRIVE_REG("DRVCTRL11", 0xe606032c) { 5254 - { RCAR_GP_PIN(0, 14), 28, 3 }, /* D14 */ 5255 - { RCAR_GP_PIN(0, 15), 24, 3 }, /* D15 */ 5256 - { RCAR_GP_PIN(7, 0), 20, 3 }, /* AVS1 */ 5257 - { RCAR_GP_PIN(7, 1), 16, 3 }, /* AVS2 */ 5258 - { RCAR_GP_PIN(7, 2), 12, 3 }, /* HDMI0_CEC */ 5259 - { RCAR_GP_PIN(7, 3), 8, 3 }, /* HDMI1_CEC */ 5039 + { RCAR_GP_PIN(0, 14), 28, 3 }, /* D14 */ 5040 + { RCAR_GP_PIN(0, 15), 24, 3 }, /* D15 */ 5041 + { RCAR_GP_PIN(7, 0), 20, 3 }, /* AVS1 */ 5042 + { RCAR_GP_PIN(7, 1), 16, 3 }, /* AVS2 */ 5043 + { RCAR_GP_PIN(7, 2), 12, 3 }, /* HDMI0_CEC */ 5044 + { RCAR_GP_PIN(7, 3), 8, 3 }, /* HDMI1_CEC */ 5045 + { PIN_A_NUMBER('P', 7), 4, 2 }, /* DU_DOTCLKIN0 */ 5046 + { PIN_A_NUMBER('P', 8), 0, 2 }, /* DU_DOTCLKIN1 */ 5047 + } }, 5048 + { PINMUX_DRIVE_REG("DRVCTRL12", 0xe6060330) { 5049 + { PIN_A_NUMBER('R', 7), 28, 2 }, /* DU_DOTCLKIN2 */ 5050 + { PIN_A_NUMBER('R', 8), 24, 2 }, /* DU_DOTCLKIN3 */ 5051 + { PIN_A_NUMBER('D', 38), 20, 2 }, /* FSCLKST# */ 5052 + { PIN_A_NUMBER('R', 30), 4, 2 }, /* TMS */ 5260 5053 } }, 5261 5054 { PINMUX_DRIVE_REG("DRVCTRL13", 0xe6060334) { 5262 - { RCAR_GP_PIN(3, 0), 20, 3 }, /* SD0_CLK */ 5263 - { RCAR_GP_PIN(3, 1), 16, 3 }, /* SD0_CMD */ 5264 - { RCAR_GP_PIN(3, 2), 12, 3 }, /* SD0_DAT0 */ 5265 - { RCAR_GP_PIN(3, 3), 8, 3 }, /* SD0_DAT1 */ 5266 - { RCAR_GP_PIN(3, 4), 4, 3 }, /* SD0_DAT2 */ 5267 - { RCAR_GP_PIN(3, 5), 0, 3 }, /* SD0_DAT3 */ 5055 + { PIN_A_NUMBER('T', 28), 28, 2 }, /* TDO */ 5056 + { PIN_A_NUMBER('T', 30), 24, 2 }, /* ASEBRK */ 5057 + { RCAR_GP_PIN(3, 0), 20, 3 }, /* SD0_CLK */ 5058 + { RCAR_GP_PIN(3, 1), 16, 3 }, /* SD0_CMD */ 5059 + { RCAR_GP_PIN(3, 2), 12, 3 }, /* SD0_DAT0 */ 5060 + { RCAR_GP_PIN(3, 3), 8, 3 }, /* SD0_DAT1 */ 5061 + { RCAR_GP_PIN(3, 4), 4, 3 }, /* SD0_DAT2 */ 5062 + { RCAR_GP_PIN(3, 5), 0, 3 }, /* SD0_DAT3 */ 5268 5063 } }, 5269 5064 { PINMUX_DRIVE_REG("DRVCTRL14", 0xe6060338) { 5270 5065 { RCAR_GP_PIN(3, 6), 28, 3 }, /* SD1_CLK */ ··· 5343 5118 { RCAR_GP_PIN(5, 23), 16, 3 }, /* MLB_CLK */ 5344 5119 { RCAR_GP_PIN(5, 24), 12, 3 }, /* MLB_SIG */ 5345 5120 { RCAR_GP_PIN(5, 25), 8, 3 }, /* MLB_DAT */ 5121 + { PIN_NUMBER('H', 37), 4, 3 }, /* MLB_REF */ 5346 5122 { RCAR_GP_PIN(6, 0), 0, 3 }, /* SSI_SCK01239 */ 5347 5123 } }, 5348 5124 { PINMUX_DRIVE_REG("DRVCTRL21", 0xe6060354) { ··· 5414 5188 #define PU5 0x14 5415 5189 #define PU6 0x18 5416 5190 5417 - static const struct { 5418 - u16 reg : 11; 5419 - u16 bit : 5; 5420 - } pullups[] = { 5421 - [RCAR_GP_PIN(2, 11)] = { PU0, 31 }, /* AVB_PHY_INT */ 5422 - [RCAR_GP_PIN(2, 10)] = { PU0, 30 }, /* AVB_MAGIC */ 5423 - [RCAR_GP_PIN(2, 9)] = { PU0, 29 }, /* AVB_MDC */ 5191 + static const struct sh_pfc_bias_info bias_info[] = { 5192 + { RCAR_GP_PIN(2, 11), PU0, 31 }, /* AVB_PHY_INT */ 5193 + { RCAR_GP_PIN(2, 10), PU0, 30 }, /* AVB_MAGIC */ 5194 + { RCAR_GP_PIN(2, 9), PU0, 29 }, /* AVB_MDC */ 5424 5195 5425 - [RCAR_GP_PIN(1, 19)] = { PU1, 31 }, /* A19 */ 5426 - [RCAR_GP_PIN(1, 18)] = { PU1, 30 }, /* A18 */ 5427 - [RCAR_GP_PIN(1, 17)] = { PU1, 29 }, /* A17 */ 5428 - [RCAR_GP_PIN(1, 16)] = { PU1, 28 }, /* A16 */ 5429 - [RCAR_GP_PIN(1, 15)] = { PU1, 27 }, /* A15 */ 5430 - [RCAR_GP_PIN(1, 14)] = { PU1, 26 }, /* A14 */ 5431 - [RCAR_GP_PIN(1, 13)] = { PU1, 25 }, /* A13 */ 5432 - [RCAR_GP_PIN(1, 12)] = { PU1, 24 }, /* A12 */ 5433 - [RCAR_GP_PIN(1, 11)] = { PU1, 23 }, /* A11 */ 5434 - [RCAR_GP_PIN(1, 10)] = { PU1, 22 }, /* A10 */ 5435 - [RCAR_GP_PIN(1, 9)] = { PU1, 21 }, /* A9 */ 5436 - [RCAR_GP_PIN(1, 8)] = { PU1, 20 }, /* A8 */ 5437 - [RCAR_GP_PIN(1, 7)] = { PU1, 19 }, /* A7 */ 5438 - [RCAR_GP_PIN(1, 6)] = { PU1, 18 }, /* A6 */ 5439 - [RCAR_GP_PIN(1, 5)] = { PU1, 17 }, /* A5 */ 5440 - [RCAR_GP_PIN(1, 4)] = { PU1, 16 }, /* A4 */ 5441 - [RCAR_GP_PIN(1, 3)] = { PU1, 15 }, /* A3 */ 5442 - [RCAR_GP_PIN(1, 2)] = { PU1, 14 }, /* A2 */ 5443 - [RCAR_GP_PIN(1, 1)] = { PU1, 13 }, /* A1 */ 5444 - [RCAR_GP_PIN(1, 0)] = { PU1, 12 }, /* A0 */ 5445 - [RCAR_GP_PIN(2, 8)] = { PU1, 11 }, /* PWM2_A */ 5446 - [RCAR_GP_PIN(2, 7)] = { PU1, 10 }, /* PWM1_A */ 5447 - [RCAR_GP_PIN(2, 6)] = { PU1, 9 }, /* PWM0 */ 5448 - [RCAR_GP_PIN(2, 5)] = { PU1, 8 }, /* IRQ5 */ 5449 - [RCAR_GP_PIN(2, 4)] = { PU1, 7 }, /* IRQ4 */ 5450 - [RCAR_GP_PIN(2, 3)] = { PU1, 6 }, /* IRQ3 */ 5451 - [RCAR_GP_PIN(2, 2)] = { PU1, 5 }, /* IRQ2 */ 5452 - [RCAR_GP_PIN(2, 1)] = { PU1, 4 }, /* IRQ1 */ 5453 - [RCAR_GP_PIN(2, 0)] = { PU1, 3 }, /* IRQ0 */ 5454 - [RCAR_GP_PIN(2, 14)] = { PU1, 2 }, /* AVB_AVTP_CAPTURE_A */ 5455 - [RCAR_GP_PIN(2, 13)] = { PU1, 1 }, /* AVB_AVTP_MATCH_A */ 5456 - [RCAR_GP_PIN(2, 12)] = { PU1, 0 }, /* AVB_LINK */ 5196 + { RCAR_GP_PIN(1, 19), PU1, 31 }, /* A19 */ 5197 + { RCAR_GP_PIN(1, 18), PU1, 30 }, /* A18 */ 5198 + { RCAR_GP_PIN(1, 17), PU1, 29 }, /* A17 */ 5199 + { RCAR_GP_PIN(1, 16), PU1, 28 }, /* A16 */ 5200 + { RCAR_GP_PIN(1, 15), PU1, 27 }, /* A15 */ 5201 + { RCAR_GP_PIN(1, 14), PU1, 26 }, /* A14 */ 5202 + { RCAR_GP_PIN(1, 13), PU1, 25 }, /* A13 */ 5203 + { RCAR_GP_PIN(1, 12), PU1, 24 }, /* A12 */ 5204 + { RCAR_GP_PIN(1, 11), PU1, 23 }, /* A11 */ 5205 + { RCAR_GP_PIN(1, 10), PU1, 22 }, /* A10 */ 5206 + { RCAR_GP_PIN(1, 9), PU1, 21 }, /* A9 */ 5207 + { RCAR_GP_PIN(1, 8), PU1, 20 }, /* A8 */ 5208 + { RCAR_GP_PIN(1, 7), PU1, 19 }, /* A7 */ 5209 + { RCAR_GP_PIN(1, 6), PU1, 18 }, /* A6 */ 5210 + { RCAR_GP_PIN(1, 5), PU1, 17 }, /* A5 */ 5211 + { RCAR_GP_PIN(1, 4), PU1, 16 }, /* A4 */ 5212 + { RCAR_GP_PIN(1, 3), PU1, 15 }, /* A3 */ 5213 + { RCAR_GP_PIN(1, 2), PU1, 14 }, /* A2 */ 5214 + { RCAR_GP_PIN(1, 1), PU1, 13 }, /* A1 */ 5215 + { RCAR_GP_PIN(1, 0), PU1, 12 }, /* A0 */ 5216 + { RCAR_GP_PIN(2, 8), PU1, 11 }, /* PWM2_A */ 5217 + { RCAR_GP_PIN(2, 7), PU1, 10 }, /* PWM1_A */ 5218 + { RCAR_GP_PIN(2, 6), PU1, 9 }, /* PWM0 */ 5219 + { RCAR_GP_PIN(2, 5), PU1, 8 }, /* IRQ5 */ 5220 + { RCAR_GP_PIN(2, 4), PU1, 7 }, /* IRQ4 */ 5221 + { RCAR_GP_PIN(2, 3), PU1, 6 }, /* IRQ3 */ 5222 + { RCAR_GP_PIN(2, 2), PU1, 5 }, /* IRQ2 */ 5223 + { RCAR_GP_PIN(2, 1), PU1, 4 }, /* IRQ1 */ 5224 + { RCAR_GP_PIN(2, 0), PU1, 3 }, /* IRQ0 */ 5225 + { RCAR_GP_PIN(2, 14), PU1, 2 }, /* AVB_AVTP_CAPTURE_A */ 5226 + { RCAR_GP_PIN(2, 13), PU1, 1 }, /* AVB_AVTP_MATCH_A */ 5227 + { RCAR_GP_PIN(2, 12), PU1, 0 }, /* AVB_LINK */ 5457 5228 5458 - [RCAR_GP_PIN(7, 3)] = { PU2, 29 }, /* HDMI1_CEC */ 5459 - [RCAR_GP_PIN(7, 2)] = { PU2, 28 }, /* HDMI0_CEC */ 5460 - [RCAR_GP_PIN(7, 1)] = { PU2, 27 }, /* AVS2 */ 5461 - [RCAR_GP_PIN(7, 0)] = { PU2, 26 }, /* AVS1 */ 5462 - [RCAR_GP_PIN(0, 15)] = { PU2, 25 }, /* D15 */ 5463 - [RCAR_GP_PIN(0, 14)] = { PU2, 24 }, /* D14 */ 5464 - [RCAR_GP_PIN(0, 13)] = { PU2, 23 }, /* D13 */ 5465 - [RCAR_GP_PIN(0, 12)] = { PU2, 22 }, /* D12 */ 5466 - [RCAR_GP_PIN(0, 11)] = { PU2, 21 }, /* D11 */ 5467 - [RCAR_GP_PIN(0, 10)] = { PU2, 20 }, /* D10 */ 5468 - [RCAR_GP_PIN(0, 9)] = { PU2, 19 }, /* D9 */ 5469 - [RCAR_GP_PIN(0, 8)] = { PU2, 18 }, /* D8 */ 5470 - [RCAR_GP_PIN(0, 7)] = { PU2, 17 }, /* D7 */ 5471 - [RCAR_GP_PIN(0, 6)] = { PU2, 16 }, /* D6 */ 5472 - [RCAR_GP_PIN(0, 5)] = { PU2, 15 }, /* D5 */ 5473 - [RCAR_GP_PIN(0, 4)] = { PU2, 14 }, /* D4 */ 5474 - [RCAR_GP_PIN(0, 3)] = { PU2, 13 }, /* D3 */ 5475 - [RCAR_GP_PIN(0, 2)] = { PU2, 12 }, /* D2 */ 5476 - [RCAR_GP_PIN(0, 1)] = { PU2, 11 }, /* D1 */ 5477 - [RCAR_GP_PIN(0, 0)] = { PU2, 10 }, /* D0 */ 5478 - [RCAR_GP_PIN(1, 27)] = { PU2, 8 }, /* EX_WAIT0_A */ 5479 - [RCAR_GP_PIN(1, 26)] = { PU2, 7 }, /* WE1_N */ 5480 - [RCAR_GP_PIN(1, 25)] = { PU2, 6 }, /* WE0_N */ 5481 - [RCAR_GP_PIN(1, 24)] = { PU2, 5 }, /* RD_WR_N */ 5482 - [RCAR_GP_PIN(1, 23)] = { PU2, 4 }, /* RD_N */ 5483 - [RCAR_GP_PIN(1, 22)] = { PU2, 3 }, /* BS_N */ 5484 - [RCAR_GP_PIN(1, 21)] = { PU2, 2 }, /* CS1_N_A26 */ 5485 - [RCAR_GP_PIN(1, 20)] = { PU2, 1 }, /* CS0_N */ 5229 + { RCAR_GP_PIN(7, 3), PU2, 29 }, /* HDMI1_CEC */ 5230 + { RCAR_GP_PIN(7, 2), PU2, 28 }, /* HDMI0_CEC */ 5231 + { RCAR_GP_PIN(7, 1), PU2, 27 }, /* AVS2 */ 5232 + { RCAR_GP_PIN(7, 0), PU2, 26 }, /* AVS1 */ 5233 + { RCAR_GP_PIN(0, 15), PU2, 25 }, /* D15 */ 5234 + { RCAR_GP_PIN(0, 14), PU2, 24 }, /* D14 */ 5235 + { RCAR_GP_PIN(0, 13), PU2, 23 }, /* D13 */ 5236 + { RCAR_GP_PIN(0, 12), PU2, 22 }, /* D12 */ 5237 + { RCAR_GP_PIN(0, 11), PU2, 21 }, /* D11 */ 5238 + { RCAR_GP_PIN(0, 10), PU2, 20 }, /* D10 */ 5239 + { RCAR_GP_PIN(0, 9), PU2, 19 }, /* D9 */ 5240 + { RCAR_GP_PIN(0, 8), PU2, 18 }, /* D8 */ 5241 + { RCAR_GP_PIN(0, 7), PU2, 17 }, /* D7 */ 5242 + { RCAR_GP_PIN(0, 6), PU2, 16 }, /* D6 */ 5243 + { RCAR_GP_PIN(0, 5), PU2, 15 }, /* D5 */ 5244 + { RCAR_GP_PIN(0, 4), PU2, 14 }, /* D4 */ 5245 + { RCAR_GP_PIN(0, 3), PU2, 13 }, /* D3 */ 5246 + { RCAR_GP_PIN(0, 2), PU2, 12 }, /* D2 */ 5247 + { RCAR_GP_PIN(0, 1), PU2, 11 }, /* D1 */ 5248 + { RCAR_GP_PIN(0, 0), PU2, 10 }, /* D0 */ 5249 + { RCAR_GP_PIN(1, 27), PU2, 8 }, /* EX_WAIT0_A */ 5250 + { RCAR_GP_PIN(1, 26), PU2, 7 }, /* WE1_N */ 5251 + { RCAR_GP_PIN(1, 25), PU2, 6 }, /* WE0_N */ 5252 + { RCAR_GP_PIN(1, 24), PU2, 5 }, /* RD_WR_N */ 5253 + { RCAR_GP_PIN(1, 23), PU2, 4 }, /* RD_N */ 5254 + { RCAR_GP_PIN(1, 22), PU2, 3 }, /* BS_N */ 5255 + { RCAR_GP_PIN(1, 21), PU2, 2 }, /* CS1_N_A26 */ 5256 + { RCAR_GP_PIN(1, 20), PU2, 1 }, /* CS0_N */ 5486 5257 5487 - [RCAR_GP_PIN(4, 9)] = { PU3, 31 }, /* SD3_DAT0 */ 5488 - [RCAR_GP_PIN(4, 8)] = { PU3, 30 }, /* SD3_CMD */ 5489 - [RCAR_GP_PIN(4, 7)] = { PU3, 29 }, /* SD3_CLK */ 5490 - [RCAR_GP_PIN(4, 6)] = { PU3, 28 }, /* SD2_DS */ 5491 - [RCAR_GP_PIN(4, 5)] = { PU3, 27 }, /* SD2_DAT3 */ 5492 - [RCAR_GP_PIN(4, 4)] = { PU3, 26 }, /* SD2_DAT2 */ 5493 - [RCAR_GP_PIN(4, 3)] = { PU3, 25 }, /* SD2_DAT1 */ 5494 - [RCAR_GP_PIN(4, 2)] = { PU3, 24 }, /* SD2_DAT0 */ 5495 - [RCAR_GP_PIN(4, 1)] = { PU3, 23 }, /* SD2_CMD */ 5496 - [RCAR_GP_PIN(4, 0)] = { PU3, 22 }, /* SD2_CLK */ 5497 - [RCAR_GP_PIN(3, 11)] = { PU3, 21 }, /* SD1_DAT3 */ 5498 - [RCAR_GP_PIN(3, 10)] = { PU3, 20 }, /* SD1_DAT2 */ 5499 - [RCAR_GP_PIN(3, 9)] = { PU3, 19 }, /* SD1_DAT1 */ 5500 - [RCAR_GP_PIN(3, 8)] = { PU3, 18 }, /* SD1_DAT0 */ 5501 - [RCAR_GP_PIN(3, 7)] = { PU3, 17 }, /* SD1_CMD */ 5502 - [RCAR_GP_PIN(3, 6)] = { PU3, 16 }, /* SD1_CLK */ 5503 - [RCAR_GP_PIN(3, 5)] = { PU3, 15 }, /* SD0_DAT3 */ 5504 - [RCAR_GP_PIN(3, 4)] = { PU3, 14 }, /* SD0_DAT2 */ 5505 - [RCAR_GP_PIN(3, 3)] = { PU3, 13 }, /* SD0_DAT1 */ 5506 - [RCAR_GP_PIN(3, 2)] = { PU3, 12 }, /* SD0_DAT0 */ 5507 - [RCAR_GP_PIN(3, 1)] = { PU3, 11 }, /* SD0_CMD */ 5508 - [RCAR_GP_PIN(3, 0)] = { PU3, 10 }, /* SD0_CLK */ 5258 + { RCAR_GP_PIN(4, 9), PU3, 31 }, /* SD3_DAT0 */ 5259 + { RCAR_GP_PIN(4, 8), PU3, 30 }, /* SD3_CMD */ 5260 + { RCAR_GP_PIN(4, 7), PU3, 29 }, /* SD3_CLK */ 5261 + { RCAR_GP_PIN(4, 6), PU3, 28 }, /* SD2_DS */ 5262 + { RCAR_GP_PIN(4, 5), PU3, 27 }, /* SD2_DAT3 */ 5263 + { RCAR_GP_PIN(4, 4), PU3, 26 }, /* SD2_DAT2 */ 5264 + { RCAR_GP_PIN(4, 3), PU3, 25 }, /* SD2_DAT1 */ 5265 + { RCAR_GP_PIN(4, 2), PU3, 24 }, /* SD2_DAT0 */ 5266 + { RCAR_GP_PIN(4, 1), PU3, 23 }, /* SD2_CMD */ 5267 + { RCAR_GP_PIN(4, 0), PU3, 22 }, /* SD2_CLK */ 5268 + { RCAR_GP_PIN(3, 11), PU3, 21 }, /* SD1_DAT3 */ 5269 + { RCAR_GP_PIN(3, 10), PU3, 20 }, /* SD1_DAT2 */ 5270 + { RCAR_GP_PIN(3, 9), PU3, 19 }, /* SD1_DAT1 */ 5271 + { RCAR_GP_PIN(3, 8), PU3, 18 }, /* SD1_DAT0 */ 5272 + { RCAR_GP_PIN(3, 7), PU3, 17 }, /* SD1_CMD */ 5273 + { RCAR_GP_PIN(3, 6), PU3, 16 }, /* SD1_CLK */ 5274 + { RCAR_GP_PIN(3, 5), PU3, 15 }, /* SD0_DAT3 */ 5275 + { RCAR_GP_PIN(3, 4), PU3, 14 }, /* SD0_DAT2 */ 5276 + { RCAR_GP_PIN(3, 3), PU3, 13 }, /* SD0_DAT1 */ 5277 + { RCAR_GP_PIN(3, 2), PU3, 12 }, /* SD0_DAT0 */ 5278 + { RCAR_GP_PIN(3, 1), PU3, 11 }, /* SD0_CMD */ 5279 + { RCAR_GP_PIN(3, 0), PU3, 10 }, /* SD0_CLK */ 5509 5280 5510 - [RCAR_GP_PIN(5, 19)] = { PU4, 31 }, /* MSIOF0_SS1 */ 5511 - [RCAR_GP_PIN(5, 18)] = { PU4, 30 }, /* MSIOF0_SYNC */ 5512 - [RCAR_GP_PIN(5, 17)] = { PU4, 29 }, /* MSIOF0_SCK */ 5513 - [RCAR_GP_PIN(5, 16)] = { PU4, 28 }, /* HRTS0_N */ 5514 - [RCAR_GP_PIN(5, 15)] = { PU4, 27 }, /* HCTS0_N */ 5515 - [RCAR_GP_PIN(5, 14)] = { PU4, 26 }, /* HTX0 */ 5516 - [RCAR_GP_PIN(5, 13)] = { PU4, 25 }, /* HRX0 */ 5517 - [RCAR_GP_PIN(5, 12)] = { PU4, 24 }, /* HSCK0 */ 5518 - [RCAR_GP_PIN(5, 11)] = { PU4, 23 }, /* RX2_A */ 5519 - [RCAR_GP_PIN(5, 10)] = { PU4, 22 }, /* TX2_A */ 5520 - [RCAR_GP_PIN(5, 9)] = { PU4, 21 }, /* SCK2 */ 5521 - [RCAR_GP_PIN(5, 8)] = { PU4, 20 }, /* RTS1_N_TANS */ 5522 - [RCAR_GP_PIN(5, 7)] = { PU4, 19 }, /* CTS1_N */ 5523 - [RCAR_GP_PIN(5, 6)] = { PU4, 18 }, /* TX1_A */ 5524 - [RCAR_GP_PIN(5, 5)] = { PU4, 17 }, /* RX1_A */ 5525 - [RCAR_GP_PIN(5, 4)] = { PU4, 16 }, /* RTS0_N_TANS */ 5526 - [RCAR_GP_PIN(5, 3)] = { PU4, 15 }, /* CTS0_N */ 5527 - [RCAR_GP_PIN(5, 2)] = { PU4, 14 }, /* TX0 */ 5528 - [RCAR_GP_PIN(5, 1)] = { PU4, 13 }, /* RX0 */ 5529 - [RCAR_GP_PIN(5, 0)] = { PU4, 12 }, /* SCK0 */ 5530 - [RCAR_GP_PIN(3, 15)] = { PU4, 11 }, /* SD1_WP */ 5531 - [RCAR_GP_PIN(3, 14)] = { PU4, 10 }, /* SD1_CD */ 5532 - [RCAR_GP_PIN(3, 13)] = { PU4, 9 }, /* SD0_WP */ 5533 - [RCAR_GP_PIN(3, 12)] = { PU4, 8 }, /* SD0_CD */ 5534 - [RCAR_GP_PIN(4, 17)] = { PU4, 7 }, /* SD3_DS */ 5535 - [RCAR_GP_PIN(4, 16)] = { PU4, 6 }, /* SD3_DAT7 */ 5536 - [RCAR_GP_PIN(4, 15)] = { PU4, 5 }, /* SD3_DAT6 */ 5537 - [RCAR_GP_PIN(4, 14)] = { PU4, 4 }, /* SD3_DAT5 */ 5538 - [RCAR_GP_PIN(4, 13)] = { PU4, 3 }, /* SD3_DAT4 */ 5539 - [RCAR_GP_PIN(4, 12)] = { PU4, 2 }, /* SD3_DAT3 */ 5540 - [RCAR_GP_PIN(4, 11)] = { PU4, 1 }, /* SD3_DAT2 */ 5541 - [RCAR_GP_PIN(4, 10)] = { PU4, 0 }, /* SD3_DAT1 */ 5281 + { RCAR_GP_PIN(5, 19), PU4, 31 }, /* MSIOF0_SS1 */ 5282 + { RCAR_GP_PIN(5, 18), PU4, 30 }, /* MSIOF0_SYNC */ 5283 + { RCAR_GP_PIN(5, 17), PU4, 29 }, /* MSIOF0_SCK */ 5284 + { RCAR_GP_PIN(5, 16), PU4, 28 }, /* HRTS0_N */ 5285 + { RCAR_GP_PIN(5, 15), PU4, 27 }, /* HCTS0_N */ 5286 + { RCAR_GP_PIN(5, 14), PU4, 26 }, /* HTX0 */ 5287 + { RCAR_GP_PIN(5, 13), PU4, 25 }, /* HRX0 */ 5288 + { RCAR_GP_PIN(5, 12), PU4, 24 }, /* HSCK0 */ 5289 + { RCAR_GP_PIN(5, 11), PU4, 23 }, /* RX2_A */ 5290 + { RCAR_GP_PIN(5, 10), PU4, 22 }, /* TX2_A */ 5291 + { RCAR_GP_PIN(5, 9), PU4, 21 }, /* SCK2 */ 5292 + { RCAR_GP_PIN(5, 8), PU4, 20 }, /* RTS1_N_TANS */ 5293 + { RCAR_GP_PIN(5, 7), PU4, 19 }, /* CTS1_N */ 5294 + { RCAR_GP_PIN(5, 6), PU4, 18 }, /* TX1_A */ 5295 + { RCAR_GP_PIN(5, 5), PU4, 17 }, /* RX1_A */ 5296 + { RCAR_GP_PIN(5, 4), PU4, 16 }, /* RTS0_N_TANS */ 5297 + { RCAR_GP_PIN(5, 3), PU4, 15 }, /* CTS0_N */ 5298 + { RCAR_GP_PIN(5, 2), PU4, 14 }, /* TX0 */ 5299 + { RCAR_GP_PIN(5, 1), PU4, 13 }, /* RX0 */ 5300 + { RCAR_GP_PIN(5, 0), PU4, 12 }, /* SCK0 */ 5301 + { RCAR_GP_PIN(3, 15), PU4, 11 }, /* SD1_WP */ 5302 + { RCAR_GP_PIN(3, 14), PU4, 10 }, /* SD1_CD */ 5303 + { RCAR_GP_PIN(3, 13), PU4, 9 }, /* SD0_WP */ 5304 + { RCAR_GP_PIN(3, 12), PU4, 8 }, /* SD0_CD */ 5305 + { RCAR_GP_PIN(4, 17), PU4, 7 }, /* SD3_DS */ 5306 + { RCAR_GP_PIN(4, 16), PU4, 6 }, /* SD3_DAT7 */ 5307 + { RCAR_GP_PIN(4, 15), PU4, 5 }, /* SD3_DAT6 */ 5308 + { RCAR_GP_PIN(4, 14), PU4, 4 }, /* SD3_DAT5 */ 5309 + { RCAR_GP_PIN(4, 13), PU4, 3 }, /* SD3_DAT4 */ 5310 + { RCAR_GP_PIN(4, 12), PU4, 2 }, /* SD3_DAT3 */ 5311 + { RCAR_GP_PIN(4, 11), PU4, 1 }, /* SD3_DAT2 */ 5312 + { RCAR_GP_PIN(4, 10), PU4, 0 }, /* SD3_DAT1 */ 5542 5313 5543 - [RCAR_GP_PIN(6, 24)] = { PU5, 31 }, /* USB0_PWEN */ 5544 - [RCAR_GP_PIN(6, 23)] = { PU5, 30 }, /* AUDIO_CLKB_B */ 5545 - [RCAR_GP_PIN(6, 22)] = { PU5, 29 }, /* AUDIO_CLKA_A */ 5546 - [RCAR_GP_PIN(6, 21)] = { PU5, 28 }, /* SSI_SDATA9_A */ 5547 - [RCAR_GP_PIN(6, 20)] = { PU5, 27 }, /* SSI_SDATA8 */ 5548 - [RCAR_GP_PIN(6, 19)] = { PU5, 26 }, /* SSI_SDATA7 */ 5549 - [RCAR_GP_PIN(6, 18)] = { PU5, 25 }, /* SSI_WS78 */ 5550 - [RCAR_GP_PIN(6, 17)] = { PU5, 24 }, /* SSI_SCK78 */ 5551 - [RCAR_GP_PIN(6, 16)] = { PU5, 23 }, /* SSI_SDATA6 */ 5552 - [RCAR_GP_PIN(6, 15)] = { PU5, 22 }, /* SSI_WS6 */ 5553 - [RCAR_GP_PIN(6, 14)] = { PU5, 21 }, /* SSI_SCK6 */ 5554 - [RCAR_GP_PIN(6, 13)] = { PU5, 20 }, /* SSI_SDATA5 */ 5555 - [RCAR_GP_PIN(6, 12)] = { PU5, 19 }, /* SSI_WS5 */ 5556 - [RCAR_GP_PIN(6, 11)] = { PU5, 18 }, /* SSI_SCK5 */ 5557 - [RCAR_GP_PIN(6, 10)] = { PU5, 17 }, /* SSI_SDATA4 */ 5558 - [RCAR_GP_PIN(6, 9)] = { PU5, 16 }, /* SSI_WS4 */ 5559 - [RCAR_GP_PIN(6, 8)] = { PU5, 15 }, /* SSI_SCK4 */ 5560 - [RCAR_GP_PIN(6, 7)] = { PU5, 14 }, /* SSI_SDATA3 */ 5561 - [RCAR_GP_PIN(6, 6)] = { PU5, 13 }, /* SSI_WS34 */ 5562 - [RCAR_GP_PIN(6, 5)] = { PU5, 12 }, /* SSI_SCK34 */ 5563 - [RCAR_GP_PIN(6, 4)] = { PU5, 11 }, /* SSI_SDATA2_A */ 5564 - [RCAR_GP_PIN(6, 3)] = { PU5, 10 }, /* SSI_SDATA1_A */ 5565 - [RCAR_GP_PIN(6, 2)] = { PU5, 9 }, /* SSI_SDATA0 */ 5566 - [RCAR_GP_PIN(6, 1)] = { PU5, 8 }, /* SSI_WS01239 */ 5567 - [RCAR_GP_PIN(6, 0)] = { PU5, 7 }, /* SSI_SCK01239 */ 5568 - [RCAR_GP_PIN(5, 25)] = { PU5, 5 }, /* MLB_DAT */ 5569 - [RCAR_GP_PIN(5, 24)] = { PU5, 4 }, /* MLB_SIG */ 5570 - [RCAR_GP_PIN(5, 23)] = { PU5, 3 }, /* MLB_CLK */ 5571 - [RCAR_GP_PIN(5, 22)] = { PU5, 2 }, /* MSIOF0_RXD */ 5572 - [RCAR_GP_PIN(5, 21)] = { PU5, 1 }, /* MSIOF0_SS2 */ 5573 - [RCAR_GP_PIN(5, 20)] = { PU5, 0 }, /* MSIOF0_TXD */ 5314 + { RCAR_GP_PIN(6, 24), PU5, 31 }, /* USB0_PWEN */ 5315 + { RCAR_GP_PIN(6, 23), PU5, 30 }, /* AUDIO_CLKB_B */ 5316 + { RCAR_GP_PIN(6, 22), PU5, 29 }, /* AUDIO_CLKA_A */ 5317 + { RCAR_GP_PIN(6, 21), PU5, 28 }, /* SSI_SDATA9_A */ 5318 + { RCAR_GP_PIN(6, 20), PU5, 27 }, /* SSI_SDATA8 */ 5319 + { RCAR_GP_PIN(6, 19), PU5, 26 }, /* SSI_SDATA7 */ 5320 + { RCAR_GP_PIN(6, 18), PU5, 25 }, /* SSI_WS78 */ 5321 + { RCAR_GP_PIN(6, 17), PU5, 24 }, /* SSI_SCK78 */ 5322 + { RCAR_GP_PIN(6, 16), PU5, 23 }, /* SSI_SDATA6 */ 5323 + { RCAR_GP_PIN(6, 15), PU5, 22 }, /* SSI_WS6 */ 5324 + { RCAR_GP_PIN(6, 14), PU5, 21 }, /* SSI_SCK6 */ 5325 + { RCAR_GP_PIN(6, 13), PU5, 20 }, /* SSI_SDATA5 */ 5326 + { RCAR_GP_PIN(6, 12), PU5, 19 }, /* SSI_WS5 */ 5327 + { RCAR_GP_PIN(6, 11), PU5, 18 }, /* SSI_SCK5 */ 5328 + { RCAR_GP_PIN(6, 10), PU5, 17 }, /* SSI_SDATA4 */ 5329 + { RCAR_GP_PIN(6, 9), PU5, 16 }, /* SSI_WS4 */ 5330 + { RCAR_GP_PIN(6, 8), PU5, 15 }, /* SSI_SCK4 */ 5331 + { RCAR_GP_PIN(6, 7), PU5, 14 }, /* SSI_SDATA3 */ 5332 + { RCAR_GP_PIN(6, 6), PU5, 13 }, /* SSI_WS34 */ 5333 + { RCAR_GP_PIN(6, 5), PU5, 12 }, /* SSI_SCK34 */ 5334 + { RCAR_GP_PIN(6, 4), PU5, 11 }, /* SSI_SDATA2_A */ 5335 + { RCAR_GP_PIN(6, 3), PU5, 10 }, /* SSI_SDATA1_A */ 5336 + { RCAR_GP_PIN(6, 2), PU5, 9 }, /* SSI_SDATA0 */ 5337 + { RCAR_GP_PIN(6, 1), PU5, 8 }, /* SSI_WS01239 */ 5338 + { RCAR_GP_PIN(6, 0), PU5, 7 }, /* SSI_SCK01239 */ 5339 + { RCAR_GP_PIN(5, 25), PU5, 5 }, /* MLB_DAT */ 5340 + { RCAR_GP_PIN(5, 24), PU5, 4 }, /* MLB_SIG */ 5341 + { RCAR_GP_PIN(5, 23), PU5, 3 }, /* MLB_CLK */ 5342 + { RCAR_GP_PIN(5, 22), PU5, 2 }, /* MSIOF0_RXD */ 5343 + { RCAR_GP_PIN(5, 21), PU5, 1 }, /* MSIOF0_SS2 */ 5344 + { RCAR_GP_PIN(5, 20), PU5, 0 }, /* MSIOF0_TXD */ 5574 5345 5575 - [RCAR_GP_PIN(6, 31)] = { PU6, 6 }, /* USB31_OVC */ 5576 - [RCAR_GP_PIN(6, 30)] = { PU6, 5 }, /* USB31_PWEN */ 5577 - [RCAR_GP_PIN(6, 29)] = { PU6, 4 }, /* USB30_OVC */ 5578 - [RCAR_GP_PIN(6, 28)] = { PU6, 3 }, /* USB30_PWEN */ 5579 - [RCAR_GP_PIN(6, 27)] = { PU6, 2 }, /* USB1_OVC */ 5580 - [RCAR_GP_PIN(6, 26)] = { PU6, 1 }, /* USB1_PWEN */ 5581 - [RCAR_GP_PIN(6, 25)] = { PU6, 0 }, /* USB0_OVC */ 5346 + { RCAR_GP_PIN(6, 31), PU6, 6 }, /* USB31_OVC */ 5347 + { RCAR_GP_PIN(6, 30), PU6, 5 }, /* USB31_PWEN */ 5348 + { RCAR_GP_PIN(6, 29), PU6, 4 }, /* USB30_OVC */ 5349 + { RCAR_GP_PIN(6, 28), PU6, 3 }, /* USB30_PWEN */ 5350 + { RCAR_GP_PIN(6, 27), PU6, 2 }, /* USB1_OVC */ 5351 + { RCAR_GP_PIN(6, 26), PU6, 1 }, /* USB1_PWEN */ 5352 + { RCAR_GP_PIN(6, 25), PU6, 0 }, /* USB0_OVC */ 5582 5353 }; 5583 5354 5584 5355 static unsigned int r8a7795_pinmux_get_bias(struct sh_pfc *pfc, 5585 5356 unsigned int pin) 5586 5357 { 5358 + const struct sh_pfc_bias_info *info; 5587 5359 u32 reg; 5588 5360 u32 bit; 5589 5361 5590 - if (WARN_ON_ONCE(!pullups[pin].reg)) 5362 + info = sh_pfc_pin_to_bias_info(bias_info, ARRAY_SIZE(bias_info), pin); 5363 + if (!info) 5591 5364 return PIN_CONFIG_BIAS_DISABLE; 5592 5365 5593 - reg = pullups[pin].reg; 5594 - bit = BIT(pullups[pin].bit); 5366 + reg = info->reg; 5367 + bit = BIT(info->bit); 5595 5368 5596 - if (sh_pfc_read_reg(pfc, PUEN + reg, 32) & bit) { 5597 - if (sh_pfc_read_reg(pfc, PUD + reg, 32) & bit) 5598 - return PIN_CONFIG_BIAS_PULL_UP; 5599 - else 5600 - return PIN_CONFIG_BIAS_PULL_DOWN; 5601 - } else 5369 + if (!(sh_pfc_read_reg(pfc, PUEN + reg, 32) & bit)) 5602 5370 return PIN_CONFIG_BIAS_DISABLE; 5371 + else if (sh_pfc_read_reg(pfc, PUD + reg, 32) & bit) 5372 + return PIN_CONFIG_BIAS_PULL_UP; 5373 + else 5374 + return PIN_CONFIG_BIAS_PULL_DOWN; 5603 5375 } 5604 5376 5605 5377 static void r8a7795_pinmux_set_bias(struct sh_pfc *pfc, unsigned int pin, 5606 5378 unsigned int bias) 5607 5379 { 5380 + const struct sh_pfc_bias_info *info; 5608 5381 u32 enable, updown; 5609 5382 u32 reg; 5610 5383 u32 bit; 5611 5384 5612 - if (WARN_ON_ONCE(!pullups[pin].reg)) 5385 + info = sh_pfc_pin_to_bias_info(bias_info, ARRAY_SIZE(bias_info), pin); 5386 + if (!info) 5613 5387 return; 5614 5388 5615 - reg = pullups[pin].reg; 5616 - bit = BIT(pullups[pin].bit); 5389 + reg = info->reg; 5390 + bit = BIT(info->bit); 5617 5391 5618 5392 enable = sh_pfc_read_reg(pfc, PUEN + reg, 32) & ~bit; 5619 5393 if (bias != PIN_CONFIG_BIAS_DISABLE)
+566 -10
drivers/pinctrl/sh-pfc/pfc-r8a7796.c
··· 122 122 #define GPSR3_0 F_(SD0_CLK, IP7_19_16) 123 123 124 124 /* GPSR4 */ 125 - #define GPSR4_17 F_(SD3_DS, IP11_11_8) 126 - #define GPSR4_16 F_(SD3_DAT7, IP10_7_4) 127 - #define GPSR4_15 F_(SD3_DAT6, IP10_3_0) 128 - #define GPSR4_14 F_(SD3_DAT5, IP9_31_28) 129 - #define GPSR4_13 F_(SD3_DAT4, IP9_27_24) 125 + #define GPSR4_17 F_(SD3_DS, IP11_7_4) 126 + #define GPSR4_16 F_(SD3_DAT7, IP11_3_0) 127 + #define GPSR4_15 F_(SD3_DAT6, IP10_31_28) 128 + #define GPSR4_14 F_(SD3_DAT5, IP10_27_24) 129 + #define GPSR4_13 F_(SD3_DAT4, IP10_23_20) 130 130 #define GPSR4_12 F_(SD3_DAT3, IP10_19_16) 131 131 #define GPSR4_11 F_(SD3_DAT2, IP10_15_12) 132 132 #define GPSR4_10 F_(SD3_DAT1, IP10_11_8) 133 133 #define GPSR4_9 F_(SD3_DAT0, IP10_7_4) 134 134 #define GPSR4_8 F_(SD3_CMD, IP10_3_0) 135 135 #define GPSR4_7 F_(SD3_CLK, IP9_31_28) 136 - #define GPSR4_6 F_(SD2_DS, IP9_23_20) 137 - #define GPSR4_5 F_(SD2_DAT3, IP9_19_16) 138 - #define GPSR4_4 F_(SD2_DAT2, IP9_15_12) 139 - #define GPSR4_3 F_(SD2_DAT1, IP9_11_8) 140 - #define GPSR4_2 F_(SD2_DAT0, IP9_7_4) 136 + #define GPSR4_6 F_(SD2_DS, IP9_27_24) 137 + #define GPSR4_5 F_(SD2_DAT3, IP9_23_20) 138 + #define GPSR4_4 F_(SD2_DAT2, IP9_19_16) 139 + #define GPSR4_3 F_(SD2_DAT1, IP9_15_12) 140 + #define GPSR4_2 F_(SD2_DAT0, IP9_11_8) 141 141 #define GPSR4_1 F_(SD2_CMD, IP9_7_4) 142 142 #define GPSR4_0 F_(SD2_CLK, IP9_3_0) 143 143 ··· 1490 1490 PINMUX_GPIO_GP_ALL(), 1491 1491 }; 1492 1492 1493 + /* - EtherAVB --------------------------------------------------------------- */ 1494 + static const unsigned int avb_link_pins[] = { 1495 + /* AVB_LINK */ 1496 + RCAR_GP_PIN(2, 12), 1497 + }; 1498 + static const unsigned int avb_link_mux[] = { 1499 + AVB_LINK_MARK, 1500 + }; 1501 + static const unsigned int avb_magic_pins[] = { 1502 + /* AVB_MAGIC_ */ 1503 + RCAR_GP_PIN(2, 10), 1504 + }; 1505 + static const unsigned int avb_magic_mux[] = { 1506 + AVB_MAGIC_MARK, 1507 + }; 1508 + static const unsigned int avb_phy_int_pins[] = { 1509 + /* AVB_PHY_INT */ 1510 + RCAR_GP_PIN(2, 11), 1511 + }; 1512 + static const unsigned int avb_phy_int_mux[] = { 1513 + AVB_PHY_INT_MARK, 1514 + }; 1515 + static const unsigned int avb_mdc_pins[] = { 1516 + /* AVB_MDC */ 1517 + RCAR_GP_PIN(2, 9), 1518 + }; 1519 + static const unsigned int avb_mdc_mux[] = { 1520 + AVB_MDC_MARK, 1521 + }; 1522 + static const unsigned int avb_avtp_pps_pins[] = { 1523 + /* AVB_AVTP_PPS */ 1524 + RCAR_GP_PIN(2, 6), 1525 + }; 1526 + static const unsigned int avb_avtp_pps_mux[] = { 1527 + AVB_AVTP_PPS_MARK, 1528 + }; 1529 + static const unsigned int avb_avtp_match_a_pins[] = { 1530 + /* AVB_AVTP_MATCH_A */ 1531 + RCAR_GP_PIN(2, 13), 1532 + }; 1533 + static const unsigned int avb_avtp_match_a_mux[] = { 1534 + AVB_AVTP_MATCH_A_MARK, 1535 + }; 1536 + static const unsigned int avb_avtp_capture_a_pins[] = { 1537 + /* AVB_AVTP_CAPTURE_A */ 1538 + RCAR_GP_PIN(2, 14), 1539 + }; 1540 + static const unsigned int avb_avtp_capture_a_mux[] = { 1541 + AVB_AVTP_CAPTURE_A_MARK, 1542 + }; 1543 + static const unsigned int avb_avtp_match_b_pins[] = { 1544 + /* AVB_AVTP_MATCH_B */ 1545 + RCAR_GP_PIN(1, 8), 1546 + }; 1547 + static const unsigned int avb_avtp_match_b_mux[] = { 1548 + AVB_AVTP_MATCH_B_MARK, 1549 + }; 1550 + static const unsigned int avb_avtp_capture_b_pins[] = { 1551 + /* AVB_AVTP_CAPTURE_B */ 1552 + RCAR_GP_PIN(1, 11), 1553 + }; 1554 + static const unsigned int avb_avtp_capture_b_mux[] = { 1555 + AVB_AVTP_CAPTURE_B_MARK, 1556 + }; 1557 + 1558 + /* - DRIF0 --------------------------------------------------------------- */ 1559 + static const unsigned int drif0_ctrl_a_pins[] = { 1560 + /* CLK, SYNC */ 1561 + RCAR_GP_PIN(6, 8), RCAR_GP_PIN(6, 9), 1562 + }; 1563 + static const unsigned int drif0_ctrl_a_mux[] = { 1564 + RIF0_CLK_A_MARK, RIF0_SYNC_A_MARK, 1565 + }; 1566 + static const unsigned int drif0_data0_a_pins[] = { 1567 + /* D0 */ 1568 + RCAR_GP_PIN(6, 10), 1569 + }; 1570 + static const unsigned int drif0_data0_a_mux[] = { 1571 + RIF0_D0_A_MARK, 1572 + }; 1573 + static const unsigned int drif0_data1_a_pins[] = { 1574 + /* D1 */ 1575 + RCAR_GP_PIN(6, 7), 1576 + }; 1577 + static const unsigned int drif0_data1_a_mux[] = { 1578 + RIF0_D1_A_MARK, 1579 + }; 1580 + static const unsigned int drif0_ctrl_b_pins[] = { 1581 + /* CLK, SYNC */ 1582 + RCAR_GP_PIN(5, 0), RCAR_GP_PIN(5, 4), 1583 + }; 1584 + static const unsigned int drif0_ctrl_b_mux[] = { 1585 + RIF0_CLK_B_MARK, RIF0_SYNC_B_MARK, 1586 + }; 1587 + static const unsigned int drif0_data0_b_pins[] = { 1588 + /* D0 */ 1589 + RCAR_GP_PIN(5, 1), 1590 + }; 1591 + static const unsigned int drif0_data0_b_mux[] = { 1592 + RIF0_D0_B_MARK, 1593 + }; 1594 + static const unsigned int drif0_data1_b_pins[] = { 1595 + /* D1 */ 1596 + RCAR_GP_PIN(5, 2), 1597 + }; 1598 + static const unsigned int drif0_data1_b_mux[] = { 1599 + RIF0_D1_B_MARK, 1600 + }; 1601 + static const unsigned int drif0_ctrl_c_pins[] = { 1602 + /* CLK, SYNC */ 1603 + RCAR_GP_PIN(5, 12), RCAR_GP_PIN(5, 15), 1604 + }; 1605 + static const unsigned int drif0_ctrl_c_mux[] = { 1606 + RIF0_CLK_C_MARK, RIF0_SYNC_C_MARK, 1607 + }; 1608 + static const unsigned int drif0_data0_c_pins[] = { 1609 + /* D0 */ 1610 + RCAR_GP_PIN(5, 13), 1611 + }; 1612 + static const unsigned int drif0_data0_c_mux[] = { 1613 + RIF0_D0_C_MARK, 1614 + }; 1615 + static const unsigned int drif0_data1_c_pins[] = { 1616 + /* D1 */ 1617 + RCAR_GP_PIN(5, 14), 1618 + }; 1619 + static const unsigned int drif0_data1_c_mux[] = { 1620 + RIF0_D1_C_MARK, 1621 + }; 1622 + /* - DRIF1 --------------------------------------------------------------- */ 1623 + static const unsigned int drif1_ctrl_a_pins[] = { 1624 + /* CLK, SYNC */ 1625 + RCAR_GP_PIN(6, 17), RCAR_GP_PIN(6, 18), 1626 + }; 1627 + static const unsigned int drif1_ctrl_a_mux[] = { 1628 + RIF1_CLK_A_MARK, RIF1_SYNC_A_MARK, 1629 + }; 1630 + static const unsigned int drif1_data0_a_pins[] = { 1631 + /* D0 */ 1632 + RCAR_GP_PIN(6, 19), 1633 + }; 1634 + static const unsigned int drif1_data0_a_mux[] = { 1635 + RIF1_D0_A_MARK, 1636 + }; 1637 + static const unsigned int drif1_data1_a_pins[] = { 1638 + /* D1 */ 1639 + RCAR_GP_PIN(6, 20), 1640 + }; 1641 + static const unsigned int drif1_data1_a_mux[] = { 1642 + RIF1_D1_A_MARK, 1643 + }; 1644 + static const unsigned int drif1_ctrl_b_pins[] = { 1645 + /* CLK, SYNC */ 1646 + RCAR_GP_PIN(5, 9), RCAR_GP_PIN(5, 3), 1647 + }; 1648 + static const unsigned int drif1_ctrl_b_mux[] = { 1649 + RIF1_CLK_B_MARK, RIF1_SYNC_B_MARK, 1650 + }; 1651 + static const unsigned int drif1_data0_b_pins[] = { 1652 + /* D0 */ 1653 + RCAR_GP_PIN(5, 7), 1654 + }; 1655 + static const unsigned int drif1_data0_b_mux[] = { 1656 + RIF1_D0_B_MARK, 1657 + }; 1658 + static const unsigned int drif1_data1_b_pins[] = { 1659 + /* D1 */ 1660 + RCAR_GP_PIN(5, 8), 1661 + }; 1662 + static const unsigned int drif1_data1_b_mux[] = { 1663 + RIF1_D1_B_MARK, 1664 + }; 1665 + static const unsigned int drif1_ctrl_c_pins[] = { 1666 + /* CLK, SYNC */ 1667 + RCAR_GP_PIN(5, 5), RCAR_GP_PIN(5, 11), 1668 + }; 1669 + static const unsigned int drif1_ctrl_c_mux[] = { 1670 + RIF1_CLK_C_MARK, RIF1_SYNC_C_MARK, 1671 + }; 1672 + static const unsigned int drif1_data0_c_pins[] = { 1673 + /* D0 */ 1674 + RCAR_GP_PIN(5, 6), 1675 + }; 1676 + static const unsigned int drif1_data0_c_mux[] = { 1677 + RIF1_D0_C_MARK, 1678 + }; 1679 + static const unsigned int drif1_data1_c_pins[] = { 1680 + /* D1 */ 1681 + RCAR_GP_PIN(5, 10), 1682 + }; 1683 + static const unsigned int drif1_data1_c_mux[] = { 1684 + RIF1_D1_C_MARK, 1685 + }; 1686 + /* - DRIF2 --------------------------------------------------------------- */ 1687 + static const unsigned int drif2_ctrl_a_pins[] = { 1688 + /* CLK, SYNC */ 1689 + RCAR_GP_PIN(6, 8), RCAR_GP_PIN(6, 9), 1690 + }; 1691 + static const unsigned int drif2_ctrl_a_mux[] = { 1692 + RIF2_CLK_A_MARK, RIF2_SYNC_A_MARK, 1693 + }; 1694 + static const unsigned int drif2_data0_a_pins[] = { 1695 + /* D0 */ 1696 + RCAR_GP_PIN(6, 7), 1697 + }; 1698 + static const unsigned int drif2_data0_a_mux[] = { 1699 + RIF2_D0_A_MARK, 1700 + }; 1701 + static const unsigned int drif2_data1_a_pins[] = { 1702 + /* D1 */ 1703 + RCAR_GP_PIN(6, 10), 1704 + }; 1705 + static const unsigned int drif2_data1_a_mux[] = { 1706 + RIF2_D1_A_MARK, 1707 + }; 1708 + static const unsigned int drif2_ctrl_b_pins[] = { 1709 + /* CLK, SYNC */ 1710 + RCAR_GP_PIN(6, 26), RCAR_GP_PIN(6, 27), 1711 + }; 1712 + static const unsigned int drif2_ctrl_b_mux[] = { 1713 + RIF2_CLK_B_MARK, RIF2_SYNC_B_MARK, 1714 + }; 1715 + static const unsigned int drif2_data0_b_pins[] = { 1716 + /* D0 */ 1717 + RCAR_GP_PIN(6, 30), 1718 + }; 1719 + static const unsigned int drif2_data0_b_mux[] = { 1720 + RIF2_D0_B_MARK, 1721 + }; 1722 + static const unsigned int drif2_data1_b_pins[] = { 1723 + /* D1 */ 1724 + RCAR_GP_PIN(6, 31), 1725 + }; 1726 + static const unsigned int drif2_data1_b_mux[] = { 1727 + RIF2_D1_B_MARK, 1728 + }; 1729 + /* - DRIF3 --------------------------------------------------------------- */ 1730 + static const unsigned int drif3_ctrl_a_pins[] = { 1731 + /* CLK, SYNC */ 1732 + RCAR_GP_PIN(6, 17), RCAR_GP_PIN(6, 18), 1733 + }; 1734 + static const unsigned int drif3_ctrl_a_mux[] = { 1735 + RIF3_CLK_A_MARK, RIF3_SYNC_A_MARK, 1736 + }; 1737 + static const unsigned int drif3_data0_a_pins[] = { 1738 + /* D0 */ 1739 + RCAR_GP_PIN(6, 19), 1740 + }; 1741 + static const unsigned int drif3_data0_a_mux[] = { 1742 + RIF3_D0_A_MARK, 1743 + }; 1744 + static const unsigned int drif3_data1_a_pins[] = { 1745 + /* D1 */ 1746 + RCAR_GP_PIN(6, 20), 1747 + }; 1748 + static const unsigned int drif3_data1_a_mux[] = { 1749 + RIF3_D1_A_MARK, 1750 + }; 1751 + static const unsigned int drif3_ctrl_b_pins[] = { 1752 + /* CLK, SYNC */ 1753 + RCAR_GP_PIN(6, 24), RCAR_GP_PIN(6, 25), 1754 + }; 1755 + static const unsigned int drif3_ctrl_b_mux[] = { 1756 + RIF3_CLK_B_MARK, RIF3_SYNC_B_MARK, 1757 + }; 1758 + static const unsigned int drif3_data0_b_pins[] = { 1759 + /* D0 */ 1760 + RCAR_GP_PIN(6, 28), 1761 + }; 1762 + static const unsigned int drif3_data0_b_mux[] = { 1763 + RIF3_D0_B_MARK, 1764 + }; 1765 + static const unsigned int drif3_data1_b_pins[] = { 1766 + /* D1 */ 1767 + RCAR_GP_PIN(6, 29), 1768 + }; 1769 + static const unsigned int drif3_data1_b_mux[] = { 1770 + RIF3_D1_B_MARK, 1771 + }; 1772 + 1773 + /* - DU --------------------------------------------------------------------- */ 1774 + static const unsigned int du_rgb666_pins[] = { 1775 + /* R[7:2], G[7:2], B[7:2] */ 1776 + RCAR_GP_PIN(0, 15), RCAR_GP_PIN(0, 14), RCAR_GP_PIN(0, 13), 1777 + RCAR_GP_PIN(0, 12), RCAR_GP_PIN(0, 11), RCAR_GP_PIN(0, 10), 1778 + RCAR_GP_PIN(1, 15), RCAR_GP_PIN(1, 14), RCAR_GP_PIN(1, 13), 1779 + RCAR_GP_PIN(1, 12), RCAR_GP_PIN(1, 19), RCAR_GP_PIN(1, 18), 1780 + RCAR_GP_PIN(1, 7), RCAR_GP_PIN(1, 6), RCAR_GP_PIN(1, 5), 1781 + RCAR_GP_PIN(1, 4), RCAR_GP_PIN(1, 3), RCAR_GP_PIN(1, 2), 1782 + }; 1783 + static const unsigned int du_rgb666_mux[] = { 1784 + DU_DR7_MARK, DU_DR6_MARK, DU_DR5_MARK, DU_DR4_MARK, 1785 + DU_DR3_MARK, DU_DR2_MARK, 1786 + DU_DG7_MARK, DU_DG6_MARK, DU_DG5_MARK, DU_DG4_MARK, 1787 + DU_DG3_MARK, DU_DG2_MARK, 1788 + DU_DB7_MARK, DU_DB6_MARK, DU_DB5_MARK, DU_DB4_MARK, 1789 + DU_DB3_MARK, DU_DB2_MARK, 1790 + }; 1791 + static const unsigned int du_rgb888_pins[] = { 1792 + /* R[7:0], G[7:0], B[7:0] */ 1793 + RCAR_GP_PIN(0, 15), RCAR_GP_PIN(0, 14), RCAR_GP_PIN(0, 13), 1794 + RCAR_GP_PIN(0, 12), RCAR_GP_PIN(0, 11), RCAR_GP_PIN(0, 10), 1795 + RCAR_GP_PIN(0, 9), RCAR_GP_PIN(0, 8), 1796 + RCAR_GP_PIN(1, 15), RCAR_GP_PIN(1, 14), RCAR_GP_PIN(1, 13), 1797 + RCAR_GP_PIN(1, 12), RCAR_GP_PIN(1, 19), RCAR_GP_PIN(1, 18), 1798 + RCAR_GP_PIN(1, 17), RCAR_GP_PIN(1, 16), 1799 + RCAR_GP_PIN(1, 7), RCAR_GP_PIN(1, 6), RCAR_GP_PIN(1, 5), 1800 + RCAR_GP_PIN(1, 4), RCAR_GP_PIN(1, 3), RCAR_GP_PIN(1, 2), 1801 + RCAR_GP_PIN(1, 1), RCAR_GP_PIN(1, 0), 1802 + }; 1803 + static const unsigned int du_rgb888_mux[] = { 1804 + DU_DR7_MARK, DU_DR6_MARK, DU_DR5_MARK, DU_DR4_MARK, 1805 + DU_DR3_MARK, DU_DR2_MARK, DU_DR1_MARK, DU_DR0_MARK, 1806 + DU_DG7_MARK, DU_DG6_MARK, DU_DG5_MARK, DU_DG4_MARK, 1807 + DU_DG3_MARK, DU_DG2_MARK, DU_DG1_MARK, DU_DG0_MARK, 1808 + DU_DB7_MARK, DU_DB6_MARK, DU_DB5_MARK, DU_DB4_MARK, 1809 + DU_DB3_MARK, DU_DB2_MARK, DU_DB1_MARK, DU_DB0_MARK, 1810 + }; 1811 + static const unsigned int du_clk_out_0_pins[] = { 1812 + /* CLKOUT */ 1813 + RCAR_GP_PIN(1, 27), 1814 + }; 1815 + static const unsigned int du_clk_out_0_mux[] = { 1816 + DU_DOTCLKOUT0_MARK 1817 + }; 1818 + static const unsigned int du_clk_out_1_pins[] = { 1819 + /* CLKOUT */ 1820 + RCAR_GP_PIN(2, 3), 1821 + }; 1822 + static const unsigned int du_clk_out_1_mux[] = { 1823 + DU_DOTCLKOUT1_MARK 1824 + }; 1825 + static const unsigned int du_sync_pins[] = { 1826 + /* EXVSYNC/VSYNC, EXHSYNC/HSYNC */ 1827 + RCAR_GP_PIN(2, 5), RCAR_GP_PIN(2, 4), 1828 + }; 1829 + static const unsigned int du_sync_mux[] = { 1830 + DU_EXVSYNC_DU_VSYNC_MARK, DU_EXHSYNC_DU_HSYNC_MARK 1831 + }; 1832 + static const unsigned int du_oddf_pins[] = { 1833 + /* EXDISP/EXODDF/EXCDE */ 1834 + RCAR_GP_PIN(2, 2), 1835 + }; 1836 + static const unsigned int du_oddf_mux[] = { 1837 + DU_EXODDF_DU_ODDF_DISP_CDE_MARK, 1838 + }; 1839 + static const unsigned int du_cde_pins[] = { 1840 + /* CDE */ 1841 + RCAR_GP_PIN(2, 0), 1842 + }; 1843 + static const unsigned int du_cde_mux[] = { 1844 + DU_CDE_MARK, 1845 + }; 1846 + static const unsigned int du_disp_pins[] = { 1847 + /* DISP */ 1848 + RCAR_GP_PIN(2, 1), 1849 + }; 1850 + static const unsigned int du_disp_mux[] = { 1851 + DU_DISP_MARK, 1852 + }; 1853 + 1854 + /* - I2C -------------------------------------------------------------------- */ 1855 + static const unsigned int i2c1_a_pins[] = { 1856 + /* SDA, SCL */ 1857 + RCAR_GP_PIN(5, 11), RCAR_GP_PIN(5, 10), 1858 + }; 1859 + static const unsigned int i2c1_a_mux[] = { 1860 + SDA1_A_MARK, SCL1_A_MARK, 1861 + }; 1862 + static const unsigned int i2c1_b_pins[] = { 1863 + /* SDA, SCL */ 1864 + RCAR_GP_PIN(5, 24), RCAR_GP_PIN(5, 23), 1865 + }; 1866 + static const unsigned int i2c1_b_mux[] = { 1867 + SDA1_B_MARK, SCL1_B_MARK, 1868 + }; 1869 + static const unsigned int i2c2_a_pins[] = { 1870 + /* SDA, SCL */ 1871 + RCAR_GP_PIN(5, 0), RCAR_GP_PIN(5, 4), 1872 + }; 1873 + static const unsigned int i2c2_a_mux[] = { 1874 + SDA2_A_MARK, SCL2_A_MARK, 1875 + }; 1876 + static const unsigned int i2c2_b_pins[] = { 1877 + /* SDA, SCL */ 1878 + RCAR_GP_PIN(3, 13), RCAR_GP_PIN(3, 12), 1879 + }; 1880 + static const unsigned int i2c2_b_mux[] = { 1881 + SDA2_B_MARK, SCL2_B_MARK, 1882 + }; 1883 + static const unsigned int i2c6_a_pins[] = { 1884 + /* SDA, SCL */ 1885 + RCAR_GP_PIN(1, 8), RCAR_GP_PIN(1, 11), 1886 + }; 1887 + static const unsigned int i2c6_a_mux[] = { 1888 + SDA6_A_MARK, SCL6_A_MARK, 1889 + }; 1890 + static const unsigned int i2c6_b_pins[] = { 1891 + /* SDA, SCL */ 1892 + RCAR_GP_PIN(1, 26), RCAR_GP_PIN(1, 25), 1893 + }; 1894 + static const unsigned int i2c6_b_mux[] = { 1895 + SDA6_B_MARK, SCL6_B_MARK, 1896 + }; 1897 + static const unsigned int i2c6_c_pins[] = { 1898 + /* SDA, SCL */ 1899 + RCAR_GP_PIN(0, 15), RCAR_GP_PIN(0, 14), 1900 + }; 1901 + static const unsigned int i2c6_c_mux[] = { 1902 + SDA6_C_MARK, SCL6_C_MARK, 1903 + }; 1904 + 1493 1905 /* - SCIF0 ------------------------------------------------------------------ */ 1494 1906 static const unsigned int scif0_data_pins[] = { 1495 1907 /* RX, TX */ ··· 2324 1912 }; 2325 1913 2326 1914 static const struct sh_pfc_pin_group pinmux_groups[] = { 1915 + SH_PFC_PIN_GROUP(avb_link), 1916 + SH_PFC_PIN_GROUP(avb_magic), 1917 + SH_PFC_PIN_GROUP(avb_phy_int), 1918 + SH_PFC_PIN_GROUP(avb_mdc), 1919 + SH_PFC_PIN_GROUP(avb_avtp_pps), 1920 + SH_PFC_PIN_GROUP(avb_avtp_match_a), 1921 + SH_PFC_PIN_GROUP(avb_avtp_capture_a), 1922 + SH_PFC_PIN_GROUP(avb_avtp_match_b), 1923 + SH_PFC_PIN_GROUP(avb_avtp_capture_b), 1924 + SH_PFC_PIN_GROUP(drif0_ctrl_a), 1925 + SH_PFC_PIN_GROUP(drif0_data0_a), 1926 + SH_PFC_PIN_GROUP(drif0_data1_a), 1927 + SH_PFC_PIN_GROUP(drif0_ctrl_b), 1928 + SH_PFC_PIN_GROUP(drif0_data0_b), 1929 + SH_PFC_PIN_GROUP(drif0_data1_b), 1930 + SH_PFC_PIN_GROUP(drif0_ctrl_c), 1931 + SH_PFC_PIN_GROUP(drif0_data0_c), 1932 + SH_PFC_PIN_GROUP(drif0_data1_c), 1933 + SH_PFC_PIN_GROUP(drif1_ctrl_a), 1934 + SH_PFC_PIN_GROUP(drif1_data0_a), 1935 + SH_PFC_PIN_GROUP(drif1_data1_a), 1936 + SH_PFC_PIN_GROUP(drif1_ctrl_b), 1937 + SH_PFC_PIN_GROUP(drif1_data0_b), 1938 + SH_PFC_PIN_GROUP(drif1_data1_b), 1939 + SH_PFC_PIN_GROUP(drif1_ctrl_c), 1940 + SH_PFC_PIN_GROUP(drif1_data0_c), 1941 + SH_PFC_PIN_GROUP(drif1_data1_c), 1942 + SH_PFC_PIN_GROUP(drif2_ctrl_a), 1943 + SH_PFC_PIN_GROUP(drif2_data0_a), 1944 + SH_PFC_PIN_GROUP(drif2_data1_a), 1945 + SH_PFC_PIN_GROUP(drif2_ctrl_b), 1946 + SH_PFC_PIN_GROUP(drif2_data0_b), 1947 + SH_PFC_PIN_GROUP(drif2_data1_b), 1948 + SH_PFC_PIN_GROUP(drif3_ctrl_a), 1949 + SH_PFC_PIN_GROUP(drif3_data0_a), 1950 + SH_PFC_PIN_GROUP(drif3_data1_a), 1951 + SH_PFC_PIN_GROUP(drif3_ctrl_b), 1952 + SH_PFC_PIN_GROUP(drif3_data0_b), 1953 + SH_PFC_PIN_GROUP(drif3_data1_b), 1954 + SH_PFC_PIN_GROUP(du_rgb666), 1955 + SH_PFC_PIN_GROUP(du_rgb888), 1956 + SH_PFC_PIN_GROUP(du_clk_out_0), 1957 + SH_PFC_PIN_GROUP(du_clk_out_1), 1958 + SH_PFC_PIN_GROUP(du_sync), 1959 + SH_PFC_PIN_GROUP(du_oddf), 1960 + SH_PFC_PIN_GROUP(du_cde), 1961 + SH_PFC_PIN_GROUP(du_disp), 1962 + SH_PFC_PIN_GROUP(i2c1_a), 1963 + SH_PFC_PIN_GROUP(i2c1_b), 1964 + SH_PFC_PIN_GROUP(i2c2_a), 1965 + SH_PFC_PIN_GROUP(i2c2_b), 1966 + SH_PFC_PIN_GROUP(i2c6_a), 1967 + SH_PFC_PIN_GROUP(i2c6_b), 1968 + SH_PFC_PIN_GROUP(i2c6_c), 2327 1969 SH_PFC_PIN_GROUP(scif0_data), 2328 1970 SH_PFC_PIN_GROUP(scif0_clk), 2329 1971 SH_PFC_PIN_GROUP(scif0_ctrl), ··· 2433 1967 SH_PFC_PIN_GROUP(sdhi3_cd), 2434 1968 SH_PFC_PIN_GROUP(sdhi3_wp), 2435 1969 SH_PFC_PIN_GROUP(sdhi3_ds), 1970 + }; 1971 + 1972 + static const char * const avb_groups[] = { 1973 + "avb_link", 1974 + "avb_magic", 1975 + "avb_phy_int", 1976 + "avb_mdc", 1977 + "avb_avtp_pps", 1978 + "avb_avtp_match_a", 1979 + "avb_avtp_capture_a", 1980 + "avb_avtp_match_b", 1981 + "avb_avtp_capture_b", 1982 + }; 1983 + 1984 + static const char * const drif0_groups[] = { 1985 + "drif0_ctrl_a", 1986 + "drif0_data0_a", 1987 + "drif0_data1_a", 1988 + "drif0_ctrl_b", 1989 + "drif0_data0_b", 1990 + "drif0_data1_b", 1991 + "drif0_ctrl_c", 1992 + "drif0_data0_c", 1993 + "drif0_data1_c", 1994 + }; 1995 + 1996 + static const char * const drif1_groups[] = { 1997 + "drif1_ctrl_a", 1998 + "drif1_data0_a", 1999 + "drif1_data1_a", 2000 + "drif1_ctrl_b", 2001 + "drif1_data0_b", 2002 + "drif1_data1_b", 2003 + "drif1_ctrl_c", 2004 + "drif1_data0_c", 2005 + "drif1_data1_c", 2006 + }; 2007 + 2008 + static const char * const drif2_groups[] = { 2009 + "drif2_ctrl_a", 2010 + "drif2_data0_a", 2011 + "drif2_data1_a", 2012 + "drif2_ctrl_b", 2013 + "drif2_data0_b", 2014 + "drif2_data1_b", 2015 + }; 2016 + 2017 + static const char * const drif3_groups[] = { 2018 + "drif3_ctrl_a", 2019 + "drif3_data0_a", 2020 + "drif3_data1_a", 2021 + "drif3_ctrl_b", 2022 + "drif3_data0_b", 2023 + "drif3_data1_b", 2024 + }; 2025 + 2026 + static const char * const du_groups[] = { 2027 + "du_rgb666", 2028 + "du_rgb888", 2029 + "du_clk_out_0", 2030 + "du_clk_out_1", 2031 + "du_sync", 2032 + "du_oddf", 2033 + "du_cde", 2034 + "du_disp", 2035 + }; 2036 + 2037 + static const char * const i2c1_groups[] = { 2038 + "i2c1_a", 2039 + "i2c1_b", 2040 + }; 2041 + 2042 + static const char * const i2c2_groups[] = { 2043 + "i2c2_a", 2044 + "i2c2_b", 2045 + }; 2046 + 2047 + static const char * const i2c6_groups[] = { 2048 + "i2c6_a", 2049 + "i2c6_b", 2050 + "i2c6_c", 2436 2051 }; 2437 2052 2438 2053 static const char * const scif0_groups[] = { ··· 2605 2058 }; 2606 2059 2607 2060 static const struct sh_pfc_function pinmux_functions[] = { 2061 + SH_PFC_FUNCTION(avb), 2062 + SH_PFC_FUNCTION(drif0), 2063 + SH_PFC_FUNCTION(drif1), 2064 + SH_PFC_FUNCTION(drif2), 2065 + SH_PFC_FUNCTION(drif3), 2066 + SH_PFC_FUNCTION(du), 2067 + SH_PFC_FUNCTION(i2c1), 2068 + SH_PFC_FUNCTION(i2c2), 2069 + SH_PFC_FUNCTION(i2c6), 2608 2070 SH_PFC_FUNCTION(scif0), 2609 2071 SH_PFC_FUNCTION(scif1), 2610 2072 SH_PFC_FUNCTION(scif2),
+2 -1
drivers/pinctrl/sh-pfc/pinctrl.c
··· 570 570 571 571 switch (param) { 572 572 case PIN_CONFIG_BIAS_DISABLE: 573 - return true; 573 + return pin->configs & 574 + (SH_PFC_PIN_CFG_PULL_UP | SH_PFC_PIN_CFG_PULL_DOWN); 574 575 575 576 case PIN_CONFIG_BIAS_PULL_UP: 576 577 return pin->configs & SH_PFC_PIN_CFG_PULL_UP;
+14
drivers/pinctrl/sh-pfc/sh_pfc.h
··· 189 189 unsigned long size; 190 190 }; 191 191 192 + struct sh_pfc_bias_info { 193 + u16 pin; 194 + u16 reg : 11; 195 + u16 bit : 5; 196 + }; 197 + 192 198 struct sh_pfc_pin_range; 193 199 194 200 struct sh_pfc { ··· 544 538 .pin = PIN_NUMBER(row, col), \ 545 539 .name = __stringify(PIN_##_name), \ 546 540 .configs = SH_PFC_PIN_CFG_NO_GPIO, \ 541 + } 542 + 543 + /* SH_PFC_PIN_NAMED_CFG - Expand to a sh_pfc_pin entry with the given name */ 544 + #define SH_PFC_PIN_NAMED_CFG(row, col, _name, cfgs) \ 545 + { \ 546 + .pin = PIN_NUMBER(row, col), \ 547 + .name = __stringify(PIN_##_name), \ 548 + .configs = SH_PFC_PIN_CFG_NO_GPIO | cfgs, \ 547 549 } 548 550 549 551 /* PINMUX_DATA_ALL - Expand to a list of PORT_name_DATA, PORT_name_FN0,
+1 -5
drivers/pinctrl/stm32/pinctrl-stm32f429.c
··· 1584 1584 }, 1585 1585 }; 1586 1586 1587 - static int __init stm32f429_pinctrl_init(void) 1588 - { 1589 - return platform_driver_register(&stm32f429_pinctrl_driver); 1590 - } 1591 - device_initcall(stm32f429_pinctrl_init); 1587 + builtin_platform_driver(stm32f429_pinctrl_driver);
+2 -7
drivers/pinctrl/sunxi/pinctrl-gr8.c
··· 12 12 * warranty of any kind, whether express or implied. 13 13 */ 14 14 15 - #include <linux/module.h> 15 + #include <linux/init.h> 16 16 #include <linux/platform_device.h> 17 17 #include <linux/of.h> 18 18 #include <linux/of_device.h> ··· 525 525 { .compatible = "nextthing,gr8-pinctrl", }, 526 526 {} 527 527 }; 528 - MODULE_DEVICE_TABLE(of, sun5i_gr8_pinctrl_match); 529 528 530 529 static struct platform_driver sun5i_gr8_pinctrl_driver = { 531 530 .probe = sun5i_gr8_pinctrl_probe, ··· 533 534 .of_match_table = sun5i_gr8_pinctrl_match, 534 535 }, 535 536 }; 536 - module_platform_driver(sun5i_gr8_pinctrl_driver); 537 - 538 - MODULE_AUTHOR("Mylene Josserand <mylene.josserand@free-electrons.com"); 539 - MODULE_DESCRIPTION("NextThing GR8 pinctrl driver"); 540 - MODULE_LICENSE("GPL"); 537 + builtin_platform_driver(sun5i_gr8_pinctrl_driver);
+2 -7
drivers/pinctrl/sunxi/pinctrl-sun4i-a10.c
··· 10 10 * warranty of any kind, whether express or implied. 11 11 */ 12 12 13 - #include <linux/module.h> 13 + #include <linux/init.h> 14 14 #include <linux/platform_device.h> 15 15 #include <linux/of.h> 16 16 #include <linux/of_device.h> ··· 1035 1035 { .compatible = "allwinner,sun4i-a10-pinctrl", }, 1036 1036 {} 1037 1037 }; 1038 - MODULE_DEVICE_TABLE(of, sun4i_a10_pinctrl_match); 1039 1038 1040 1039 static struct platform_driver sun4i_a10_pinctrl_driver = { 1041 1040 .probe = sun4i_a10_pinctrl_probe, ··· 1043 1044 .of_match_table = sun4i_a10_pinctrl_match, 1044 1045 }, 1045 1046 }; 1046 - module_platform_driver(sun4i_a10_pinctrl_driver); 1047 - 1048 - MODULE_AUTHOR("Maxime Ripard <maxime.ripard@free-electrons.com"); 1049 - MODULE_DESCRIPTION("Allwinner A10 pinctrl driver"); 1050 - MODULE_LICENSE("GPL"); 1047 + builtin_platform_driver(sun4i_a10_pinctrl_driver);
+2 -7
drivers/pinctrl/sunxi/pinctrl-sun5i-a10s.c
··· 10 10 * warranty of any kind, whether express or implied. 11 11 */ 12 12 13 - #include <linux/module.h> 13 + #include <linux/init.h> 14 14 #include <linux/platform_device.h> 15 15 #include <linux/of.h> 16 16 #include <linux/of_device.h> ··· 674 674 { .compatible = "allwinner,sun5i-a10s-pinctrl", }, 675 675 {} 676 676 }; 677 - MODULE_DEVICE_TABLE(of, sun5i_a10s_pinctrl_match); 678 677 679 678 static struct platform_driver sun5i_a10s_pinctrl_driver = { 680 679 .probe = sun5i_a10s_pinctrl_probe, ··· 682 683 .of_match_table = sun5i_a10s_pinctrl_match, 683 684 }, 684 685 }; 685 - module_platform_driver(sun5i_a10s_pinctrl_driver); 686 - 687 - MODULE_AUTHOR("Maxime Ripard <maxime.ripard@free-electrons.com"); 688 - MODULE_DESCRIPTION("Allwinner A10s pinctrl driver"); 689 - MODULE_LICENSE("GPL"); 686 + builtin_platform_driver(sun5i_a10s_pinctrl_driver);
+2 -7
drivers/pinctrl/sunxi/pinctrl-sun5i-a13.c
··· 10 10 * warranty of any kind, whether express or implied. 11 11 */ 12 12 13 - #include <linux/module.h> 13 + #include <linux/init.h> 14 14 #include <linux/platform_device.h> 15 15 #include <linux/of.h> 16 16 #include <linux/of_device.h> ··· 392 392 { .compatible = "allwinner,sun5i-a13-pinctrl", }, 393 393 {} 394 394 }; 395 - MODULE_DEVICE_TABLE(of, sun5i_a13_pinctrl_match); 396 395 397 396 static struct platform_driver sun5i_a13_pinctrl_driver = { 398 397 .probe = sun5i_a13_pinctrl_probe, ··· 400 401 .of_match_table = sun5i_a13_pinctrl_match, 401 402 }, 402 403 }; 403 - module_platform_driver(sun5i_a13_pinctrl_driver); 404 - 405 - MODULE_AUTHOR("Maxime Ripard <maxime.ripard@free-electrons.com"); 406 - MODULE_DESCRIPTION("Allwinner A13 pinctrl driver"); 407 - MODULE_LICENSE("GPL"); 404 + builtin_platform_driver(sun5i_a13_pinctrl_driver);
+2 -8
drivers/pinctrl/sunxi/pinctrl-sun6i-a31-r.c
··· 12 12 * warranty of any kind, whether express or implied. 13 13 */ 14 14 15 - #include <linux/module.h> 15 + #include <linux/init.h> 16 16 #include <linux/platform_device.h> 17 17 #include <linux/of.h> 18 18 #include <linux/of_device.h> ··· 136 136 { .compatible = "allwinner,sun6i-a31-r-pinctrl", }, 137 137 {} 138 138 }; 139 - MODULE_DEVICE_TABLE(of, sun6i_a31_r_pinctrl_match); 140 139 141 140 static struct platform_driver sun6i_a31_r_pinctrl_driver = { 142 141 .probe = sun6i_a31_r_pinctrl_probe, ··· 144 145 .of_match_table = sun6i_a31_r_pinctrl_match, 145 146 }, 146 147 }; 147 - module_platform_driver(sun6i_a31_r_pinctrl_driver); 148 - 149 - MODULE_AUTHOR("Boris Brezillon <boris.brezillon@free-electrons.com"); 150 - MODULE_AUTHOR("Maxime Ripard <maxime.ripard@free-electrons.com"); 151 - MODULE_DESCRIPTION("Allwinner A31 R_PIO pinctrl driver"); 152 - MODULE_LICENSE("GPL"); 148 + builtin_platform_driver(sun6i_a31_r_pinctrl_driver);
+2 -7
drivers/pinctrl/sunxi/pinctrl-sun6i-a31.c
··· 10 10 * warranty of any kind, whether express or implied. 11 11 */ 12 12 13 - #include <linux/module.h> 13 + #include <linux/init.h> 14 14 #include <linux/platform_device.h> 15 15 #include <linux/of.h> 16 16 #include <linux/of_device.h> ··· 934 934 { .compatible = "allwinner,sun6i-a31-pinctrl", }, 935 935 {} 936 936 }; 937 - MODULE_DEVICE_TABLE(of, sun6i_a31_pinctrl_match); 938 937 939 938 static struct platform_driver sun6i_a31_pinctrl_driver = { 940 939 .probe = sun6i_a31_pinctrl_probe, ··· 942 943 .of_match_table = sun6i_a31_pinctrl_match, 943 944 }, 944 945 }; 945 - module_platform_driver(sun6i_a31_pinctrl_driver); 946 - 947 - MODULE_AUTHOR("Maxime Ripard <maxime.ripard@free-electrons.com"); 948 - MODULE_DESCRIPTION("Allwinner A31 pinctrl driver"); 949 - MODULE_LICENSE("GPL"); 946 + builtin_platform_driver(sun6i_a31_pinctrl_driver);
+2 -7
drivers/pinctrl/sunxi/pinctrl-sun6i-a31s.c
··· 11 11 * warranty of any kind, whether express or implied. 12 12 */ 13 13 14 - #include <linux/module.h> 14 + #include <linux/init.h> 15 15 #include <linux/platform_device.h> 16 16 #include <linux/of.h> 17 17 #include <linux/of_device.h> ··· 798 798 { .compatible = "allwinner,sun6i-a31s-pinctrl", }, 799 799 {} 800 800 }; 801 - MODULE_DEVICE_TABLE(of, sun6i_a31s_pinctrl_match); 802 801 803 802 static struct platform_driver sun6i_a31s_pinctrl_driver = { 804 803 .probe = sun6i_a31s_pinctrl_probe, ··· 806 807 .of_match_table = sun6i_a31s_pinctrl_match, 807 808 }, 808 809 }; 809 - module_platform_driver(sun6i_a31s_pinctrl_driver); 810 - 811 - MODULE_AUTHOR("Hans de Goede <hdegoede@redhat.com>"); 812 - MODULE_DESCRIPTION("Allwinner A31s pinctrl driver"); 813 - MODULE_LICENSE("GPL"); 810 + builtin_platform_driver(sun6i_a31s_pinctrl_driver);
+2 -7
drivers/pinctrl/sunxi/pinctrl-sun7i-a20.c
··· 10 10 * warranty of any kind, whether express or implied. 11 11 */ 12 12 13 - #include <linux/module.h> 13 + #include <linux/init.h> 14 14 #include <linux/platform_device.h> 15 15 #include <linux/of.h> 16 16 #include <linux/of_device.h> ··· 1045 1045 { .compatible = "allwinner,sun7i-a20-pinctrl", }, 1046 1046 {} 1047 1047 }; 1048 - MODULE_DEVICE_TABLE(of, sun7i_a20_pinctrl_match); 1049 1048 1050 1049 static struct platform_driver sun7i_a20_pinctrl_driver = { 1051 1050 .probe = sun7i_a20_pinctrl_probe, ··· 1053 1054 .of_match_table = sun7i_a20_pinctrl_match, 1054 1055 }, 1055 1056 }; 1056 - module_platform_driver(sun7i_a20_pinctrl_driver); 1057 - 1058 - MODULE_AUTHOR("Maxime Ripard <maxime.ripard@free-electrons.com"); 1059 - MODULE_DESCRIPTION("Allwinner A20 pinctrl driver"); 1060 - MODULE_LICENSE("GPL"); 1057 + builtin_platform_driver(sun7i_a20_pinctrl_driver);
+2 -9
drivers/pinctrl/sunxi/pinctrl-sun8i-a23-r.c
··· 15 15 * warranty of any kind, whether express or implied. 16 16 */ 17 17 18 - #include <linux/module.h> 18 + #include <linux/init.h> 19 19 #include <linux/platform_device.h> 20 20 #include <linux/of.h> 21 21 #include <linux/of_device.h> ··· 123 123 { .compatible = "allwinner,sun8i-a23-r-pinctrl", }, 124 124 {} 125 125 }; 126 - MODULE_DEVICE_TABLE(of, sun8i_a23_r_pinctrl_match); 127 126 128 127 static struct platform_driver sun8i_a23_r_pinctrl_driver = { 129 128 .probe = sun8i_a23_r_pinctrl_probe, ··· 131 132 .of_match_table = sun8i_a23_r_pinctrl_match, 132 133 }, 133 134 }; 134 - module_platform_driver(sun8i_a23_r_pinctrl_driver); 135 - 136 - MODULE_AUTHOR("Chen-Yu Tsai <wens@csie.org>"); 137 - MODULE_AUTHOR("Boris Brezillon <boris.brezillon@free-electrons.com"); 138 - MODULE_AUTHOR("Maxime Ripard <maxime.ripard@free-electrons.com"); 139 - MODULE_DESCRIPTION("Allwinner A23 R_PIO pinctrl driver"); 140 - MODULE_LICENSE("GPL"); 135 + builtin_platform_driver(sun8i_a23_r_pinctrl_driver);
+2 -8
drivers/pinctrl/sunxi/pinctrl-sun8i-a23.c
··· 14 14 * warranty of any kind, whether express or implied. 15 15 */ 16 16 17 - #include <linux/module.h> 17 + #include <linux/init.h> 18 18 #include <linux/platform_device.h> 19 19 #include <linux/of.h> 20 20 #include <linux/of_device.h> ··· 575 575 { .compatible = "allwinner,sun8i-a23-pinctrl", }, 576 576 {} 577 577 }; 578 - MODULE_DEVICE_TABLE(of, sun8i_a23_pinctrl_match); 579 578 580 579 static struct platform_driver sun8i_a23_pinctrl_driver = { 581 580 .probe = sun8i_a23_pinctrl_probe, ··· 583 584 .of_match_table = sun8i_a23_pinctrl_match, 584 585 }, 585 586 }; 586 - module_platform_driver(sun8i_a23_pinctrl_driver); 587 - 588 - MODULE_AUTHOR("Chen-Yu Tsai <wens@csie.org>"); 589 - MODULE_AUTHOR("Maxime Ripard <maxime.ripard@free-electrons.com"); 590 - MODULE_DESCRIPTION("Allwinner A23 pinctrl driver"); 591 - MODULE_LICENSE("GPL"); 587 + builtin_platform_driver(sun8i_a23_pinctrl_driver);
+2 -7
drivers/pinctrl/sunxi/pinctrl-sun8i-a33.c
··· 12 12 * warranty of any kind, whether express or implied. 13 13 */ 14 14 15 - #include <linux/module.h> 15 + #include <linux/init.h> 16 16 #include <linux/platform_device.h> 17 17 #include <linux/of.h> 18 18 #include <linux/of_device.h> ··· 498 498 { .compatible = "allwinner,sun8i-a33-pinctrl", }, 499 499 {} 500 500 }; 501 - MODULE_DEVICE_TABLE(of, sun8i_a33_pinctrl_match); 502 501 503 502 static struct platform_driver sun8i_a33_pinctrl_driver = { 504 503 .probe = sun8i_a33_pinctrl_probe, ··· 506 507 .of_match_table = sun8i_a33_pinctrl_match, 507 508 }, 508 509 }; 509 - module_platform_driver(sun8i_a33_pinctrl_driver); 510 - 511 - MODULE_AUTHOR("Vishnu Patekar <vishnupatekar0510@gmail.com>"); 512 - MODULE_DESCRIPTION("Allwinner a33 pinctrl driver"); 513 - MODULE_LICENSE("GPL"); 510 + builtin_platform_driver(sun8i_a33_pinctrl_driver);
+2 -7
drivers/pinctrl/sunxi/pinctrl-sun8i-a83t.c
··· 12 12 * warranty of any kind, whether express or implied. 13 13 */ 14 14 15 - #include <linux/module.h> 15 + #include <linux/init.h> 16 16 #include <linux/platform_device.h> 17 17 #include <linux/of.h> 18 18 #include <linux/of_device.h> ··· 587 587 { .compatible = "allwinner,sun8i-a83t-pinctrl", }, 588 588 {} 589 589 }; 590 - MODULE_DEVICE_TABLE(of, sun8i_a83t_pinctrl_match); 591 590 592 591 static struct platform_driver sun8i_a83t_pinctrl_driver = { 593 592 .probe = sun8i_a83t_pinctrl_probe, ··· 595 596 .of_match_table = sun8i_a83t_pinctrl_match, 596 597 }, 597 598 }; 598 - module_platform_driver(sun8i_a83t_pinctrl_driver); 599 - 600 - MODULE_AUTHOR("Vishnu Patekar <vishnupatekar0510@gmail.com>"); 601 - MODULE_DESCRIPTION("Allwinner a83t pinctrl driver"); 602 - MODULE_LICENSE("GPL"); 599 + builtin_platform_driver(sun8i_a83t_pinctrl_driver);
+2 -7
drivers/pinctrl/sunxi/pinctrl-sun9i-a80.c
··· 10 10 * warranty of any kind, whether express or implied. 11 11 */ 12 12 13 - #include <linux/module.h> 13 + #include <linux/init.h> 14 14 #include <linux/platform_device.h> 15 15 #include <linux/of.h> 16 16 #include <linux/of_device.h> ··· 733 733 { .compatible = "allwinner,sun9i-a80-pinctrl", }, 734 734 {} 735 735 }; 736 - MODULE_DEVICE_TABLE(of, sun9i_a80_pinctrl_match); 737 736 738 737 static struct platform_driver sun9i_a80_pinctrl_driver = { 739 738 .probe = sun9i_a80_pinctrl_probe, ··· 741 742 .of_match_table = sun9i_a80_pinctrl_match, 742 743 }, 743 744 }; 744 - module_platform_driver(sun9i_a80_pinctrl_driver); 745 - 746 - MODULE_AUTHOR("Maxime Ripard <maxime.ripard@free-electrons.com>"); 747 - MODULE_DESCRIPTION("Allwinner A80 pinctrl driver"); 748 - MODULE_LICENSE("GPL"); 745 + builtin_platform_driver(sun9i_a80_pinctrl_driver);
+423 -83
drivers/pinctrl/sunxi/pinctrl-sunxi.c
··· 28 28 #include <linux/platform_device.h> 29 29 #include <linux/slab.h> 30 30 31 + #include <dt-bindings/pinctrl/sun4i-a10.h> 32 + 31 33 #include "../core.h" 32 34 #include "pinctrl-sunxi.h" 33 35 ··· 147 145 return 0; 148 146 } 149 147 148 + static bool sunxi_pctrl_has_bias_prop(struct device_node *node) 149 + { 150 + return of_find_property(node, "bias-pull-up", NULL) || 151 + of_find_property(node, "bias-pull-down", NULL) || 152 + of_find_property(node, "bias-disable", NULL) || 153 + of_find_property(node, "allwinner,pull", NULL); 154 + } 155 + 156 + static bool sunxi_pctrl_has_drive_prop(struct device_node *node) 157 + { 158 + return of_find_property(node, "drive-strength", NULL) || 159 + of_find_property(node, "allwinner,drive", NULL); 160 + } 161 + 162 + static int sunxi_pctrl_parse_bias_prop(struct device_node *node) 163 + { 164 + u32 val; 165 + 166 + /* Try the new style binding */ 167 + if (of_find_property(node, "bias-pull-up", NULL)) 168 + return PIN_CONFIG_BIAS_PULL_UP; 169 + 170 + if (of_find_property(node, "bias-pull-down", NULL)) 171 + return PIN_CONFIG_BIAS_PULL_DOWN; 172 + 173 + if (of_find_property(node, "bias-disable", NULL)) 174 + return PIN_CONFIG_BIAS_DISABLE; 175 + 176 + /* And fall back to the old binding */ 177 + if (of_property_read_u32(node, "allwinner,pull", &val)) 178 + return -EINVAL; 179 + 180 + switch (val) { 181 + case SUN4I_PINCTRL_NO_PULL: 182 + return PIN_CONFIG_BIAS_DISABLE; 183 + case SUN4I_PINCTRL_PULL_UP: 184 + return PIN_CONFIG_BIAS_PULL_UP; 185 + case SUN4I_PINCTRL_PULL_DOWN: 186 + return PIN_CONFIG_BIAS_PULL_DOWN; 187 + } 188 + 189 + return -EINVAL; 190 + } 191 + 192 + static int sunxi_pctrl_parse_drive_prop(struct device_node *node) 193 + { 194 + u32 val; 195 + 196 + /* Try the new style binding */ 197 + if (!of_property_read_u32(node, "drive-strength", &val)) { 198 + /* We can't go below 10mA ... */ 199 + if (val < 10) 200 + return -EINVAL; 201 + 202 + /* ... and only up to 40 mA ... */ 203 + if (val > 40) 204 + val = 40; 205 + 206 + /* by steps of 10 mA */ 207 + return rounddown(val, 10); 208 + } 209 + 210 + /* And then fall back to the old binding */ 211 + if (of_property_read_u32(node, "allwinner,drive", &val)) 212 + return -EINVAL; 213 + 214 + return (val + 1) * 10; 215 + } 216 + 217 + static const char *sunxi_pctrl_parse_function_prop(struct device_node *node) 218 + { 219 + const char *function; 220 + int ret; 221 + 222 + /* Try the generic binding */ 223 + ret = of_property_read_string(node, "function", &function); 224 + if (!ret) 225 + return function; 226 + 227 + /* And fall back to our legacy one */ 228 + ret = of_property_read_string(node, "allwinner,function", &function); 229 + if (!ret) 230 + return function; 231 + 232 + return NULL; 233 + } 234 + 235 + static const char *sunxi_pctrl_find_pins_prop(struct device_node *node, 236 + int *npins) 237 + { 238 + int count; 239 + 240 + /* Try the generic binding */ 241 + count = of_property_count_strings(node, "pins"); 242 + if (count > 0) { 243 + *npins = count; 244 + return "pins"; 245 + } 246 + 247 + /* And fall back to our legacy one */ 248 + count = of_property_count_strings(node, "allwinner,pins"); 249 + if (count > 0) { 250 + *npins = count; 251 + return "allwinner,pins"; 252 + } 253 + 254 + return NULL; 255 + } 256 + 257 + static unsigned long *sunxi_pctrl_build_pin_config(struct device_node *node, 258 + unsigned int *len) 259 + { 260 + unsigned long *pinconfig; 261 + unsigned int configlen = 0, idx = 0; 262 + int ret; 263 + 264 + if (sunxi_pctrl_has_drive_prop(node)) 265 + configlen++; 266 + if (sunxi_pctrl_has_bias_prop(node)) 267 + configlen++; 268 + 269 + /* 270 + * If we don't have any configuration, bail out 271 + */ 272 + if (!configlen) 273 + return NULL; 274 + 275 + pinconfig = kzalloc(configlen * sizeof(*pinconfig), GFP_KERNEL); 276 + if (!pinconfig) 277 + return ERR_PTR(-ENOMEM); 278 + 279 + if (sunxi_pctrl_has_drive_prop(node)) { 280 + int drive = sunxi_pctrl_parse_drive_prop(node); 281 + if (drive < 0) { 282 + ret = drive; 283 + goto err_free; 284 + } 285 + 286 + pinconfig[idx++] = pinconf_to_config_packed(PIN_CONFIG_DRIVE_STRENGTH, 287 + drive); 288 + } 289 + 290 + if (sunxi_pctrl_has_bias_prop(node)) { 291 + int pull = sunxi_pctrl_parse_bias_prop(node); 292 + int arg = 0; 293 + if (pull < 0) { 294 + ret = pull; 295 + goto err_free; 296 + } 297 + 298 + if (pull != PIN_CONFIG_BIAS_DISABLE) 299 + arg = 1; /* hardware uses weak pull resistors */ 300 + 301 + pinconfig[idx++] = pinconf_to_config_packed(pull, arg); 302 + } 303 + 304 + 305 + *len = configlen; 306 + return pinconfig; 307 + 308 + err_free: 309 + kfree(pinconfig); 310 + return ERR_PTR(ret); 311 + } 312 + 150 313 static int sunxi_pctrl_dt_node_to_map(struct pinctrl_dev *pctldev, 151 314 struct device_node *node, 152 315 struct pinctrl_map **map, ··· 320 153 struct sunxi_pinctrl *pctl = pinctrl_dev_get_drvdata(pctldev); 321 154 unsigned long *pinconfig; 322 155 struct property *prop; 323 - const char *function; 156 + const char *function, *pin_prop; 324 157 const char *group; 325 - int ret, nmaps, i = 0; 326 - u32 val; 158 + int ret, npins, nmaps, configlen = 0, i = 0; 327 159 328 160 *map = NULL; 329 161 *num_maps = 0; 330 162 331 - ret = of_property_read_string(node, "allwinner,function", &function); 332 - if (ret) { 333 - dev_err(pctl->dev, 334 - "missing allwinner,function property in node %s\n", 163 + function = sunxi_pctrl_parse_function_prop(node); 164 + if (!function) { 165 + dev_err(pctl->dev, "missing function property in node %s\n", 335 166 node->name); 336 167 return -EINVAL; 337 168 } 338 169 339 - nmaps = of_property_count_strings(node, "allwinner,pins") * 2; 340 - if (nmaps < 0) { 341 - dev_err(pctl->dev, 342 - "missing allwinner,pins property in node %s\n", 170 + pin_prop = sunxi_pctrl_find_pins_prop(node, &npins); 171 + if (!pin_prop) { 172 + dev_err(pctl->dev, "missing pins property in node %s\n", 343 173 node->name); 344 174 return -EINVAL; 345 175 } 346 176 177 + /* 178 + * We have two maps for each pin: one for the function, one 179 + * for the configuration (bias, strength, etc). 180 + * 181 + * We might be slightly overshooting, since we might not have 182 + * any configuration. 183 + */ 184 + nmaps = npins * 2; 347 185 *map = kmalloc(nmaps * sizeof(struct pinctrl_map), GFP_KERNEL); 348 186 if (!*map) 349 187 return -ENOMEM; 350 188 351 - of_property_for_each_string(node, "allwinner,pins", prop, group) { 189 + pinconfig = sunxi_pctrl_build_pin_config(node, &configlen); 190 + if (IS_ERR(pinconfig)) { 191 + ret = PTR_ERR(pinconfig); 192 + goto err_free_map; 193 + } 194 + 195 + of_property_for_each_string(node, pin_prop, prop, group) { 352 196 struct sunxi_pinctrl_group *grp = 353 197 sunxi_pinctrl_find_group_by_name(pctl, group); 354 - int j = 0, configlen = 0; 355 198 356 199 if (!grp) { 357 200 dev_err(pctl->dev, "unknown pin %s", group); ··· 382 205 383 206 i++; 384 207 385 - (*map)[i].type = PIN_MAP_TYPE_CONFIGS_GROUP; 386 - (*map)[i].data.configs.group_or_pin = group; 387 - 388 - if (of_find_property(node, "allwinner,drive", NULL)) 389 - configlen++; 390 - if (of_find_property(node, "allwinner,pull", NULL)) 391 - configlen++; 392 - 393 - pinconfig = kzalloc(configlen * sizeof(*pinconfig), GFP_KERNEL); 394 - if (!pinconfig) { 395 - kfree(*map); 396 - return -ENOMEM; 208 + if (pinconfig) { 209 + (*map)[i].type = PIN_MAP_TYPE_CONFIGS_GROUP; 210 + (*map)[i].data.configs.group_or_pin = group; 211 + (*map)[i].data.configs.configs = pinconfig; 212 + (*map)[i].data.configs.num_configs = configlen; 213 + i++; 397 214 } 398 - 399 - if (!of_property_read_u32(node, "allwinner,drive", &val)) { 400 - u16 strength = (val + 1) * 10; 401 - pinconfig[j++] = 402 - pinconf_to_config_packed(PIN_CONFIG_DRIVE_STRENGTH, 403 - strength); 404 - } 405 - 406 - if (!of_property_read_u32(node, "allwinner,pull", &val)) { 407 - enum pin_config_param pull = PIN_CONFIG_END; 408 - if (val == 1) 409 - pull = PIN_CONFIG_BIAS_PULL_UP; 410 - else if (val == 2) 411 - pull = PIN_CONFIG_BIAS_PULL_DOWN; 412 - pinconfig[j++] = pinconf_to_config_packed(pull, 0); 413 - } 414 - 415 - (*map)[i].data.configs.configs = pinconfig; 416 - (*map)[i].data.configs.num_configs = configlen; 417 - 418 - i++; 419 215 } 420 216 421 - *num_maps = nmaps; 217 + *num_maps = i; 218 + 219 + /* 220 + * We know have the number of maps we need, we can resize our 221 + * map array 222 + */ 223 + *map = krealloc(*map, i * sizeof(struct pinctrl_map), GFP_KERNEL); 224 + if (!*map) 225 + return -ENOMEM; 422 226 423 227 return 0; 228 + 229 + err_free_map: 230 + kfree(*map); 231 + *map = NULL; 232 + return ret; 424 233 } 425 234 426 235 static void sunxi_pctrl_dt_free_map(struct pinctrl_dev *pctldev, ··· 415 252 { 416 253 int i; 417 254 418 - for (i = 0; i < num_maps; i++) { 419 - if (map[i].type == PIN_MAP_TYPE_CONFIGS_GROUP) 420 - kfree(map[i].data.configs.configs); 255 + /* pin config is never in the first map */ 256 + for (i = 1; i < num_maps; i++) { 257 + if (map[i].type != PIN_MAP_TYPE_CONFIGS_GROUP) 258 + continue; 259 + 260 + /* 261 + * All the maps share the same pin config, 262 + * free only the first one we find. 263 + */ 264 + kfree(map[i].data.configs.configs); 265 + break; 421 266 } 422 267 423 268 kfree(map); ··· 439 268 .get_group_pins = sunxi_pctrl_get_group_pins, 440 269 }; 441 270 271 + static int sunxi_pconf_reg(unsigned pin, enum pin_config_param param, 272 + u32 *offset, u32 *shift, u32 *mask) 273 + { 274 + switch (param) { 275 + case PIN_CONFIG_DRIVE_STRENGTH: 276 + *offset = sunxi_dlevel_reg(pin); 277 + *shift = sunxi_dlevel_offset(pin); 278 + *mask = DLEVEL_PINS_MASK; 279 + break; 280 + 281 + case PIN_CONFIG_BIAS_PULL_UP: 282 + case PIN_CONFIG_BIAS_PULL_DOWN: 283 + case PIN_CONFIG_BIAS_DISABLE: 284 + *offset = sunxi_pull_reg(pin); 285 + *shift = sunxi_pull_offset(pin); 286 + *mask = PULL_PINS_MASK; 287 + break; 288 + 289 + default: 290 + return -ENOTSUPP; 291 + } 292 + 293 + return 0; 294 + } 295 + 296 + static int sunxi_pconf_get(struct pinctrl_dev *pctldev, unsigned pin, 297 + unsigned long *config) 298 + { 299 + struct sunxi_pinctrl *pctl = pinctrl_dev_get_drvdata(pctldev); 300 + enum pin_config_param param = pinconf_to_config_param(*config); 301 + u32 offset, shift, mask, val; 302 + u16 arg; 303 + int ret; 304 + 305 + pin -= pctl->desc->pin_base; 306 + 307 + ret = sunxi_pconf_reg(pin, param, &offset, &shift, &mask); 308 + if (ret < 0) 309 + return ret; 310 + 311 + val = (readl(pctl->membase + offset) >> shift) & mask; 312 + 313 + switch (pinconf_to_config_param(*config)) { 314 + case PIN_CONFIG_DRIVE_STRENGTH: 315 + arg = (val + 1) * 10; 316 + break; 317 + 318 + case PIN_CONFIG_BIAS_PULL_UP: 319 + if (val != SUN4I_PINCTRL_PULL_UP) 320 + return -EINVAL; 321 + arg = 1; /* hardware is weak pull-up */ 322 + break; 323 + 324 + case PIN_CONFIG_BIAS_PULL_DOWN: 325 + if (val != SUN4I_PINCTRL_PULL_DOWN) 326 + return -EINVAL; 327 + arg = 1; /* hardware is weak pull-down */ 328 + break; 329 + 330 + case PIN_CONFIG_BIAS_DISABLE: 331 + if (val != SUN4I_PINCTRL_NO_PULL) 332 + return -EINVAL; 333 + arg = 0; 334 + break; 335 + 336 + default: 337 + /* sunxi_pconf_reg should catch anything unsupported */ 338 + WARN_ON(1); 339 + return -ENOTSUPP; 340 + } 341 + 342 + *config = pinconf_to_config_packed(param, arg); 343 + 344 + return 0; 345 + } 346 + 442 347 static int sunxi_pconf_group_get(struct pinctrl_dev *pctldev, 443 348 unsigned group, 444 349 unsigned long *config) 445 350 { 446 351 struct sunxi_pinctrl *pctl = pinctrl_dev_get_drvdata(pctldev); 352 + struct sunxi_pinctrl_group *g = &pctl->groups[group]; 447 353 448 - *config = pctl->groups[group].config; 449 - 450 - return 0; 354 + /* We only support 1 pin per group. Chain it to the pin callback */ 355 + return sunxi_pconf_get(pctldev, g->pin, config); 451 356 } 452 357 453 358 static int sunxi_pconf_group_set(struct pinctrl_dev *pctldev, ··· 533 286 { 534 287 struct sunxi_pinctrl *pctl = pinctrl_dev_get_drvdata(pctldev); 535 288 struct sunxi_pinctrl_group *g = &pctl->groups[group]; 536 - unsigned long flags; 537 289 unsigned pin = g->pin - pctl->desc->pin_base; 538 - u32 val, mask; 539 - u16 strength; 540 - u8 dlevel; 541 290 int i; 542 291 543 - spin_lock_irqsave(&pctl->lock, flags); 544 - 545 292 for (i = 0; i < num_configs; i++) { 546 - switch (pinconf_to_config_param(configs[i])) { 293 + enum pin_config_param param; 294 + unsigned long flags; 295 + u32 offset, shift, mask, reg; 296 + u16 arg, val; 297 + int ret; 298 + 299 + param = pinconf_to_config_param(configs[i]); 300 + arg = pinconf_to_config_argument(configs[i]); 301 + 302 + ret = sunxi_pconf_reg(pin, param, &offset, &shift, &mask); 303 + if (ret < 0) 304 + return ret; 305 + 306 + switch (param) { 547 307 case PIN_CONFIG_DRIVE_STRENGTH: 548 - strength = pinconf_to_config_argument(configs[i]); 549 - if (strength > 40) { 550 - spin_unlock_irqrestore(&pctl->lock, flags); 308 + if (arg < 10 || arg > 40) 551 309 return -EINVAL; 552 - } 553 310 /* 554 311 * We convert from mA to what the register expects: 555 312 * 0: 10mA ··· 561 310 * 2: 30mA 562 311 * 3: 40mA 563 312 */ 564 - dlevel = strength / 10 - 1; 565 - val = readl(pctl->membase + sunxi_dlevel_reg(pin)); 566 - mask = DLEVEL_PINS_MASK << sunxi_dlevel_offset(pin); 567 - writel((val & ~mask) 568 - | dlevel << sunxi_dlevel_offset(pin), 569 - pctl->membase + sunxi_dlevel_reg(pin)); 313 + val = arg / 10 - 1; 314 + break; 315 + case PIN_CONFIG_BIAS_DISABLE: 316 + val = 0; 570 317 break; 571 318 case PIN_CONFIG_BIAS_PULL_UP: 572 - val = readl(pctl->membase + sunxi_pull_reg(pin)); 573 - mask = PULL_PINS_MASK << sunxi_pull_offset(pin); 574 - writel((val & ~mask) | 1 << sunxi_pull_offset(pin), 575 - pctl->membase + sunxi_pull_reg(pin)); 319 + if (arg == 0) 320 + return -EINVAL; 321 + val = 1; 576 322 break; 577 323 case PIN_CONFIG_BIAS_PULL_DOWN: 578 - val = readl(pctl->membase + sunxi_pull_reg(pin)); 579 - mask = PULL_PINS_MASK << sunxi_pull_offset(pin); 580 - writel((val & ~mask) | 2 << sunxi_pull_offset(pin), 581 - pctl->membase + sunxi_pull_reg(pin)); 324 + if (arg == 0) 325 + return -EINVAL; 326 + val = 2; 582 327 break; 583 328 default: 584 - break; 329 + /* sunxi_pconf_reg should catch anything unsupported */ 330 + WARN_ON(1); 331 + return -ENOTSUPP; 585 332 } 586 - /* cache the config value */ 587 - g->config = configs[i]; 588 - } /* for each config */ 589 333 590 - spin_unlock_irqrestore(&pctl->lock, flags); 334 + spin_lock_irqsave(&pctl->lock, flags); 335 + reg = readl(pctl->membase + offset); 336 + reg &= ~(mask << shift); 337 + writel(reg | val << shift, pctl->membase + offset); 338 + spin_unlock_irqrestore(&pctl->lock, flags); 339 + } /* for each config */ 591 340 592 341 return 0; 593 342 } 594 343 595 344 static const struct pinconf_ops sunxi_pconf_ops = { 345 + .is_generic = true, 346 + .pin_config_get = sunxi_pconf_get, 596 347 .pin_config_group_get = sunxi_pconf_group_get, 597 348 .pin_config_group_set = sunxi_pconf_group_set, 598 349 }; ··· 1123 870 return 0; 1124 871 } 1125 872 873 + static int sunxi_pinctrl_get_debounce_div(struct clk *clk, int freq, int *diff) 874 + { 875 + unsigned long clock = clk_get_rate(clk); 876 + unsigned int best_diff, best_div; 877 + int i; 878 + 879 + best_diff = abs(freq - clock); 880 + best_div = 0; 881 + 882 + for (i = 1; i < 8; i++) { 883 + int cur_diff = abs(freq - (clock >> i)); 884 + 885 + if (cur_diff < best_diff) { 886 + best_diff = cur_diff; 887 + best_div = i; 888 + } 889 + } 890 + 891 + *diff = best_diff; 892 + return best_div; 893 + } 894 + 895 + static int sunxi_pinctrl_setup_debounce(struct sunxi_pinctrl *pctl, 896 + struct device_node *node) 897 + { 898 + unsigned int hosc_diff, losc_diff; 899 + unsigned int hosc_div, losc_div; 900 + struct clk *hosc, *losc; 901 + u8 div, src; 902 + int i, ret; 903 + 904 + /* Deal with old DTs that didn't have the oscillators */ 905 + if (of_count_phandle_with_args(node, "clocks", "#clock-cells") != 3) 906 + return 0; 907 + 908 + /* If we don't have any setup, bail out */ 909 + if (!of_find_property(node, "input-debounce", NULL)) 910 + return 0; 911 + 912 + losc = devm_clk_get(pctl->dev, "losc"); 913 + if (IS_ERR(losc)) 914 + return PTR_ERR(losc); 915 + 916 + hosc = devm_clk_get(pctl->dev, "hosc"); 917 + if (IS_ERR(hosc)) 918 + return PTR_ERR(hosc); 919 + 920 + for (i = 0; i < pctl->desc->irq_banks; i++) { 921 + unsigned long debounce_freq; 922 + u32 debounce; 923 + 924 + ret = of_property_read_u32_index(node, "input-debounce", 925 + i, &debounce); 926 + if (ret) 927 + return ret; 928 + 929 + if (!debounce) 930 + continue; 931 + 932 + debounce_freq = DIV_ROUND_CLOSEST(USEC_PER_SEC, debounce); 933 + losc_div = sunxi_pinctrl_get_debounce_div(losc, 934 + debounce_freq, 935 + &losc_diff); 936 + 937 + hosc_div = sunxi_pinctrl_get_debounce_div(hosc, 938 + debounce_freq, 939 + &hosc_diff); 940 + 941 + if (hosc_diff < losc_diff) { 942 + div = hosc_div; 943 + src = 1; 944 + } else { 945 + div = losc_div; 946 + src = 0; 947 + } 948 + 949 + writel(src | div << 4, 950 + pctl->membase + 951 + sunxi_irq_debounce_reg_from_bank(i, 952 + pctl->desc->irq_bank_base)); 953 + } 954 + 955 + return 0; 956 + } 957 + 1126 958 int sunxi_pinctrl_init(struct platform_device *pdev, 1127 959 const struct sunxi_pinctrl_desc *desc) 1128 960 { ··· 1369 1031 sunxi_pinctrl_irq_handler, 1370 1032 pctl); 1371 1033 } 1034 + 1035 + sunxi_pinctrl_setup_debounce(pctl, node); 1372 1036 1373 1037 dev_info(&pdev->dev, "initialized sunXi PIO driver\n"); 1374 1038
+7 -1
drivers/pinctrl/sunxi/pinctrl-sunxi.h
··· 69 69 #define IRQ_STATUS_IRQ_BITS 1 70 70 #define IRQ_STATUS_IRQ_MASK ((1 << IRQ_STATUS_IRQ_BITS) - 1) 71 71 72 + #define IRQ_DEBOUNCE_REG 0x218 73 + 72 74 #define IRQ_MEM_SIZE 0x20 73 75 74 76 #define IRQ_EDGE_RISING 0x00 ··· 111 109 112 110 struct sunxi_pinctrl_group { 113 111 const char *name; 114 - unsigned long config; 115 112 unsigned pin; 116 113 }; 117 114 ··· 265 264 { 266 265 u32 irq_num = irq % IRQ_CTRL_IRQ_PER_REG; 267 266 return irq_num * IRQ_CTRL_IRQ_BITS; 267 + } 268 + 269 + static inline u32 sunxi_irq_debounce_reg_from_bank(u8 bank, unsigned bank_base) 270 + { 271 + return IRQ_DEBOUNCE_REG + (bank_base + bank) * IRQ_MEM_SIZE; 268 272 } 269 273 270 274 static inline u32 sunxi_irq_status_reg_from_bank(u8 bank, unsigned bank_base)
+3 -14
drivers/pinctrl/vt8500/pinctrl-vt8500.c
··· 14 14 */ 15 15 16 16 #include <linux/io.h> 17 - #include <linux/module.h> 17 + #include <linux/init.h> 18 18 #include <linux/pinctrl/pinctrl.h> 19 19 #include <linux/platform_device.h> 20 20 #include <linux/slab.h> ··· 473 473 return wmt_pinctrl_probe(pdev, data); 474 474 } 475 475 476 - static int vt8500_pinctrl_remove(struct platform_device *pdev) 477 - { 478 - return wmt_pinctrl_remove(pdev); 479 - } 480 - 481 476 static const struct of_device_id wmt_pinctrl_of_match[] = { 482 477 { .compatible = "via,vt8500-pinctrl" }, 483 478 { /* sentinel */ }, ··· 480 485 481 486 static struct platform_driver wmt_pinctrl_driver = { 482 487 .probe = vt8500_pinctrl_probe, 483 - .remove = vt8500_pinctrl_remove, 484 488 .driver = { 485 489 .name = "pinctrl-vt8500", 486 490 .of_match_table = wmt_pinctrl_of_match, 491 + .suppress_bind_attrs = true, 487 492 }, 488 493 }; 489 - 490 - module_platform_driver(wmt_pinctrl_driver); 491 - 492 - MODULE_AUTHOR("Tony Prisk <linux@prisktech.co.nz>"); 493 - MODULE_DESCRIPTION("VIA VT8500 Pincontrol driver"); 494 - MODULE_LICENSE("GPL v2"); 495 - MODULE_DEVICE_TABLE(of, wmt_pinctrl_of_match); 494 + builtin_platform_driver(wmt_pinctrl_driver);
+3 -14
drivers/pinctrl/vt8500/pinctrl-wm8505.c
··· 14 14 */ 15 15 16 16 #include <linux/io.h> 17 - #include <linux/module.h> 17 + #include <linux/init.h> 18 18 #include <linux/pinctrl/pinctrl.h> 19 19 #include <linux/platform_device.h> 20 20 #include <linux/slab.h> ··· 504 504 return wmt_pinctrl_probe(pdev, data); 505 505 } 506 506 507 - static int wm8505_pinctrl_remove(struct platform_device *pdev) 508 - { 509 - return wmt_pinctrl_remove(pdev); 510 - } 511 - 512 507 static const struct of_device_id wmt_pinctrl_of_match[] = { 513 508 { .compatible = "wm,wm8505-pinctrl" }, 514 509 { /* sentinel */ }, ··· 511 516 512 517 static struct platform_driver wmt_pinctrl_driver = { 513 518 .probe = wm8505_pinctrl_probe, 514 - .remove = wm8505_pinctrl_remove, 515 519 .driver = { 516 520 .name = "pinctrl-wm8505", 517 521 .of_match_table = wmt_pinctrl_of_match, 522 + .suppress_bind_attrs = true, 518 523 }, 519 524 }; 520 - 521 - module_platform_driver(wmt_pinctrl_driver); 522 - 523 - MODULE_AUTHOR("Tony Prisk <linux@prisktech.co.nz>"); 524 - MODULE_DESCRIPTION("Wondermedia WM8505 Pincontrol driver"); 525 - MODULE_LICENSE("GPL v2"); 526 - MODULE_DEVICE_TABLE(of, wmt_pinctrl_of_match); 525 + builtin_platform_driver(wmt_pinctrl_driver);
+3 -14
drivers/pinctrl/vt8500/pinctrl-wm8650.c
··· 14 14 */ 15 15 16 16 #include <linux/io.h> 17 - #include <linux/module.h> 17 + #include <linux/init.h> 18 18 #include <linux/pinctrl/pinctrl.h> 19 19 #include <linux/platform_device.h> 20 20 #include <linux/slab.h> ··· 342 342 return wmt_pinctrl_probe(pdev, data); 343 343 } 344 344 345 - static int wm8650_pinctrl_remove(struct platform_device *pdev) 346 - { 347 - return wmt_pinctrl_remove(pdev); 348 - } 349 - 350 345 static const struct of_device_id wmt_pinctrl_of_match[] = { 351 346 { .compatible = "wm,wm8650-pinctrl" }, 352 347 { /* sentinel */ }, ··· 349 354 350 355 static struct platform_driver wmt_pinctrl_driver = { 351 356 .probe = wm8650_pinctrl_probe, 352 - .remove = wm8650_pinctrl_remove, 353 357 .driver = { 354 358 .name = "pinctrl-wm8650", 355 359 .of_match_table = wmt_pinctrl_of_match, 360 + .suppress_bind_attrs = true, 356 361 }, 357 362 }; 358 - 359 - module_platform_driver(wmt_pinctrl_driver); 360 - 361 - MODULE_AUTHOR("Tony Prisk <linux@prisktech.co.nz>"); 362 - MODULE_DESCRIPTION("Wondermedia WM8650 Pincontrol driver"); 363 - MODULE_LICENSE("GPL v2"); 364 - MODULE_DEVICE_TABLE(of, wmt_pinctrl_of_match); 363 + builtin_platform_driver(wmt_pinctrl_driver);
+3 -14
drivers/pinctrl/vt8500/pinctrl-wm8750.c
··· 14 14 */ 15 15 16 16 #include <linux/io.h> 17 - #include <linux/module.h> 17 + #include <linux/init.h> 18 18 #include <linux/pinctrl/pinctrl.h> 19 19 #include <linux/platform_device.h> 20 20 #include <linux/slab.h> ··· 381 381 return wmt_pinctrl_probe(pdev, data); 382 382 } 383 383 384 - static int wm8750_pinctrl_remove(struct platform_device *pdev) 385 - { 386 - return wmt_pinctrl_remove(pdev); 387 - } 388 - 389 384 static const struct of_device_id wmt_pinctrl_of_match[] = { 390 385 { .compatible = "wm,wm8750-pinctrl" }, 391 386 { /* sentinel */ }, ··· 388 393 389 394 static struct platform_driver wmt_pinctrl_driver = { 390 395 .probe = wm8750_pinctrl_probe, 391 - .remove = wm8750_pinctrl_remove, 392 396 .driver = { 393 397 .name = "pinctrl-wm8750", 394 398 .of_match_table = wmt_pinctrl_of_match, 399 + .suppress_bind_attrs = true, 395 400 }, 396 401 }; 397 - 398 - module_platform_driver(wmt_pinctrl_driver); 399 - 400 - MODULE_AUTHOR("Tony Prisk <linux@prisktech.co.nz>"); 401 - MODULE_DESCRIPTION("Wondermedia WM8750 Pincontrol driver"); 402 - MODULE_LICENSE("GPL v2"); 403 - MODULE_DEVICE_TABLE(of, wmt_pinctrl_of_match); 402 + builtin_platform_driver(wmt_pinctrl_driver);
+3 -14
drivers/pinctrl/vt8500/pinctrl-wm8850.c
··· 14 14 */ 15 15 16 16 #include <linux/io.h> 17 - #include <linux/module.h> 17 + #include <linux/init.h> 18 18 #include <linux/pinctrl/pinctrl.h> 19 19 #include <linux/platform_device.h> 20 20 #include <linux/slab.h> ··· 360 360 return wmt_pinctrl_probe(pdev, data); 361 361 } 362 362 363 - static int wm8850_pinctrl_remove(struct platform_device *pdev) 364 - { 365 - return wmt_pinctrl_remove(pdev); 366 - } 367 - 368 363 static const struct of_device_id wmt_pinctrl_of_match[] = { 369 364 { .compatible = "wm,wm8850-pinctrl" }, 370 365 { /* sentinel */ }, ··· 367 372 368 373 static struct platform_driver wmt_pinctrl_driver = { 369 374 .probe = wm8850_pinctrl_probe, 370 - .remove = wm8850_pinctrl_remove, 371 375 .driver = { 372 376 .name = "pinctrl-wm8850", 373 377 .of_match_table = wmt_pinctrl_of_match, 378 + .suppress_bind_attrs = true, 374 379 }, 375 380 }; 376 - 377 - module_platform_driver(wmt_pinctrl_driver); 378 - 379 - MODULE_AUTHOR("Tony Prisk <linux@prisktech.co.nz>"); 380 - MODULE_DESCRIPTION("Wondermedia WM8850 Pincontrol driver"); 381 - MODULE_LICENSE("GPL v2"); 382 - MODULE_DEVICE_TABLE(of, wmt_pinctrl_of_match); 381 + builtin_platform_driver(wmt_pinctrl_driver);
-10
drivers/pinctrl/vt8500/pinctrl-wmt.c
··· 18 18 #include <linux/interrupt.h> 19 19 #include <linux/io.h> 20 20 #include <linux/irq.h> 21 - #include <linux/module.h> 22 21 #include <linux/of.h> 23 22 #include <linux/of_irq.h> 24 23 #include <linux/pinctrl/consumer.h> ··· 606 607 fail_range: 607 608 gpiochip_remove(&data->gpio_chip); 608 609 return err; 609 - } 610 - 611 - int wmt_pinctrl_remove(struct platform_device *pdev) 612 - { 613 - struct wmt_pinctrl_data *data = platform_get_drvdata(pdev); 614 - 615 - gpiochip_remove(&data->gpio_chip); 616 - 617 - return 0; 618 610 }
-1
drivers/pinctrl/vt8500/pinctrl-wmt.h
··· 76 76 77 77 int wmt_pinctrl_probe(struct platform_device *pdev, 78 78 struct wmt_pinctrl_data *data); 79 - int wmt_pinctrl_remove(struct platform_device *pdev);
+131
include/dt-bindings/gpio/meson-gxl-gpio.h
··· 1 + /* 2 + * GPIO definitions for Amlogic Meson GXL SoCs 3 + * 4 + * Copyright (C) 2016 Endless Mobile, Inc. 5 + * Author: Carlo Caione <carlo@endlessm.com> 6 + * 7 + * This program is free software; you can redistribute it and/or 8 + * modify it under the terms of the GNU General Public License 9 + * version 2 as published by the Free Software Foundation. 10 + * 11 + * You should have received a copy of the GNU General Public License 12 + * along with this program. If not, see <http://www.gnu.org/licenses/>. 13 + */ 14 + 15 + #ifndef _DT_BINDINGS_MESON_GXL_GPIO_H 16 + #define _DT_BINDINGS_MESON_GXL_GPIO_H 17 + 18 + #define GPIOAO_0 0 19 + #define GPIOAO_1 1 20 + #define GPIOAO_2 2 21 + #define GPIOAO_3 3 22 + #define GPIOAO_4 4 23 + #define GPIOAO_5 5 24 + #define GPIOAO_6 6 25 + #define GPIOAO_7 7 26 + #define GPIOAO_8 8 27 + #define GPIOAO_9 9 28 + 29 + #define GPIOZ_0 0 30 + #define GPIOZ_1 1 31 + #define GPIOZ_2 2 32 + #define GPIOZ_3 3 33 + #define GPIOZ_4 4 34 + #define GPIOZ_5 5 35 + #define GPIOZ_6 6 36 + #define GPIOZ_7 7 37 + #define GPIOZ_8 8 38 + #define GPIOZ_9 9 39 + #define GPIOZ_10 10 40 + #define GPIOZ_11 11 41 + #define GPIOZ_12 12 42 + #define GPIOZ_13 13 43 + #define GPIOZ_14 14 44 + #define GPIOZ_15 15 45 + #define GPIOH_0 16 46 + #define GPIOH_1 17 47 + #define GPIOH_2 18 48 + #define GPIOH_3 19 49 + #define GPIOH_4 20 50 + #define GPIOH_5 21 51 + #define GPIOH_6 22 52 + #define GPIOH_7 23 53 + #define GPIOH_8 24 54 + #define GPIOH_9 25 55 + #define BOOT_0 26 56 + #define BOOT_1 27 57 + #define BOOT_2 28 58 + #define BOOT_3 29 59 + #define BOOT_4 30 60 + #define BOOT_5 31 61 + #define BOOT_6 32 62 + #define BOOT_7 33 63 + #define BOOT_8 34 64 + #define BOOT_9 35 65 + #define BOOT_10 36 66 + #define BOOT_11 37 67 + #define BOOT_12 38 68 + #define BOOT_13 39 69 + #define BOOT_14 40 70 + #define BOOT_15 41 71 + #define CARD_0 42 72 + #define CARD_1 43 73 + #define CARD_2 44 74 + #define CARD_3 45 75 + #define CARD_4 46 76 + #define CARD_5 47 77 + #define CARD_6 48 78 + #define GPIODV_0 49 79 + #define GPIODV_1 50 80 + #define GPIODV_2 51 81 + #define GPIODV_3 52 82 + #define GPIODV_4 53 83 + #define GPIODV_5 54 84 + #define GPIODV_6 55 85 + #define GPIODV_7 56 86 + #define GPIODV_8 57 87 + #define GPIODV_9 58 88 + #define GPIODV_10 59 89 + #define GPIODV_11 60 90 + #define GPIODV_12 61 91 + #define GPIODV_13 62 92 + #define GPIODV_14 63 93 + #define GPIODV_15 64 94 + #define GPIODV_16 65 95 + #define GPIODV_17 66 96 + #define GPIODV_18 67 97 + #define GPIODV_19 68 98 + #define GPIODV_20 69 99 + #define GPIODV_21 70 100 + #define GPIODV_22 71 101 + #define GPIODV_23 72 102 + #define GPIODV_24 73 103 + #define GPIODV_25 74 104 + #define GPIODV_26 75 105 + #define GPIODV_27 76 106 + #define GPIODV_28 77 107 + #define GPIODV_29 78 108 + #define GPIOX_0 79 109 + #define GPIOX_1 80 110 + #define GPIOX_2 81 111 + #define GPIOX_3 82 112 + #define GPIOX_4 83 113 + #define GPIOX_5 84 114 + #define GPIOX_6 85 115 + #define GPIOX_7 86 116 + #define GPIOX_8 87 117 + #define GPIOX_9 88 118 + #define GPIOX_10 89 119 + #define GPIOX_11 90 120 + #define GPIOX_12 91 121 + #define GPIOX_13 92 122 + #define GPIOX_14 93 123 + #define GPIOX_15 94 124 + #define GPIOX_16 95 125 + #define GPIOX_17 96 126 + #define GPIOX_18 97 127 + #define GPIOCLK_0 98 128 + #define GPIOCLK_1 99 129 + #define GPIO_TEST_N 100 130 + 131 + #endif
+2
include/dt-bindings/pinctrl/at91.h
··· 15 15 #define AT91_PINCTRL_DEGLITCH (1 << 2) 16 16 #define AT91_PINCTRL_PULL_DOWN (1 << 3) 17 17 #define AT91_PINCTRL_DIS_SCHMIT (1 << 4) 18 + #define AT91_PINCTRL_OUTPUT (1 << 7) 19 + #define AT91_PINCTRL_OUTPUT_VAL(x) ((x & 0x1) << 8) 18 20 #define AT91_PINCTRL_DEBOUNCE (1 << 16) 19 21 #define AT91_PINCTRL_DEBOUNCE_VAL(x) (x << 17) 20 22