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

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

Pull pin control updates from Linus Walleij:
"This is the bulk of pin control changes for the v4.15 kernel cycle:

Core:

- The pin control Kconfig entry PINCTRL is now turned into a
menuconfig option. This obviously has the implication of making the
subsystem menu visible in menuconfig. This is happening because of
two things:

(a) Intel have started to deploy and depend on pin controllers in
a way that is affecting users directly. This happens on the
highly integrated laptop chipsets named after geographical
places: baytrail, broxton, cannonlake, cedarfork, cherryview,
denverton, geminilake, lewisburg, merrifield, sunrisepoint...
It started a while back and now it is ever more evident that
this is crucial infrastructure for x86 laptops and not an
embedded obscurity anymore. Users need to be aware.

(b) Pin control expanders on I2C and SPI that are arch-agnostic.
Currently Semtech SX150X and Microchip MCP28x08 but more are
expected. Users will have to be able to configure these in
directly for their set-up.

- Just go and select GPIOLIB now that we made sure that GPIOLIB is a
very vanilla subsystem. Do not depend on it, if we need it, select
it.

- Exposing the pin control subsystem in menuconfig uncovered a bunch
of obscure bugs that are now hopefully fixed, all more or less
pertaining to Blackfin.

- Unified namespace for cross-calls between pin control and GPIO.

- New support for clock skew/delay generic DT bindings and generic
pin config options for this.

- Minor documentation improvements.

Various:

- The Renesas SH-PFC pin controller has evolved a lot. It seems
Renesas are churning out new SoCs by the minute.

- A bunch of non-critical fixes for the Rockchip driver.

- Improve the use of library functions instead of open coding.

- Support the MCP28018 variant in the MCP28x08 driver.

- Static constifying"

* tag 'pinctrl-v4.15-1' of git://git.kernel.org/pub/scm/linux/kernel/git/linusw/linux-pinctrl: (91 commits)
pinctrl: gemini: Fix missing pad descriptions
pinctrl: Add some depends on HAS_IOMEM
pinctrl: samsung/s3c24xx: add CONFIG_OF dependency
pinctrl: gemini: Fix GMAC groups
pinctrl: qcom: spmi-gpio: Add pmi8994 gpio support
pinctrl: ti-iodelay: remove redundant unused variable dev
pinctrl: max77620: Use common error handling code in max77620_pinconf_set()
pinctrl: gemini: Implement clock skew/delay config
pinctrl: gemini: Use generic DT parser
pinctrl: Add skew-delay pin config and bindings
pinctrl: armada-37xx: Add edge both type gpio irq support
pinctrl: uniphier: remove eMMC hardware reset pin-mux
pinctrl: rockchip: Add iomux-route switching support for rk3288
pinctrl: intel: Add Intel Cedar Fork PCH pin controller support
pinctrl: intel: Make offset to interrupt status register configurable
pinctrl: sunxi: Enforce the strict mode by default
pinctrl: sunxi: Disable strict mode for old pinctrl drivers
pinctrl: sunxi: Introduce the strict flag
pinctrl: sh-pfc: Save/restore registers for PSCI system suspend
pinctrl: sh-pfc: r8a7796: Use generic IOCTRL register description
...

+6106 -3026
+59
Documentation/devicetree/bindings/gpio/gpio-mcp23s08.txt Documentation/devicetree/bindings/pinctrl/pinctrl-mcp23s08.txt
··· 13 13 - "microchip,mcp23s18" for 16 GPIO SPI version 14 14 - "microchip,mcp23008" for 8 GPIO I2C version or 15 15 - "microchip,mcp23017" for 16 GPIO I2C version of the chip 16 + - "microchip,mcp23018" for 16 GPIO I2C version 16 17 NOTE: Do not use the old mcp prefix any more. It is deprecated and will be 17 18 removed. 18 19 - #gpio-cells : Should be two. ··· 81 80 spi-present-mask = <0x01>; 82 81 reg = <0>; 83 82 spi-max-frequency = <1000000>; 83 + }; 84 + 85 + Pull-up configuration 86 + ===================== 87 + 88 + If pins are used as output, they can also be configured with pull-ups. This is 89 + done with pinctrl. 90 + 91 + Please refer file <devicetree/bindings/pinctrl/pinctrl-bindings.txt> 92 + for details of the common pinctrl bindings used by client devices, 93 + including the meaning of the phrase "pin configuration node". 94 + 95 + Optional Pinmux properties: 96 + -------------------------- 97 + Following properties are required if default setting of pins are required 98 + at boot. 99 + - pinctrl-names: A pinctrl state named per <pinctrl-binding.txt>. 100 + - pinctrl[0...n]: Properties to contain the phandle for pinctrl states per 101 + <pinctrl-binding.txt>. 102 + 103 + The pin configurations are defined as child of the pinctrl states node. Each 104 + sub-node have following properties: 105 + 106 + Required properties: 107 + ------------------ 108 + - pins: List of pins. Valid values of pins properties are: 109 + gpio0 ... gpio7 for the devices with 8 GPIO pins and 110 + gpio0 ... gpio15 for the devices with 16 GPIO pins. 111 + 112 + Optional properties: 113 + ------------------- 114 + The following optional property is defined in the pinmux DT binding document 115 + <pinctrl-bindings.txt>. Absence of this property will leave the configuration 116 + in its default state. 117 + bias-pull-up 118 + 119 + Example with pinctrl to pull-up output pins: 120 + gpio21: gpio@21 { 121 + compatible = "microchip,mcp23017"; 122 + gpio-controller; 123 + #gpio-cells = <0x2>; 124 + reg = <0x21>; 125 + interrupt-parent = <&socgpio>; 126 + interrupts = <0x17 0x8>; 127 + interrupt-names = "mcp23017@21 irq"; 128 + interrupt-controller; 129 + #interrupt-cells = <0x2>; 130 + microchip,irq-mirror; 131 + pinctrl-names = "default"; 132 + pinctrl-0 = <&i2cgpio0irq &gpio21pullups>; 133 + 134 + gpio21pullups: pinmux { 135 + pins = "gpio0", "gpio1", "gpio2", "gpio3", 136 + "gpio4", "gpio5", "gpio6", "gpio7", 137 + "gpio8", "gpio9", "gpio10", "gpio11", 138 + "gpio12", "gpio13", "gpio14", "gpio15"; 139 + bias-pull-up; 140 + }; 84 141 };
+8 -2
Documentation/devicetree/bindings/pinctrl/cortina,gemini-pinctrl.txt
··· 9 9 Required properties: 10 10 - compatible: "cortina,gemini-pinctrl" 11 11 12 - Subnodes of the pin controller contain pin control multiplexing set-up. 13 - Please refer to pinctrl-bindings.txt for generic pin multiplexing nodes. 12 + Subnodes of the pin controller contain pin control multiplexing set-up 13 + and pin configuration of individual pins. 14 + 15 + Please refer to pinctrl-bindings.txt for generic pin multiplexing nodes 16 + and generic pin config nodes. 17 + 18 + Supported configurations: 19 + - skew-delay is supported on the Ethernet pins 14 20 15 21 Example: 16 22
+2 -2
Documentation/devicetree/bindings/pinctrl/marvell,armada-37xx-pinctrl.txt
··· 97 97 - pins 15-16 98 98 - functions spi, gpio 99 99 100 - group uart_2 101 - - pins 9-10 100 + group uart2 101 + - pins 9-10 and 18-19 102 102 - functions uart, gpio 103 103 104 104 Available groups and functions for the South bridge:
+4
Documentation/devicetree/bindings/pinctrl/pinctrl-bindings.txt
··· 271 271 sleep-hardware-state - indicate this is sleep related state which will be programmed 272 272 into the registers for the sleep state. 273 273 slew-rate - set the slew rate 274 + skew-delay - this affects the expected clock skew on input pins 275 + and the delay before latching a value to an output 276 + pin. Typically indicates how many double-inverters are 277 + used to delay the signal. 274 278 275 279 For example: 276 280
+2
Documentation/devicetree/bindings/pinctrl/qcom,pmic-gpio.txt
··· 15 15 "qcom,pm8921-gpio" 16 16 "qcom,pm8941-gpio" 17 17 "qcom,pm8994-gpio" 18 + "qcom,pmi8994-gpio" 18 19 "qcom,pma8084-gpio" 19 20 "qcom,pmi8994-gpio" 20 21 ··· 86 85 gpio1-gpio44 for pm8921 87 86 gpio1-gpio36 for pm8941 88 87 gpio1-gpio22 for pm8994 88 + gpio1-gpio10 for pmi8994 89 89 gpio1-gpio22 for pma8084 90 90 gpio1-gpio10 for pmi8994 91 91
+4 -2
Documentation/devicetree/bindings/pinctrl/renesas,rza1-pinctrl.txt
··· 12 12 ------------------- 13 13 14 14 Required properties: 15 - - compatible 16 - this shall be "renesas,r7s72100-ports". 15 + - compatible: should be: 16 + - "renesas,r7s72100-ports": for RZ/A1H 17 + - "renesas,r7s72101-ports", "renesas,r7s72100-ports": for RZ/A1M 18 + - "renesas,r7s72102-ports": for RZ/A1L 17 19 18 20 - reg 19 21 address base and length of the memory area where the pin controller
+3 -3
Documentation/driver-api/pinctl.rst
··· 757 757 configuration for a certain device. See the section below named 758 758 "GPIO mode pitfalls" for more details on this scenario. 759 759 760 - The public pinmux API contains two functions named pinctrl_request_gpio() 761 - and pinctrl_free_gpio(). These two functions shall *ONLY* be called from 760 + The public pinmux API contains two functions named pinctrl_gpio_request() 761 + and pinctrl_gpio_free(). These two functions shall *ONLY* be called from 762 762 gpiolib-based drivers as part of their gpio_request() and 763 763 gpio_free() semantics. Likewise the pinctrl_gpio_direction_[input|output] 764 764 shall only be called from within respective gpio_direction_[input|output] ··· 790 790 will be passed along to this function. 791 791 792 792 Alternatively to using these special functions, it is fully allowed to use 793 - named functions for each GPIO pin, the pinctrl_request_gpio() will attempt to 793 + named functions for each GPIO pin, the pinctrl_gpio_request() will attempt to 794 794 obtain the function "gpioN" where "N" is the global GPIO pin number if no 795 795 special GPIO-handler is registered. 796 796
+5 -5
Documentation/gpio/gpio-legacy.txt
··· 273 273 274 274 For GPIOs that use pins known to the pinctrl subsystem, that subsystem should 275 275 be informed of their use; a gpiolib driver's .request() operation may call 276 - pinctrl_request_gpio(), and a gpiolib driver's .free() operation may call 277 - pinctrl_free_gpio(). The pinctrl subsystem allows a pinctrl_request_gpio() 276 + pinctrl_gpio_request(), and a gpiolib driver's .free() operation may call 277 + pinctrl_gpio_free(). The pinctrl subsystem allows a pinctrl_gpio_request() 278 278 to succeed concurrently with a pin or pingroup being "owned" by a device for 279 279 pin multiplexing. 280 280 ··· 448 448 case where e.g. a GPIO controller need to reserve a pin or set the 449 449 direction of a pin by calling any of: 450 450 451 - pinctrl_request_gpio() 452 - pinctrl_free_gpio() 451 + pinctrl_gpio_request() 452 + pinctrl_gpio_free() 453 453 pinctrl_gpio_direction_input() 454 454 pinctrl_gpio_direction_output() 455 455 ··· 466 466 that different pin ranges in a SoC is managed by different gpio drivers. 467 467 468 468 This makes it logical to let gpio drivers announce their pin ranges to 469 - the pin ctrl subsystem before it will call 'pinctrl_request_gpio' in order 469 + the pin ctrl subsystem before it will call 'pinctrl_gpio_request' in order 470 470 to request the corresponding pin to be prepared by the pinctrl subsystem 471 471 before any gpio usage. 472 472
+3 -3
Documentation/translations/zh_CN/gpio.txt
··· 257 257 简单地关闭未使用时钟)。 258 258 259 259 对于 GPIO 使用 pinctrl 子系统已知的引脚,子系统应该被告知其使用情况; 260 - 一个 gpiolib 驱动的 .request()操作应调用 pinctrl_request_gpio(), 261 - 而 gpiolib 驱动的 .free()操作应调用 pinctrl_free_gpio()。pinctrl 262 - 子系统允许 pinctrl_request_gpio()在某个引脚或引脚组以复用形式“属于” 260 + 一个 gpiolib 驱动的 .request()操作应调用 pinctrl_gpio_request(), 261 + 而 gpiolib 驱动的 .free()操作应调用 pinctrl_gpio_free()。pinctrl 262 + 子系统允许 pinctrl_gpio_request()在某个引脚或引脚组以复用形式“属于” 263 263 一个设备时都成功返回。 264 264 265 265 任何须将 GPIO 信号导向适当引脚的引脚复用硬件的编程应该发生在 GPIO
+1
MAINTAINERS
··· 10713 10713 M: Laurent Pinchart <laurent.pinchart@ideasonboard.com> 10714 10714 M: Geert Uytterhoeven <geert+renesas@glider.be> 10715 10715 L: linux-renesas-soc@vger.kernel.org 10716 + T: git git://git.kernel.org/pub/scm/linux/kernel/git/geert/renesas-drivers.git sh-pfc 10716 10717 S: Maintained 10717 10718 F: drivers/pinctrl/sh-pfc/ 10718 10719
+5 -2
arch/blackfin/Kconfig
··· 321 321 322 322 config GPIO_ADI 323 323 def_bool y 324 + depends on !PINCTRL 324 325 depends on (BF51x || BF52x || BF53x || BF538 || BF539 || BF561) 325 326 326 - config PINCTRL 327 + config PINCTRL_BLACKFIN_ADI2 327 328 def_bool y 328 - depends on BF54x || BF60x 329 + depends on (BF54x || BF60x) 330 + select PINCTRL 331 + select PINCTRL_ADI2 329 332 330 333 config MEM_MT48LC64M4A2FB_7E 331 334 bool
+1
arch/blackfin/Kconfig.debug
··· 18 18 19 19 config DEBUG_MMRS 20 20 tristate "Generate Blackfin MMR tree" 21 + depends on !PINCTRL 21 22 select DEBUG_FS 22 23 help 23 24 Create a tree of Blackfin MMRs via the debugfs tree. If
+20
arch/blackfin/include/asm/gpio.h
··· 183 183 { 184 184 return irq - GPIO_IRQ_BASE; 185 185 } 186 + 187 + #else /* CONFIG_PINCTRL */ 188 + 189 + /* 190 + * CONFIG_PM is not working with pin control and should probably 191 + * avoid being selected when pin control is active, but so far, 192 + * these stubs are here to make allyesconfig and allmodconfig 193 + * compile properly. These functions are normally backed by the 194 + * CONFIG_ADI_GPIO custom GPIO implementation. 195 + */ 196 + 197 + static inline int bfin_pm_standby_setup(void) 198 + { 199 + return 0; 200 + } 201 + 202 + static inline void bfin_pm_standby_restore(void) 203 + { 204 + } 205 + 186 206 #endif /* CONFIG_PINCTRL */ 187 207 188 208 #include <asm/irq.h>
+3
arch/blackfin/kernel/bfin_gpio.c
··· 15 15 /* FIXME: consumer API required for gpio_set_value() etc, get rid of this */ 16 16 #include <linux/gpio.h> 17 17 #include <linux/irq.h> 18 + #include <asm/gpio.h> 19 + #include <asm/irq_handler.h> 20 + #include <asm/portmux.h> 18 21 19 22 #if ANOMALY_05000311 || ANOMALY_05000323 20 23 enum {
+1 -1
arch/blackfin/kernel/debug-mmrs.c
··· 10 10 #include <linux/fs.h> 11 11 #include <linux/kernel.h> 12 12 #include <linux/module.h> 13 - #include <linux/gpio.h> 14 13 15 14 #include <asm/blackfin.h> 16 15 #include <asm/gptimers.h> ··· 19 20 #include <asm/bfin_serial.h> 20 21 #include <asm/bfin5xx_spi.h> 21 22 #include <asm/bfin_twi.h> 23 + #include <asm/gpio.h> 22 24 23 25 /* Common code defines PORT_MUX on us, so redirect the MMR back locally */ 24 26 #ifdef BFIN_PORT_MUX
+1 -1
arch/blackfin/mach-common/ints-priority.c
··· 18 18 #include <linux/sched.h> 19 19 #include <linux/sched/debug.h> 20 20 #include <linux/syscore_ops.h> 21 - #include <linux/gpio.h> 22 21 #include <asm/delay.h> 23 22 #ifdef CONFIG_IPIPE 24 23 #include <linux/ipipe.h> ··· 27 28 #include <asm/irq_handler.h> 28 29 #include <asm/dpmc.h> 29 30 #include <asm/traps.h> 31 + #include <asm/gpio.h> 30 32 31 33 /* 32 34 * NOTES:
+1 -1
arch/blackfin/mach-common/pm.c
··· 15 15 #include <linux/io.h> 16 16 #include <linux/irq.h> 17 17 #include <linux/delay.h> 18 - #include <linux/gpio.h> 19 18 20 19 #include <asm/cplb.h> 21 20 #include <asm/dma.h> 22 21 #include <asm/dpmc.h> 23 22 #include <asm/pm.h> 23 + #include <asm/gpio.h> 24 24 25 25 #ifdef CONFIG_BF60x 26 26 struct bfin_cpu_pm_fns *bfin_cpu_pm;
-9
drivers/gpio/Kconfig
··· 834 834 This driver provides an in-kernel interface to those GPIOs using 835 835 platform-neutral GPIO calls. 836 836 837 - config GPIO_SX150X 838 - bool "Semtech SX150x I2C GPIO expander (deprecated)" 839 - depends on PINCTRL && I2C=y 840 - select PINCTRL_SX150X 841 - default n 842 - help 843 - Say yes here to provide support for Semtech SX150x-series I2C 844 - GPIO expanders. The GPIO driver was replaced by a Pinctrl version. 845 - 846 837 config GPIO_TPIC2810 847 838 tristate "TPIC2810 8-Bit I2C GPO expander" 848 839 help
+2 -2
drivers/gpio/gpio-aspeed.c
··· 539 539 if (!have_gpio(gpiochip_get_data(chip), offset)) 540 540 return -ENODEV; 541 541 542 - return pinctrl_request_gpio(chip->base + offset); 542 + return pinctrl_gpio_request(chip->base + offset); 543 543 } 544 544 545 545 static void aspeed_gpio_free(struct gpio_chip *chip, unsigned int offset) 546 546 { 547 - pinctrl_free_gpio(chip->base + offset); 547 + pinctrl_gpio_free(chip->base + offset); 548 548 } 549 549 550 550 static inline void __iomem *bank_debounce_reg(struct aspeed_gpio *gpio,
+2 -2
drivers/gpio/gpio-em.c
··· 239 239 240 240 static int em_gio_request(struct gpio_chip *chip, unsigned offset) 241 241 { 242 - return pinctrl_request_gpio(chip->base + offset); 242 + return pinctrl_gpio_request(chip->base + offset); 243 243 } 244 244 245 245 static void em_gio_free(struct gpio_chip *chip, unsigned offset) 246 246 { 247 - pinctrl_free_gpio(chip->base + offset); 247 + pinctrl_gpio_free(chip->base + offset); 248 248 249 249 /* Set the GPIO as an input to ensure that the next GPIO request won't 250 250 * drive the GPIO pin as an output.
+2 -12
drivers/gpio/gpio-pxa.c
··· 330 330 } 331 331 #endif 332 332 333 - static int pxa_gpio_request(struct gpio_chip *chip, unsigned int offset) 334 - { 335 - return pinctrl_request_gpio(chip->base + offset); 336 - } 337 - 338 - static void pxa_gpio_free(struct gpio_chip *chip, unsigned int offset) 339 - { 340 - pinctrl_free_gpio(chip->base + offset); 341 - } 342 - 343 333 static int pxa_init_gpio_chip(struct pxa_gpio_chip *pchip, int ngpio, 344 334 struct device_node *np, void __iomem *regbase) 345 335 { ··· 348 358 pchip->chip.set = pxa_gpio_set; 349 359 pchip->chip.to_irq = pxa_gpio_to_irq; 350 360 pchip->chip.ngpio = ngpio; 351 - pchip->chip.request = pxa_gpio_request; 352 - pchip->chip.free = pxa_gpio_free; 361 + pchip->chip.request = gpiochip_generic_request; 362 + pchip->chip.free = gpiochip_generic_free; 353 363 #ifdef CONFIG_OF_GPIO 354 364 pchip->chip.of_node = np; 355 365 pchip->chip.of_xlate = pxa_gpio_of_xlate;
+2 -2
drivers/gpio/gpio-rcar.c
··· 250 250 if (error < 0) 251 251 return error; 252 252 253 - error = pinctrl_request_gpio(chip->base + offset); 253 + error = pinctrl_gpio_request(chip->base + offset); 254 254 if (error) 255 255 pm_runtime_put(&p->pdev->dev); 256 256 ··· 261 261 { 262 262 struct gpio_rcar_priv *p = gpiochip_get_data(chip); 263 263 264 - pinctrl_free_gpio(chip->base + offset); 264 + pinctrl_gpio_free(chip->base + offset); 265 265 266 266 /* 267 267 * Set the GPIO as an input to ensure that the next GPIO request won't
+2 -2
drivers/gpio/gpio-tegra.c
··· 141 141 142 142 static int tegra_gpio_request(struct gpio_chip *chip, unsigned int offset) 143 143 { 144 - return pinctrl_request_gpio(offset); 144 + return pinctrl_gpio_request(offset); 145 145 } 146 146 147 147 static void tegra_gpio_free(struct gpio_chip *chip, unsigned int offset) 148 148 { 149 149 struct tegra_gpio_info *tgi = gpiochip_get_data(chip); 150 150 151 - pinctrl_free_gpio(offset); 151 + pinctrl_gpio_free(offset); 152 152 tegra_gpio_disable(tgi, offset); 153 153 } 154 154
+2 -2
drivers/gpio/gpio-tz1090.c
··· 232 232 struct tz1090_gpio_bank *bank = gpiochip_get_data(chip); 233 233 int ret; 234 234 235 - ret = pinctrl_request_gpio(chip->base + offset); 235 + ret = pinctrl_gpio_request(chip->base + offset); 236 236 if (ret) 237 237 return ret; 238 238 ··· 246 246 { 247 247 struct tz1090_gpio_bank *bank = gpiochip_get_data(chip); 248 248 249 - pinctrl_free_gpio(chip->base + offset); 249 + pinctrl_gpio_free(chip->base + offset); 250 250 251 251 tz1090_gpio_clear_bit(bank, REG_GPIO_BIT_EN, offset); 252 252 }
+2 -2
drivers/gpio/gpiolib.c
··· 1962 1962 */ 1963 1963 int gpiochip_generic_request(struct gpio_chip *chip, unsigned offset) 1964 1964 { 1965 - return pinctrl_request_gpio(chip->gpiodev->base + offset); 1965 + return pinctrl_gpio_request(chip->gpiodev->base + offset); 1966 1966 } 1967 1967 EXPORT_SYMBOL_GPL(gpiochip_generic_request); 1968 1968 ··· 1973 1973 */ 1974 1974 void gpiochip_generic_free(struct gpio_chip *chip, unsigned offset) 1975 1975 { 1976 - pinctrl_free_gpio(chip->gpiodev->base + offset); 1976 + pinctrl_gpio_free(chip->gpiodev->base + offset); 1977 1977 } 1978 1978 EXPORT_SYMBOL_GPL(gpiochip_generic_free); 1979 1979
+14 -18
drivers/pinctrl/Kconfig
··· 2 2 # PINCTRL infrastructure and drivers 3 3 # 4 4 5 - config PINCTRL 6 - bool 5 + menuconfig PINCTRL 6 + bool "Pin controllers" 7 7 8 - menu "Pin controllers" 9 - depends on PINCTRL 8 + if PINCTRL 10 9 11 10 config GENERIC_PINCTRL_GROUPS 12 11 bool ··· 32 33 33 34 config PINCTRL_ADI2 34 35 bool "ADI pin controller driver" 35 - depends on BLACKFIN 36 + depends on (BF54x || BF60x) 37 + depends on !GPIO_ADI 36 38 select PINMUX 37 39 select IRQ_DOMAIN 38 40 help ··· 98 98 99 99 config PINCTRL_AMD 100 100 tristate "AMD GPIO pin control" 101 - depends on GPIOLIB 101 + depends on HAS_IOMEM 102 + select GPIOLIB 102 103 select GPIOLIB_IRQCHIP 103 104 select PINMUX 104 105 select PINCONF ··· 153 152 depends on ARCH_GEMINI 154 153 default ARCH_GEMINI 155 154 select PINMUX 155 + select GENERIC_PINCONF 156 156 select MFD_SYSCON 157 157 158 158 config PINCTRL_MCP23S08 159 159 tristate "Microchip MCP23xxx I/O expander" 160 160 depends on SPI_MASTER || I2C 161 161 depends on I2C || I2C=n 162 + select GPIOLIB 162 163 select GPIOLIB_IRQCHIP 163 164 select REGMAP_I2C if I2C 164 165 select REGMAP_SPI if SPI_MASTER ··· 170 167 I/O expanders. 171 168 This provides a GPIO interface supporting inputs and outputs. 172 169 The I2C versions of the chips can be used as interrupt-controller. 173 - 174 - config PINCTRL_MESON 175 - bool 176 - depends on OF 177 - select PINMUX 178 - select PINCONF 179 - select GENERIC_PINCONF 180 - select GPIOLIB 181 - select OF_GPIO 182 - select REGMAP_MMIO 183 170 184 171 config PINCTRL_OXNAS 185 172 bool ··· 203 210 config PINCTRL_SINGLE 204 211 tristate "One-register-per-pin type device tree based pinctrl driver" 205 212 depends on OF 213 + depends on HAS_IOMEM 206 214 select GENERIC_PINCTRL_GROUPS 207 215 select GENERIC_PINMUX_FUNCTIONS 208 216 select GENERIC_PINCONF ··· 220 226 221 227 config PINCTRL_SX150X 222 228 bool "Semtech SX150x I2C GPIO expander pinctrl driver" 223 - depends on GPIOLIB && I2C=y 229 + depends on I2C=y 224 230 select PINMUX 225 231 select PINCONF 226 232 select GENERIC_PINCONF 233 + select GPIOLIB 227 234 select GPIOLIB_IRQCHIP 228 235 select REGMAP 229 236 help ··· 364 369 source "drivers/pinctrl/vt8500/Kconfig" 365 370 source "drivers/pinctrl/mediatek/Kconfig" 366 371 source "drivers/pinctrl/zte/Kconfig" 372 + source "drivers/pinctrl/meson/Kconfig" 367 373 368 374 config PINCTRL_XWAY 369 375 bool ··· 376 380 depends on OF && ARC_PLAT_TB10X 377 381 select GPIOLIB 378 382 379 - endmenu 383 + endif
+2 -2
drivers/pinctrl/bcm/pinctrl-iproc-gpio.c
··· 311 311 if (!chip->pinmux_is_supported) 312 312 return 0; 313 313 314 - return pinctrl_request_gpio(gpio); 314 + return pinctrl_gpio_request(gpio); 315 315 } 316 316 317 317 static void iproc_gpio_free(struct gpio_chip *gc, unsigned offset) ··· 322 322 if (!chip->pinmux_is_supported) 323 323 return; 324 324 325 - pinctrl_free_gpio(gpio); 325 + pinctrl_gpio_free(gpio); 326 326 } 327 327 328 328 static int iproc_gpio_direction_input(struct gpio_chip *gc, unsigned gpio)
+2 -19
drivers/pinctrl/bcm/pinctrl-nsp-gpio.c
··· 275 275 .irq_set_type = nsp_gpio_irq_set_type, 276 276 }; 277 277 278 - /* 279 - * Request the nsp IOMUX pinmux controller to mux individual pins to GPIO 280 - */ 281 - static int nsp_gpio_request(struct gpio_chip *gc, unsigned offset) 282 - { 283 - unsigned gpio = gc->base + offset; 284 - 285 - return pinctrl_request_gpio(gpio); 286 - } 287 - 288 - static void nsp_gpio_free(struct gpio_chip *gc, unsigned offset) 289 - { 290 - unsigned gpio = gc->base + offset; 291 - 292 - pinctrl_free_gpio(gpio); 293 - } 294 - 295 278 static int nsp_gpio_direction_input(struct gpio_chip *gc, unsigned gpio) 296 279 { 297 280 struct nsp_gpio *chip = gpiochip_get_data(gc); ··· 653 670 gc->label = dev_name(dev); 654 671 gc->parent = dev; 655 672 gc->of_node = dev->of_node; 656 - gc->request = nsp_gpio_request; 657 - gc->free = nsp_gpio_free; 673 + gc->request = gpiochip_generic_request; 674 + gc->free = gpiochip_generic_free; 658 675 gc->direction_input = nsp_gpio_direction_input; 659 676 gc->direction_output = nsp_gpio_direction_output; 660 677 gc->set = nsp_gpio_set;
+6 -6
drivers/pinctrl/core.c
··· 733 733 } 734 734 735 735 /** 736 - * pinctrl_request_gpio() - request a single pin to be used as GPIO 736 + * pinctrl_gpio_request() - request a single pin to be used as GPIO 737 737 * @gpio: the GPIO pin number from the GPIO subsystem number space 738 738 * 739 739 * This function should *ONLY* be used from gpiolib-based GPIO drivers, 740 740 * as part of their gpio_request() semantics, platforms and individual drivers 741 741 * shall *NOT* request GPIO pins to be muxed in. 742 742 */ 743 - int pinctrl_request_gpio(unsigned gpio) 743 + int pinctrl_gpio_request(unsigned gpio) 744 744 { 745 745 struct pinctrl_dev *pctldev; 746 746 struct pinctrl_gpio_range *range; ··· 765 765 766 766 return ret; 767 767 } 768 - EXPORT_SYMBOL_GPL(pinctrl_request_gpio); 768 + EXPORT_SYMBOL_GPL(pinctrl_gpio_request); 769 769 770 770 /** 771 - * pinctrl_free_gpio() - free control on a single pin, currently used as GPIO 771 + * pinctrl_gpio_free() - free control on a single pin, currently used as GPIO 772 772 * @gpio: the GPIO pin number from the GPIO subsystem number space 773 773 * 774 774 * This function should *ONLY* be used from gpiolib-based GPIO drivers, 775 775 * as part of their gpio_free() semantics, platforms and individual drivers 776 776 * shall *NOT* request GPIO pins to be muxed out. 777 777 */ 778 - void pinctrl_free_gpio(unsigned gpio) 778 + void pinctrl_gpio_free(unsigned gpio) 779 779 { 780 780 struct pinctrl_dev *pctldev; 781 781 struct pinctrl_gpio_range *range; ··· 795 795 796 796 mutex_unlock(&pctldev->mutex); 797 797 } 798 - EXPORT_SYMBOL_GPL(pinctrl_free_gpio); 798 + EXPORT_SYMBOL_GPL(pinctrl_gpio_free); 799 799 800 800 static int pinctrl_gpio_direction(unsigned gpio, bool input) 801 801 {
+1 -1
drivers/pinctrl/core.h
··· 154 154 * or pin, and each of these will increment the @usecount. 155 155 * @mux_owner: The name of device that called pinctrl_get(). 156 156 * @mux_setting: The most recent selected mux setting for this pin, if any. 157 - * @gpio_owner: If pinctrl_request_gpio() was called for this pin, this is 157 + * @gpio_owner: If pinctrl_gpio_request() was called for this pin, this is 158 158 * the name of the GPIO that "owns" this pin. 159 159 */ 160 160 struct pin_desc {
+10 -1
drivers/pinctrl/intel/Kconfig
··· 5 5 6 6 config PINCTRL_BAYTRAIL 7 7 bool "Intel Baytrail GPIO pin control" 8 - depends on GPIOLIB && ACPI 8 + depends on ACPI 9 + select GPIOLIB 9 10 select GPIOLIB_IRQCHIP 10 11 select PINMUX 11 12 select PINCONF ··· 65 64 help 66 65 This pinctrl driver provides an interface that allows configuring 67 66 of Intel Cannon Lake PCH pins and using them as GPIOs. 67 + 68 + config PINCTRL_CEDARFORK 69 + tristate "Intel Cedar Fork pinctrl and GPIO driver" 70 + depends on ACPI 71 + select PINCTRL_INTEL 72 + help 73 + This pinctrl driver provides an interface that allows configuring 74 + of Intel Cedar Fork PCH pins and using them as GPIOs. 68 75 69 76 config PINCTRL_DENVERTON 70 77 tristate "Intel Denverton pinctrl and GPIO driver"
+1
drivers/pinctrl/intel/Makefile
··· 7 7 obj-$(CONFIG_PINCTRL_INTEL) += pinctrl-intel.o 8 8 obj-$(CONFIG_PINCTRL_BROXTON) += pinctrl-broxton.o 9 9 obj-$(CONFIG_PINCTRL_CANNONLAKE) += pinctrl-cannonlake.o 10 + obj-$(CONFIG_PINCTRL_CEDARFORK) += pinctrl-cedarfork.o 10 11 obj-$(CONFIG_PINCTRL_DENVERTON) += pinctrl-denverton.o 11 12 obj-$(CONFIG_PINCTRL_GEMINILAKE) += pinctrl-geminilake.o 12 13 obj-$(CONFIG_PINCTRL_LEWISBURG) += pinctrl-lewisburg.o
+375
drivers/pinctrl/intel/pinctrl-cedarfork.c
··· 1 + /* 2 + * Intel Cedar Fork PCH pinctrl/GPIO driver 3 + * 4 + * Copyright (C) 2017, Intel Corporation 5 + * Author: Mika Westerberg <mika.westerberg@linux.intel.com> 6 + * 7 + * This program is free software; you can redistribute it and/or modify 8 + * it under the terms of the GNU General Public License version 2 as 9 + * published by the Free Software Foundation. 10 + */ 11 + 12 + #include <linux/acpi.h> 13 + #include <linux/module.h> 14 + #include <linux/platform_device.h> 15 + #include <linux/pm.h> 16 + #include <linux/pinctrl/pinctrl.h> 17 + 18 + #include "pinctrl-intel.h" 19 + 20 + #define CDF_PAD_OWN 0x020 21 + #define CDF_PADCFGLOCK 0x0c0 22 + #define CDF_HOSTSW_OWN 0x120 23 + #define CDF_GPI_IS 0x200 24 + #define CDF_GPI_IE 0x230 25 + 26 + #define CDF_GPP(r, s, e) \ 27 + { \ 28 + .reg_num = (r), \ 29 + .base = (s), \ 30 + .size = ((e) - (s) + 1), \ 31 + } 32 + 33 + #define CDF_COMMUNITY(b, s, e, g) \ 34 + { \ 35 + .barno = (b), \ 36 + .padown_offset = CDF_PAD_OWN, \ 37 + .padcfglock_offset = CDF_PADCFGLOCK, \ 38 + .hostown_offset = CDF_HOSTSW_OWN, \ 39 + .is_offset = CDF_GPI_IS, \ 40 + .ie_offset = CDF_GPI_IE, \ 41 + .pin_base = (s), \ 42 + .npins = ((e) - (s) + 1), \ 43 + .gpps = (g), \ 44 + .ngpps = ARRAY_SIZE(g), \ 45 + } 46 + 47 + /* Cedar Fork PCH */ 48 + static const struct pinctrl_pin_desc cdf_pins[] = { 49 + /* WEST2 */ 50 + PINCTRL_PIN(0, "GBE_SDP_TIMESYNC0_S2N"), 51 + PINCTRL_PIN(1, "GBE_SDP_TIMESYNC1_S2N"), 52 + PINCTRL_PIN(2, "GBE_SDP_TIMESYNC2_S2N"), 53 + PINCTRL_PIN(3, "GBE_SDP_TIMESYNC3_S2N"), 54 + PINCTRL_PIN(4, "GBE0_I2C_CLK"), 55 + PINCTRL_PIN(5, "GBE0_I2C_DATA"), 56 + PINCTRL_PIN(6, "GBE1_I2C_CLK"), 57 + PINCTRL_PIN(7, "GBE1_I2C_DATA"), 58 + PINCTRL_PIN(8, "GBE2_I2C_CLK"), 59 + PINCTRL_PIN(9, "GBE2_I2C_DATA"), 60 + PINCTRL_PIN(10, "GBE3_I2C_CLK"), 61 + PINCTRL_PIN(11, "GBE3_I2C_DATA"), 62 + PINCTRL_PIN(12, "GBE0_LED0"), 63 + PINCTRL_PIN(13, "GBE0_LED1"), 64 + PINCTRL_PIN(14, "GBE0_LED2"), 65 + PINCTRL_PIN(15, "GBE1_LED0"), 66 + PINCTRL_PIN(16, "GBE1_LED1"), 67 + PINCTRL_PIN(17, "GBE1_LED2"), 68 + PINCTRL_PIN(18, "GBE2_LED0"), 69 + PINCTRL_PIN(19, "GBE2_LED1"), 70 + PINCTRL_PIN(20, "GBE2_LED2"), 71 + PINCTRL_PIN(21, "GBE3_LED0"), 72 + PINCTRL_PIN(22, "GBE3_LED1"), 73 + PINCTRL_PIN(23, "GBE3_LED2"), 74 + /* WEST3 */ 75 + PINCTRL_PIN(24, "NCSI_RXD0"), 76 + PINCTRL_PIN(25, "NCSI_CLK_IN"), 77 + PINCTRL_PIN(26, "NCSI_RXD1"), 78 + PINCTRL_PIN(27, "NCSI_CRS_DV"), 79 + PINCTRL_PIN(28, "NCSI_ARB_IN"), 80 + PINCTRL_PIN(29, "NCSI_TX_EN"), 81 + PINCTRL_PIN(30, "NCSI_TXD0"), 82 + PINCTRL_PIN(31, "NCSI_TXD1"), 83 + PINCTRL_PIN(32, "NCSI_ARB_OUT"), 84 + PINCTRL_PIN(33, "GBE_SMB_CLK"), 85 + PINCTRL_PIN(34, "GBE_SMB_DATA"), 86 + PINCTRL_PIN(35, "GBE_SMB_ALRT_N"), 87 + PINCTRL_PIN(36, "THERMTRIP_N"), 88 + PINCTRL_PIN(37, "PCHHOT_N"), 89 + PINCTRL_PIN(38, "ERROR0_N"), 90 + PINCTRL_PIN(39, "ERROR1_N"), 91 + PINCTRL_PIN(40, "ERROR2_N"), 92 + PINCTRL_PIN(41, "MSMI_N"), 93 + PINCTRL_PIN(42, "CATERR_N"), 94 + PINCTRL_PIN(43, "MEMTRIP_N"), 95 + PINCTRL_PIN(44, "UART0_RXD"), 96 + PINCTRL_PIN(45, "UART0_TXD"), 97 + PINCTRL_PIN(46, "UART1_RXD"), 98 + PINCTRL_PIN(47, "UART1_TXD"), 99 + /* WEST01 */ 100 + PINCTRL_PIN(48, "GBE_GPIO13"), 101 + PINCTRL_PIN(49, "AUX_PWR"), 102 + PINCTRL_PIN(50, "CPU_GP_2"), 103 + PINCTRL_PIN(51, "CPU_GP_3"), 104 + PINCTRL_PIN(52, "FAN_PWM_0"), 105 + PINCTRL_PIN(53, "FAN_PWM_1"), 106 + PINCTRL_PIN(54, "FAN_PWM_2"), 107 + PINCTRL_PIN(55, "FAN_PWM_3"), 108 + PINCTRL_PIN(56, "FAN_TACH_0"), 109 + PINCTRL_PIN(57, "FAN_TACH_1"), 110 + PINCTRL_PIN(58, "FAN_TACH_2"), 111 + PINCTRL_PIN(59, "FAN_TACH_3"), 112 + PINCTRL_PIN(60, "ME_SMB0_CLK"), 113 + PINCTRL_PIN(61, "ME_SMB0_DATA"), 114 + PINCTRL_PIN(62, "ME_SMB0_ALRT_N"), 115 + PINCTRL_PIN(63, "ME_SMB1_CLK"), 116 + PINCTRL_PIN(64, "ME_SMB1_DATA"), 117 + PINCTRL_PIN(65, "ME_SMB1_ALRT_N"), 118 + PINCTRL_PIN(66, "ME_SMB2_CLK"), 119 + PINCTRL_PIN(67, "ME_SMB2_DATA"), 120 + PINCTRL_PIN(68, "ME_SMB2_ALRT_N"), 121 + PINCTRL_PIN(69, "GBE_MNG_I2C_CLK"), 122 + PINCTRL_PIN(70, "GBE_MNG_I2C_DATA"), 123 + /* WEST5 */ 124 + PINCTRL_PIN(71, "IE_UART_RXD"), 125 + PINCTRL_PIN(72, "IE_UART_TXD"), 126 + PINCTRL_PIN(73, "VPP_SMB_CLK"), 127 + PINCTRL_PIN(74, "VPP_SMB_DATA"), 128 + PINCTRL_PIN(75, "VPP_SMB_ALRT_N"), 129 + PINCTRL_PIN(76, "PCIE_CLKREQ0_N"), 130 + PINCTRL_PIN(77, "PCIE_CLKREQ1_N"), 131 + PINCTRL_PIN(78, "PCIE_CLKREQ2_N"), 132 + PINCTRL_PIN(79, "PCIE_CLKREQ3_N"), 133 + PINCTRL_PIN(80, "PCIE_CLKREQ4_N"), 134 + PINCTRL_PIN(81, "PCIE_CLKREQ5_N"), 135 + PINCTRL_PIN(82, "PCIE_CLKREQ6_N"), 136 + PINCTRL_PIN(83, "PCIE_CLKREQ7_N"), 137 + PINCTRL_PIN(84, "PCIE_CLKREQ8_N"), 138 + PINCTRL_PIN(85, "PCIE_CLKREQ9_N"), 139 + PINCTRL_PIN(86, "FLEX_CLK_SE0"), 140 + PINCTRL_PIN(87, "FLEX_CLK_SE1"), 141 + PINCTRL_PIN(88, "FLEX_CLK1_50"), 142 + PINCTRL_PIN(89, "FLEX_CLK2_50"), 143 + PINCTRL_PIN(90, "FLEX_CLK_125"), 144 + /* WESTC */ 145 + PINCTRL_PIN(91, "TCK_PCH"), 146 + PINCTRL_PIN(92, "JTAGX_PCH"), 147 + PINCTRL_PIN(93, "TRST_N_PCH"), 148 + PINCTRL_PIN(94, "TMS_PCH"), 149 + PINCTRL_PIN(95, "TDI_PCH"), 150 + PINCTRL_PIN(96, "TDO_PCH"), 151 + /* WESTC_DFX */ 152 + PINCTRL_PIN(97, "CX_PRDY_N"), 153 + PINCTRL_PIN(98, "CX_PREQ_N"), 154 + PINCTRL_PIN(99, "CPU_FBREAK_OUT_N"), 155 + PINCTRL_PIN(100, "TRIGGER0_N"), 156 + PINCTRL_PIN(101, "TRIGGER1_N"), 157 + /* WESTA */ 158 + PINCTRL_PIN(102, "DBG_PTI_CLK0"), 159 + PINCTRL_PIN(103, "DBG_PTI_CLK3"), 160 + PINCTRL_PIN(104, "DBG_PTI_DATA0"), 161 + PINCTRL_PIN(105, "DBG_PTI_DATA1"), 162 + PINCTRL_PIN(106, "DBG_PTI_DATA2"), 163 + PINCTRL_PIN(107, "DBG_PTI_DATA3"), 164 + PINCTRL_PIN(108, "DBG_PTI_DATA4"), 165 + PINCTRL_PIN(109, "DBG_PTI_DATA5"), 166 + PINCTRL_PIN(110, "DBG_PTI_DATA6"), 167 + PINCTRL_PIN(111, "DBG_PTI_DATA7"), 168 + /* WESTB */ 169 + PINCTRL_PIN(112, "DBG_PTI_DATA8"), 170 + PINCTRL_PIN(113, "DBG_PTI_DATA9"), 171 + PINCTRL_PIN(114, "DBG_PTI_DATA10"), 172 + PINCTRL_PIN(115, "DBG_PTI_DATA11"), 173 + PINCTRL_PIN(116, "DBG_PTI_DATA12"), 174 + PINCTRL_PIN(117, "DBG_PTI_DATA13"), 175 + PINCTRL_PIN(118, "DBG_PTI_DATA14"), 176 + PINCTRL_PIN(119, "DBG_PTI_DATA15"), 177 + PINCTRL_PIN(120, "DBG_SPARE0"), 178 + PINCTRL_PIN(121, "DBG_SPARE1"), 179 + PINCTRL_PIN(122, "DBG_SPARE2"), 180 + PINCTRL_PIN(123, "DBG_SPARE3"), 181 + /* WESTD */ 182 + PINCTRL_PIN(124, "CPU_PWR_GOOD"), 183 + PINCTRL_PIN(125, "PLTRST_CPU_N"), 184 + PINCTRL_PIN(126, "NAC_RESET_NAC_N"), 185 + PINCTRL_PIN(127, "PCH_SBLINK_RX"), 186 + PINCTRL_PIN(128, "PCH_SBLINK_TX"), 187 + PINCTRL_PIN(129, "PMSYNC_CLK"), 188 + PINCTRL_PIN(130, "CPU_ERR0_N"), 189 + PINCTRL_PIN(131, "CPU_ERR1_N"), 190 + PINCTRL_PIN(132, "CPU_ERR2_N"), 191 + PINCTRL_PIN(133, "CPU_THERMTRIP_N"), 192 + PINCTRL_PIN(134, "CPU_MSMI_N"), 193 + PINCTRL_PIN(135, "CPU_CATERR_N"), 194 + PINCTRL_PIN(136, "CPU_MEMTRIP_N"), 195 + PINCTRL_PIN(137, "NAC_GR_N"), 196 + PINCTRL_PIN(138, "NAC_XTAL_VALID"), 197 + PINCTRL_PIN(139, "NAC_WAKE_N"), 198 + PINCTRL_PIN(140, "NAC_SBLINK_CLK_S2N"), 199 + PINCTRL_PIN(141, "NAC_SBLINK_N2S"), 200 + PINCTRL_PIN(142, "NAC_SBLINK_S2N"), 201 + PINCTRL_PIN(143, "NAC_SBLINK_CLK_N2S"), 202 + /* WESTD_PECI */ 203 + PINCTRL_PIN(144, "ME_PECI"), 204 + /* WESTF */ 205 + PINCTRL_PIN(145, "NAC_RMII_CLK"), 206 + PINCTRL_PIN(146, "NAC_RGMII_CLK"), 207 + PINCTRL_PIN(147, "NAC_SPARE0"), 208 + PINCTRL_PIN(148, "NAC_SPARE1"), 209 + PINCTRL_PIN(149, "NAC_SPARE2"), 210 + PINCTRL_PIN(150, "NAC_INIT_SX_WAKE_N"), 211 + PINCTRL_PIN(151, "NAC_GBE_GPIO0_S2N"), 212 + PINCTRL_PIN(152, "NAC_GBE_GPIO1_S2N"), 213 + PINCTRL_PIN(153, "NAC_GBE_GPIO2_S2N"), 214 + PINCTRL_PIN(154, "NAC_GBE_GPIO3_S2N"), 215 + PINCTRL_PIN(155, "NAC_NCSI_RXD0"), 216 + PINCTRL_PIN(156, "NAC_NCSI_CLK_IN"), 217 + PINCTRL_PIN(157, "NAC_NCSI_RXD1"), 218 + PINCTRL_PIN(158, "NAC_NCSI_CRS_DV"), 219 + PINCTRL_PIN(159, "NAC_NCSI_ARB_IN"), 220 + PINCTRL_PIN(160, "NAC_NCSI_TX_EN"), 221 + PINCTRL_PIN(161, "NAC_NCSI_TXD0"), 222 + PINCTRL_PIN(162, "NAC_NCSI_TXD1"), 223 + PINCTRL_PIN(163, "NAC_NCSI_ARB_OUT"), 224 + PINCTRL_PIN(164, "NAC_NCSI_OE_N"), 225 + PINCTRL_PIN(165, "NAC_GBE_SMB_CLK"), 226 + PINCTRL_PIN(166, "NAC_GBE_SMB_DATA"), 227 + PINCTRL_PIN(167, "NAC_GBE_SMB_ALRT_N"), 228 + /* EAST2 */ 229 + PINCTRL_PIN(168, "USB_OC0_N"), 230 + PINCTRL_PIN(169, "GBE_GPIO0"), 231 + PINCTRL_PIN(170, "GBE_GPIO1"), 232 + PINCTRL_PIN(171, "GBE_GPIO2"), 233 + PINCTRL_PIN(172, "GBE_GPIO3"), 234 + PINCTRL_PIN(173, "GBE_GPIO4"), 235 + PINCTRL_PIN(174, "GBE_GPIO5"), 236 + PINCTRL_PIN(175, "GBE_GPIO6"), 237 + PINCTRL_PIN(176, "GBE_GPIO7"), 238 + PINCTRL_PIN(177, "GBE_GPIO8"), 239 + PINCTRL_PIN(178, "GBE_GPIO9"), 240 + PINCTRL_PIN(179, "GBE_GPIO10"), 241 + PINCTRL_PIN(180, "GBE_GPIO11"), 242 + PINCTRL_PIN(181, "GBE_GPIO12"), 243 + PINCTRL_PIN(182, "SATA0_LED_N"), 244 + PINCTRL_PIN(183, "SATA1_LED_N"), 245 + PINCTRL_PIN(184, "SATA_PDETECT0"), 246 + PINCTRL_PIN(185, "SATA_PDETECT1"), 247 + PINCTRL_PIN(186, "SATA0_SDOUT"), 248 + PINCTRL_PIN(187, "SATA1_SDOUT"), 249 + PINCTRL_PIN(188, "SATA2_LED_N"), 250 + PINCTRL_PIN(189, "SATA_PDETECT2"), 251 + PINCTRL_PIN(190, "SATA2_SDOUT"), 252 + /* EAST3 */ 253 + PINCTRL_PIN(191, "ESPI_IO0"), 254 + PINCTRL_PIN(192, "ESPI_IO1"), 255 + PINCTRL_PIN(193, "ESPI_IO2"), 256 + PINCTRL_PIN(194, "ESPI_IO3"), 257 + PINCTRL_PIN(195, "ESPI_CLK"), 258 + PINCTRL_PIN(196, "ESPI_RST_N"), 259 + PINCTRL_PIN(197, "ESPI_CS0_N"), 260 + PINCTRL_PIN(198, "ESPI_ALRT0_N"), 261 + PINCTRL_PIN(199, "ESPI_CS1_N"), 262 + PINCTRL_PIN(200, "ESPI_ALRT1_N"), 263 + PINCTRL_PIN(201, "ESPI_CLK_LOOPBK"), 264 + /* EAST0 */ 265 + PINCTRL_PIN(202, "SPI_CS0_N"), 266 + PINCTRL_PIN(203, "SPI_CS1_N"), 267 + PINCTRL_PIN(204, "SPI_MOSI_IO0"), 268 + PINCTRL_PIN(205, "SPI_MISO_IO1"), 269 + PINCTRL_PIN(206, "SPI_IO2"), 270 + PINCTRL_PIN(207, "SPI_IO3"), 271 + PINCTRL_PIN(208, "SPI_CLK"), 272 + PINCTRL_PIN(209, "SPI_CLK_LOOPBK"), 273 + PINCTRL_PIN(210, "SUSPWRDNACK"), 274 + PINCTRL_PIN(211, "PMU_SUSCLK"), 275 + PINCTRL_PIN(212, "ADR_COMPLETE"), 276 + PINCTRL_PIN(213, "ADR_TRIGGER_N"), 277 + PINCTRL_PIN(214, "PMU_SLP_S45_N"), 278 + PINCTRL_PIN(215, "PMU_SLP_S3_N"), 279 + PINCTRL_PIN(216, "PMU_WAKE_N"), 280 + PINCTRL_PIN(217, "PMU_PWRBTN_N"), 281 + PINCTRL_PIN(218, "PMU_RESETBUTTON_N"), 282 + PINCTRL_PIN(219, "PMU_PLTRST_N"), 283 + PINCTRL_PIN(220, "SUS_STAT_N"), 284 + PINCTRL_PIN(221, "PMU_I2C_CLK"), 285 + PINCTRL_PIN(222, "PMU_I2C_DATA"), 286 + PINCTRL_PIN(223, "PECI_SMB_CLK"), 287 + PINCTRL_PIN(224, "PECI_SMB_DATA"), 288 + PINCTRL_PIN(225, "PECI_SMB_ALRT_N"), 289 + /* EMMC */ 290 + PINCTRL_PIN(226, "EMMC_CMD"), 291 + PINCTRL_PIN(227, "EMMC_STROBE"), 292 + PINCTRL_PIN(228, "EMMC_CLK"), 293 + PINCTRL_PIN(229, "EMMC_D0"), 294 + PINCTRL_PIN(230, "EMMC_D1"), 295 + PINCTRL_PIN(231, "EMMC_D2"), 296 + PINCTRL_PIN(232, "EMMC_D3"), 297 + PINCTRL_PIN(233, "EMMC_D4"), 298 + PINCTRL_PIN(234, "EMMC_D5"), 299 + PINCTRL_PIN(235, "EMMC_D6"), 300 + PINCTRL_PIN(236, "EMMC_D7"), 301 + }; 302 + 303 + static const struct intel_padgroup cdf_community0_gpps[] = { 304 + CDF_GPP(0, 0, 23), /* WEST2 */ 305 + CDF_GPP(1, 24, 47), /* WEST3 */ 306 + CDF_GPP(2, 48, 70), /* WEST01 */ 307 + CDF_GPP(3, 71, 90), /* WEST5 */ 308 + CDF_GPP(4, 91, 96), /* WESTC */ 309 + CDF_GPP(5, 97, 101), /* WESTC_DFX */ 310 + CDF_GPP(6, 102, 111), /* WESTA */ 311 + CDF_GPP(7, 112, 123), /* WESTB */ 312 + CDF_GPP(8, 124, 143), /* WESTD */ 313 + CDF_GPP(9, 144, 144), /* WESTD_PECI */ 314 + CDF_GPP(10, 145, 167), /* WESTF */ 315 + }; 316 + 317 + static const struct intel_padgroup cdf_community1_gpps[] = { 318 + CDF_GPP(0, 168, 190), /* EAST2 */ 319 + CDF_GPP(1, 191, 201), /* EAST3 */ 320 + CDF_GPP(2, 202, 225), /* EAST0 */ 321 + CDF_GPP(3, 226, 236), /* EMMC */ 322 + }; 323 + 324 + static const struct intel_community cdf_communities[] = { 325 + CDF_COMMUNITY(0, 0, 167, cdf_community0_gpps), /* West */ 326 + CDF_COMMUNITY(1, 168, 236, cdf_community1_gpps), /* East */ 327 + }; 328 + 329 + static const struct intel_pinctrl_soc_data cdf_soc_data = { 330 + .pins = cdf_pins, 331 + .npins = ARRAY_SIZE(cdf_pins), 332 + .communities = cdf_communities, 333 + .ncommunities = ARRAY_SIZE(cdf_communities), 334 + }; 335 + 336 + static int cdf_pinctrl_probe(struct platform_device *pdev) 337 + { 338 + return intel_pinctrl_probe(pdev, &cdf_soc_data); 339 + } 340 + 341 + static const struct dev_pm_ops cdf_pinctrl_pm_ops = { 342 + SET_LATE_SYSTEM_SLEEP_PM_OPS(intel_pinctrl_suspend, 343 + intel_pinctrl_resume) 344 + }; 345 + 346 + static const struct acpi_device_id cdf_pinctrl_acpi_match[] = { 347 + { "INTC3001" }, 348 + { } 349 + }; 350 + MODULE_DEVICE_TABLE(acpi, cdf_pinctrl_acpi_match); 351 + 352 + static struct platform_driver cdf_pinctrl_driver = { 353 + .probe = cdf_pinctrl_probe, 354 + .driver = { 355 + .name = "cedarfork-pinctrl", 356 + .acpi_match_table = cdf_pinctrl_acpi_match, 357 + .pm = &cdf_pinctrl_pm_ops, 358 + }, 359 + }; 360 + 361 + static int __init cdf_pinctrl_init(void) 362 + { 363 + return platform_driver_register(&cdf_pinctrl_driver); 364 + } 365 + subsys_initcall(cdf_pinctrl_init); 366 + 367 + static void __exit cdf_pinctrl_exit(void) 368 + { 369 + platform_driver_unregister(&cdf_pinctrl_driver); 370 + } 371 + module_exit(cdf_pinctrl_exit); 372 + 373 + MODULE_AUTHOR("Mika Westerberg <mika.westerberg@linux.intel.com>"); 374 + MODULE_DESCRIPTION("Intel Cedar Fork PCH pinctrl/GPIO driver"); 375 + MODULE_LICENSE("GPL v2");
+1 -1
drivers/pinctrl/intel/pinctrl-cherryview.c
··· 491 491 .ngpio_ranges = ARRAY_SIZE(north_gpio_ranges), 492 492 .ngpios = ARRAY_SIZE(north_pins), 493 493 /* 494 - * North community can benerate GPIO interrupts only for the first 494 + * North community can generate GPIO interrupts only for the first 495 495 * 8 interrupts. The upper half (8-15) can only be used to trigger 496 496 * GPEs. 497 497 */
+12 -8
drivers/pinctrl/intel/pinctrl-intel.c
··· 30 30 31 31 #define PADBAR 0x00c 32 32 #define GPI_IS 0x100 33 - #define GPI_GPE_STS 0x140 34 - #define GPI_GPE_EN 0x160 35 33 36 34 #define PADOWN_BITS 4 37 35 #define PADOWN_SHIFT(p) ((p) % 8 * PADOWN_BITS) ··· 816 818 community = intel_get_community(pctrl, pin); 817 819 if (community) { 818 820 const struct intel_padgroup *padgrp; 819 - unsigned gpp, gpp_offset; 821 + unsigned gpp, gpp_offset, is_offset; 820 822 821 823 padgrp = intel_community_get_padgroup(community, pin); 822 824 if (!padgrp) ··· 824 826 825 827 gpp = padgrp->reg_num; 826 828 gpp_offset = padgroup_offset(padgrp, pin); 829 + is_offset = community->is_offset + gpp * 4; 827 830 828 831 raw_spin_lock(&pctrl->lock); 829 - writel(BIT(gpp_offset), community->regs + GPI_IS + gpp * 4); 832 + writel(BIT(gpp_offset), community->regs + is_offset); 830 833 raw_spin_unlock(&pctrl->lock); 831 834 } 832 835 } ··· 842 843 community = intel_get_community(pctrl, pin); 843 844 if (community) { 844 845 const struct intel_padgroup *padgrp; 845 - unsigned gpp, gpp_offset; 846 + unsigned gpp, gpp_offset, is_offset; 846 847 unsigned long flags; 847 848 u32 value; 848 849 ··· 852 853 853 854 gpp = padgrp->reg_num; 854 855 gpp_offset = padgroup_offset(padgrp, pin); 856 + is_offset = community->is_offset + gpp * 4; 855 857 856 858 raw_spin_lock_irqsave(&pctrl->lock, flags); 857 859 /* Clear interrupt status first to avoid unexpected interrupt */ 858 - writel(BIT(gpp_offset), community->regs + GPI_IS + gpp * 4); 860 + writel(BIT(gpp_offset), community->regs + is_offset); 859 861 860 862 value = readl(community->regs + community->ie_offset + gpp * 4); 861 863 value |= BIT(gpp_offset); ··· 991 991 const struct intel_padgroup *padgrp = &community->gpps[gpp]; 992 992 unsigned long pending, enabled, gpp_offset; 993 993 994 - pending = readl(community->regs + GPI_IS + padgrp->reg_num * 4); 994 + pending = readl(community->regs + community->is_offset + 995 + padgrp->reg_num * 4); 995 996 enabled = readl(community->regs + community->ie_offset + 996 997 padgrp->reg_num * 4); 997 998 ··· 1242 1241 community->regs = regs; 1243 1242 community->pad_regs = regs + padbar; 1244 1243 1244 + if (!community->is_offset) 1245 + community->is_offset = GPI_IS; 1246 + 1245 1247 ret = intel_pinctrl_add_padgroups(pctrl, community); 1246 1248 if (ret) 1247 1249 return ret; ··· 1360 1356 for (gpp = 0; gpp < community->ngpps; gpp++) { 1361 1357 /* Mask and clear all interrupts */ 1362 1358 writel(0, base + community->ie_offset + gpp * 4); 1363 - writel(0xffff, base + GPI_IS + gpp * 4); 1359 + writel(0xffff, base + community->is_offset + gpp * 4); 1364 1360 } 1365 1361 } 1366 1362 }
+3
drivers/pinctrl/intel/pinctrl-intel.h
··· 73 73 * @hostown_offset: Register offset of HOSTSW_OWN from @regs. If %0 then it 74 74 * is assumed that the host owns the pin (rather than 75 75 * ACPI). 76 + * @is_offset: Register offset of GPI_IS from @regs. If %0 then uses the 77 + * default (%0x100). 76 78 * @ie_offset: Register offset of GPI_IE from @regs. 77 79 * @pin_base: Starting pin of pins in this community 78 80 * @gpp_size: Maximum number of pads in each group, such as PADCFGLOCK, ··· 100 98 unsigned padown_offset; 101 99 unsigned padcfglock_offset; 102 100 unsigned hostown_offset; 101 + unsigned is_offset; 103 102 unsigned ie_offset; 104 103 unsigned pin_base; 105 104 unsigned gpp_size;
+41
drivers/pinctrl/meson/Kconfig
··· 1 + menuconfig PINCTRL_MESON 2 + bool "Amlogic SoC pinctrl drivers" 3 + depends on ARCH_MESON 4 + depends on OF 5 + select PINMUX 6 + select PINCONF 7 + select GENERIC_PINCONF 8 + select GPIOLIB 9 + select OF_GPIO 10 + select REGMAP_MMIO 11 + 12 + if PINCTRL_MESON 13 + 14 + config PINCTRL_MESON8 15 + bool "Meson 8 SoC pinctrl driver" 16 + depends on ARM 17 + select PINCTRL_MESON8_PMX 18 + default y 19 + 20 + config PINCTRL_MESON8B 21 + bool "Meson 8b SoC pinctrl driver" 22 + depends on ARM 23 + select PINCTRL_MESON8_PMX 24 + default y 25 + 26 + config PINCTRL_MESON_GXBB 27 + bool "Meson gxbb SoC pinctrl driver" 28 + depends on ARM64 29 + select PINCTRL_MESON8_PMX 30 + default y 31 + 32 + config PINCTRL_MESON_GXL 33 + bool "Meson gxl SoC pinctrl driver" 34 + depends on ARM64 35 + select PINCTRL_MESON8_PMX 36 + default y 37 + 38 + config PINCTRL_MESON8_PMX 39 + bool 40 + 41 + endif
+6 -3
drivers/pinctrl/meson/Makefile
··· 1 - obj-y += pinctrl-meson8.o pinctrl-meson8b.o 2 - obj-y += pinctrl-meson-gxbb.o pinctrl-meson-gxl.o 3 - obj-y += pinctrl-meson.o 1 + obj-$(CONFIG_PINCTRL_MESON) += pinctrl-meson.o 2 + obj-$(CONFIG_PINCTRL_MESON8_PMX) += pinctrl-meson8-pmx.o 3 + obj-$(CONFIG_PINCTRL_MESON8) += pinctrl-meson8.o 4 + obj-$(CONFIG_PINCTRL_MESON8B) += pinctrl-meson8b.o 5 + obj-$(CONFIG_PINCTRL_MESON_GXBB) += pinctrl-meson-gxbb.o 6 + obj-$(CONFIG_PINCTRL_MESON_GXL) += pinctrl-meson-gxl.o
+418 -394
drivers/pinctrl/meson/pinctrl-meson-gxbb.c
··· 14 14 15 15 #include <dt-bindings/gpio/meson-gxbb-gpio.h> 16 16 #include "pinctrl-meson.h" 17 - 18 - #define EE_OFF 14 17 + #include "pinctrl-meson8-pmx.h" 19 18 20 19 static const struct pinctrl_pin_desc meson_gxbb_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), 20 + MESON_PIN(GPIOZ_0), 21 + MESON_PIN(GPIOZ_1), 22 + MESON_PIN(GPIOZ_2), 23 + MESON_PIN(GPIOZ_3), 24 + MESON_PIN(GPIOZ_4), 25 + MESON_PIN(GPIOZ_5), 26 + MESON_PIN(GPIOZ_6), 27 + MESON_PIN(GPIOZ_7), 28 + MESON_PIN(GPIOZ_8), 29 + MESON_PIN(GPIOZ_9), 30 + MESON_PIN(GPIOZ_10), 31 + MESON_PIN(GPIOZ_11), 32 + MESON_PIN(GPIOZ_12), 33 + MESON_PIN(GPIOZ_13), 34 + MESON_PIN(GPIOZ_14), 35 + MESON_PIN(GPIOZ_15), 37 36 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), 37 + MESON_PIN(GPIOH_0), 38 + MESON_PIN(GPIOH_1), 39 + MESON_PIN(GPIOH_2), 40 + MESON_PIN(GPIOH_3), 42 41 43 - MESON_PIN(BOOT_0, EE_OFF), 44 - MESON_PIN(BOOT_1, EE_OFF), 45 - MESON_PIN(BOOT_2, EE_OFF), 46 - MESON_PIN(BOOT_3, EE_OFF), 47 - MESON_PIN(BOOT_4, EE_OFF), 48 - MESON_PIN(BOOT_5, EE_OFF), 49 - MESON_PIN(BOOT_6, EE_OFF), 50 - MESON_PIN(BOOT_7, EE_OFF), 51 - MESON_PIN(BOOT_8, EE_OFF), 52 - MESON_PIN(BOOT_9, EE_OFF), 53 - MESON_PIN(BOOT_10, EE_OFF), 54 - MESON_PIN(BOOT_11, EE_OFF), 55 - MESON_PIN(BOOT_12, EE_OFF), 56 - MESON_PIN(BOOT_13, EE_OFF), 57 - MESON_PIN(BOOT_14, EE_OFF), 58 - MESON_PIN(BOOT_15, EE_OFF), 59 - MESON_PIN(BOOT_16, EE_OFF), 60 - MESON_PIN(BOOT_17, EE_OFF), 42 + MESON_PIN(BOOT_0), 43 + MESON_PIN(BOOT_1), 44 + MESON_PIN(BOOT_2), 45 + MESON_PIN(BOOT_3), 46 + MESON_PIN(BOOT_4), 47 + MESON_PIN(BOOT_5), 48 + MESON_PIN(BOOT_6), 49 + MESON_PIN(BOOT_7), 50 + MESON_PIN(BOOT_8), 51 + MESON_PIN(BOOT_9), 52 + MESON_PIN(BOOT_10), 53 + MESON_PIN(BOOT_11), 54 + MESON_PIN(BOOT_12), 55 + MESON_PIN(BOOT_13), 56 + MESON_PIN(BOOT_14), 57 + MESON_PIN(BOOT_15), 58 + MESON_PIN(BOOT_16), 59 + MESON_PIN(BOOT_17), 61 60 62 - MESON_PIN(CARD_0, EE_OFF), 63 - MESON_PIN(CARD_1, EE_OFF), 64 - MESON_PIN(CARD_2, EE_OFF), 65 - MESON_PIN(CARD_3, EE_OFF), 66 - MESON_PIN(CARD_4, EE_OFF), 67 - MESON_PIN(CARD_5, EE_OFF), 68 - MESON_PIN(CARD_6, EE_OFF), 61 + MESON_PIN(CARD_0), 62 + MESON_PIN(CARD_1), 63 + MESON_PIN(CARD_2), 64 + MESON_PIN(CARD_3), 65 + MESON_PIN(CARD_4), 66 + MESON_PIN(CARD_5), 67 + MESON_PIN(CARD_6), 69 68 70 - MESON_PIN(GPIODV_0, EE_OFF), 71 - MESON_PIN(GPIODV_1, EE_OFF), 72 - MESON_PIN(GPIODV_2, EE_OFF), 73 - MESON_PIN(GPIODV_3, EE_OFF), 74 - MESON_PIN(GPIODV_4, EE_OFF), 75 - MESON_PIN(GPIODV_5, EE_OFF), 76 - MESON_PIN(GPIODV_6, EE_OFF), 77 - MESON_PIN(GPIODV_7, EE_OFF), 78 - MESON_PIN(GPIODV_8, EE_OFF), 79 - MESON_PIN(GPIODV_9, EE_OFF), 80 - MESON_PIN(GPIODV_10, EE_OFF), 81 - MESON_PIN(GPIODV_11, EE_OFF), 82 - MESON_PIN(GPIODV_12, EE_OFF), 83 - MESON_PIN(GPIODV_13, EE_OFF), 84 - MESON_PIN(GPIODV_14, EE_OFF), 85 - MESON_PIN(GPIODV_15, EE_OFF), 86 - MESON_PIN(GPIODV_16, EE_OFF), 87 - MESON_PIN(GPIODV_17, EE_OFF), 88 - MESON_PIN(GPIODV_18, EE_OFF), 89 - MESON_PIN(GPIODV_19, EE_OFF), 90 - MESON_PIN(GPIODV_20, EE_OFF), 91 - MESON_PIN(GPIODV_21, EE_OFF), 92 - MESON_PIN(GPIODV_22, EE_OFF), 93 - MESON_PIN(GPIODV_23, EE_OFF), 94 - MESON_PIN(GPIODV_24, EE_OFF), 95 - MESON_PIN(GPIODV_25, EE_OFF), 96 - MESON_PIN(GPIODV_26, EE_OFF), 97 - MESON_PIN(GPIODV_27, EE_OFF), 98 - MESON_PIN(GPIODV_28, EE_OFF), 99 - MESON_PIN(GPIODV_29, EE_OFF), 69 + MESON_PIN(GPIODV_0), 70 + MESON_PIN(GPIODV_1), 71 + MESON_PIN(GPIODV_2), 72 + MESON_PIN(GPIODV_3), 73 + MESON_PIN(GPIODV_4), 74 + MESON_PIN(GPIODV_5), 75 + MESON_PIN(GPIODV_6), 76 + MESON_PIN(GPIODV_7), 77 + MESON_PIN(GPIODV_8), 78 + MESON_PIN(GPIODV_9), 79 + MESON_PIN(GPIODV_10), 80 + MESON_PIN(GPIODV_11), 81 + MESON_PIN(GPIODV_12), 82 + MESON_PIN(GPIODV_13), 83 + MESON_PIN(GPIODV_14), 84 + MESON_PIN(GPIODV_15), 85 + MESON_PIN(GPIODV_16), 86 + MESON_PIN(GPIODV_17), 87 + MESON_PIN(GPIODV_18), 88 + MESON_PIN(GPIODV_19), 89 + MESON_PIN(GPIODV_20), 90 + MESON_PIN(GPIODV_21), 91 + MESON_PIN(GPIODV_22), 92 + MESON_PIN(GPIODV_23), 93 + MESON_PIN(GPIODV_24), 94 + MESON_PIN(GPIODV_25), 95 + MESON_PIN(GPIODV_26), 96 + MESON_PIN(GPIODV_27), 97 + MESON_PIN(GPIODV_28), 98 + MESON_PIN(GPIODV_29), 100 99 101 - MESON_PIN(GPIOY_0, EE_OFF), 102 - MESON_PIN(GPIOY_1, EE_OFF), 103 - MESON_PIN(GPIOY_2, EE_OFF), 104 - MESON_PIN(GPIOY_3, EE_OFF), 105 - MESON_PIN(GPIOY_4, EE_OFF), 106 - MESON_PIN(GPIOY_5, EE_OFF), 107 - MESON_PIN(GPIOY_6, EE_OFF), 108 - MESON_PIN(GPIOY_7, EE_OFF), 109 - MESON_PIN(GPIOY_8, EE_OFF), 110 - MESON_PIN(GPIOY_9, EE_OFF), 111 - MESON_PIN(GPIOY_10, EE_OFF), 112 - MESON_PIN(GPIOY_11, EE_OFF), 113 - MESON_PIN(GPIOY_12, EE_OFF), 114 - MESON_PIN(GPIOY_13, EE_OFF), 115 - MESON_PIN(GPIOY_14, EE_OFF), 116 - MESON_PIN(GPIOY_15, EE_OFF), 117 - MESON_PIN(GPIOY_16, EE_OFF), 100 + MESON_PIN(GPIOY_0), 101 + MESON_PIN(GPIOY_1), 102 + MESON_PIN(GPIOY_2), 103 + MESON_PIN(GPIOY_3), 104 + MESON_PIN(GPIOY_4), 105 + MESON_PIN(GPIOY_5), 106 + MESON_PIN(GPIOY_6), 107 + MESON_PIN(GPIOY_7), 108 + MESON_PIN(GPIOY_8), 109 + MESON_PIN(GPIOY_9), 110 + MESON_PIN(GPIOY_10), 111 + MESON_PIN(GPIOY_11), 112 + MESON_PIN(GPIOY_12), 113 + MESON_PIN(GPIOY_13), 114 + MESON_PIN(GPIOY_14), 115 + MESON_PIN(GPIOY_15), 116 + MESON_PIN(GPIOY_16), 118 117 119 - MESON_PIN(GPIOX_0, EE_OFF), 120 - MESON_PIN(GPIOX_1, EE_OFF), 121 - MESON_PIN(GPIOX_2, EE_OFF), 122 - MESON_PIN(GPIOX_3, EE_OFF), 123 - MESON_PIN(GPIOX_4, EE_OFF), 124 - MESON_PIN(GPIOX_5, EE_OFF), 125 - MESON_PIN(GPIOX_6, EE_OFF), 126 - MESON_PIN(GPIOX_7, EE_OFF), 127 - MESON_PIN(GPIOX_8, EE_OFF), 128 - MESON_PIN(GPIOX_9, EE_OFF), 129 - MESON_PIN(GPIOX_10, EE_OFF), 130 - MESON_PIN(GPIOX_11, EE_OFF), 131 - MESON_PIN(GPIOX_12, EE_OFF), 132 - MESON_PIN(GPIOX_13, EE_OFF), 133 - MESON_PIN(GPIOX_14, EE_OFF), 134 - MESON_PIN(GPIOX_15, EE_OFF), 135 - MESON_PIN(GPIOX_16, EE_OFF), 136 - MESON_PIN(GPIOX_17, EE_OFF), 137 - MESON_PIN(GPIOX_18, EE_OFF), 138 - MESON_PIN(GPIOX_19, EE_OFF), 139 - MESON_PIN(GPIOX_20, EE_OFF), 140 - MESON_PIN(GPIOX_21, EE_OFF), 118 + MESON_PIN(GPIOX_0), 119 + MESON_PIN(GPIOX_1), 120 + MESON_PIN(GPIOX_2), 121 + MESON_PIN(GPIOX_3), 122 + MESON_PIN(GPIOX_4), 123 + MESON_PIN(GPIOX_5), 124 + MESON_PIN(GPIOX_6), 125 + MESON_PIN(GPIOX_7), 126 + MESON_PIN(GPIOX_8), 127 + MESON_PIN(GPIOX_9), 128 + MESON_PIN(GPIOX_10), 129 + MESON_PIN(GPIOX_11), 130 + MESON_PIN(GPIOX_12), 131 + MESON_PIN(GPIOX_13), 132 + MESON_PIN(GPIOX_14), 133 + MESON_PIN(GPIOX_15), 134 + MESON_PIN(GPIOX_16), 135 + MESON_PIN(GPIOX_17), 136 + MESON_PIN(GPIOX_18), 137 + MESON_PIN(GPIOX_19), 138 + MESON_PIN(GPIOX_20), 139 + MESON_PIN(GPIOX_21), 140 + MESON_PIN(GPIOX_22), 141 141 142 - MESON_PIN(GPIOCLK_0, EE_OFF), 143 - MESON_PIN(GPIOCLK_1, EE_OFF), 144 - MESON_PIN(GPIOCLK_2, EE_OFF), 145 - MESON_PIN(GPIOCLK_3, EE_OFF), 146 - 147 - MESON_PIN(GPIO_TEST_N, EE_OFF), 142 + MESON_PIN(GPIOCLK_0), 143 + MESON_PIN(GPIOCLK_1), 144 + MESON_PIN(GPIOCLK_2), 145 + MESON_PIN(GPIOCLK_3), 148 146 }; 149 147 150 148 static const unsigned int emmc_nand_d07_pins[] = { 151 - PIN(BOOT_0, EE_OFF), PIN(BOOT_1, EE_OFF), PIN(BOOT_2, EE_OFF), 152 - PIN(BOOT_3, EE_OFF), PIN(BOOT_4, EE_OFF), PIN(BOOT_5, EE_OFF), 153 - PIN(BOOT_6, EE_OFF), PIN(BOOT_7, EE_OFF), 149 + BOOT_0, BOOT_1, BOOT_2, BOOT_3, BOOT_4, BOOT_5, BOOT_6, BOOT_7, 154 150 }; 155 - static const unsigned int emmc_clk_pins[] = { PIN(BOOT_8, EE_OFF) }; 156 - static const unsigned int emmc_cmd_pins[] = { PIN(BOOT_10, EE_OFF) }; 157 - static const unsigned int emmc_ds_pins[] = { PIN(BOOT_15, EE_OFF) }; 151 + static const unsigned int emmc_clk_pins[] = { BOOT_8 }; 152 + static const unsigned int emmc_cmd_pins[] = { BOOT_10 }; 153 + static const unsigned int emmc_ds_pins[] = { BOOT_15 }; 158 154 159 - static const unsigned int nor_d_pins[] = { PIN(BOOT_11, EE_OFF) }; 160 - static const unsigned int nor_q_pins[] = { PIN(BOOT_12, EE_OFF) }; 161 - static const unsigned int nor_c_pins[] = { PIN(BOOT_13, EE_OFF) }; 162 - static const unsigned int nor_cs_pins[] = { PIN(BOOT_15, EE_OFF) }; 155 + static const unsigned int nor_d_pins[] = { BOOT_11 }; 156 + static const unsigned int nor_q_pins[] = { BOOT_12 }; 157 + static const unsigned int nor_c_pins[] = { BOOT_13 }; 158 + static const unsigned int nor_cs_pins[] = { BOOT_15 }; 163 159 164 - static const unsigned int spi_sclk_pins[] = { PIN(GPIOZ_6, EE_OFF) }; 165 - static const unsigned int spi_ss0_pins[] = { PIN(GPIOZ_7, EE_OFF) }; 166 - static const unsigned int spi_miso_pins[] = { PIN(GPIOZ_12, EE_OFF) }; 167 - static const unsigned int spi_mosi_pins[] = { PIN(GPIOZ_13, EE_OFF) }; 160 + static const unsigned int spi_sclk_pins[] = { GPIOZ_6 }; 161 + static const unsigned int spi_ss0_pins[] = { GPIOZ_7 }; 162 + static const unsigned int spi_miso_pins[] = { GPIOZ_12 }; 163 + static const unsigned int spi_mosi_pins[] = { GPIOZ_13 }; 168 164 169 - static const unsigned int sdcard_d0_pins[] = { PIN(CARD_1, EE_OFF) }; 170 - static const unsigned int sdcard_d1_pins[] = { PIN(CARD_0, EE_OFF) }; 171 - static const unsigned int sdcard_d2_pins[] = { PIN(CARD_5, EE_OFF) }; 172 - static const unsigned int sdcard_d3_pins[] = { PIN(CARD_4, EE_OFF) }; 173 - static const unsigned int sdcard_cmd_pins[] = { PIN(CARD_3, EE_OFF) }; 174 - static const unsigned int sdcard_clk_pins[] = { PIN(CARD_2, EE_OFF) }; 165 + static const unsigned int sdcard_d0_pins[] = { CARD_1 }; 166 + static const unsigned int sdcard_d1_pins[] = { CARD_0 }; 167 + static const unsigned int sdcard_d2_pins[] = { CARD_5 }; 168 + static const unsigned int sdcard_d3_pins[] = { CARD_4 }; 169 + static const unsigned int sdcard_cmd_pins[] = { CARD_3 }; 170 + static const unsigned int sdcard_clk_pins[] = { CARD_2 }; 175 171 176 - static const unsigned int sdio_d0_pins[] = { PIN(GPIOX_0, EE_OFF) }; 177 - static const unsigned int sdio_d1_pins[] = { PIN(GPIOX_1, EE_OFF) }; 178 - static const unsigned int sdio_d2_pins[] = { PIN(GPIOX_2, EE_OFF) }; 179 - static const unsigned int sdio_d3_pins[] = { PIN(GPIOX_3, EE_OFF) }; 180 - static const unsigned int sdio_cmd_pins[] = { PIN(GPIOX_4, EE_OFF) }; 181 - static const unsigned int sdio_clk_pins[] = { PIN(GPIOX_5, EE_OFF) }; 182 - static const unsigned int sdio_irq_pins[] = { PIN(GPIOX_7, EE_OFF) }; 172 + static const unsigned int sdio_d0_pins[] = { GPIOX_0 }; 173 + static const unsigned int sdio_d1_pins[] = { GPIOX_1 }; 174 + static const unsigned int sdio_d2_pins[] = { GPIOX_2 }; 175 + static const unsigned int sdio_d3_pins[] = { GPIOX_3 }; 176 + static const unsigned int sdio_cmd_pins[] = { GPIOX_4 }; 177 + static const unsigned int sdio_clk_pins[] = { GPIOX_5 }; 178 + static const unsigned int sdio_irq_pins[] = { GPIOX_7 }; 183 179 184 - static const unsigned int nand_ce0_pins[] = { PIN(BOOT_8, EE_OFF) }; 185 - static const unsigned int nand_ce1_pins[] = { PIN(BOOT_9, EE_OFF) }; 186 - static const unsigned int nand_rb0_pins[] = { PIN(BOOT_10, EE_OFF) }; 187 - static const unsigned int nand_ale_pins[] = { PIN(BOOT_11, EE_OFF) }; 188 - static const unsigned int nand_cle_pins[] = { PIN(BOOT_12, EE_OFF) }; 189 - static const unsigned int nand_wen_clk_pins[] = { PIN(BOOT_13, EE_OFF) }; 190 - static const unsigned int nand_ren_wr_pins[] = { PIN(BOOT_14, EE_OFF) }; 191 - static const unsigned int nand_dqs_pins[] = { PIN(BOOT_15, EE_OFF) }; 180 + static const unsigned int nand_ce0_pins[] = { BOOT_8 }; 181 + static const unsigned int nand_ce1_pins[] = { BOOT_9 }; 182 + static const unsigned int nand_rb0_pins[] = { BOOT_10 }; 183 + static const unsigned int nand_ale_pins[] = { BOOT_11 }; 184 + static const unsigned int nand_cle_pins[] = { BOOT_12 }; 185 + static const unsigned int nand_wen_clk_pins[] = { BOOT_13 }; 186 + static const unsigned int nand_ren_wr_pins[] = { BOOT_14 }; 187 + static const unsigned int nand_dqs_pins[] = { BOOT_15 }; 192 188 193 - static const unsigned int uart_tx_a_pins[] = { PIN(GPIOX_12, EE_OFF) }; 194 - static const unsigned int uart_rx_a_pins[] = { PIN(GPIOX_13, EE_OFF) }; 195 - static const unsigned int uart_cts_a_pins[] = { PIN(GPIOX_14, EE_OFF) }; 196 - static const unsigned int uart_rts_a_pins[] = { PIN(GPIOX_15, EE_OFF) }; 189 + static const unsigned int uart_tx_a_pins[] = { GPIOX_12 }; 190 + static const unsigned int uart_rx_a_pins[] = { GPIOX_13 }; 191 + static const unsigned int uart_cts_a_pins[] = { GPIOX_14 }; 192 + static const unsigned int uart_rts_a_pins[] = { GPIOX_15 }; 197 193 198 - static const unsigned int uart_tx_b_pins[] = { PIN(GPIODV_24, EE_OFF) }; 199 - static const unsigned int uart_rx_b_pins[] = { PIN(GPIODV_25, EE_OFF) }; 200 - static const unsigned int uart_cts_b_pins[] = { PIN(GPIODV_26, EE_OFF) }; 201 - static const unsigned int uart_rts_b_pins[] = { PIN(GPIODV_27, EE_OFF) }; 194 + static const unsigned int uart_tx_b_pins[] = { GPIODV_24 }; 195 + static const unsigned int uart_rx_b_pins[] = { GPIODV_25 }; 196 + static const unsigned int uart_cts_b_pins[] = { GPIODV_26 }; 197 + static const unsigned int uart_rts_b_pins[] = { GPIODV_27 }; 202 198 203 - static const unsigned int uart_tx_c_pins[] = { PIN(GPIOY_13, EE_OFF) }; 204 - static const unsigned int uart_rx_c_pins[] = { PIN(GPIOY_14, EE_OFF) }; 205 - static const unsigned int uart_cts_c_pins[] = { PIN(GPIOX_11, EE_OFF) }; 206 - static const unsigned int uart_rts_c_pins[] = { PIN(GPIOX_12, EE_OFF) }; 199 + static const unsigned int uart_tx_c_pins[] = { GPIOY_13 }; 200 + static const unsigned int uart_rx_c_pins[] = { GPIOY_14 }; 201 + static const unsigned int uart_cts_c_pins[] = { GPIOX_11 }; 202 + static const unsigned int uart_rts_c_pins[] = { GPIOX_12 }; 207 203 208 - static const unsigned int i2c_sck_a_pins[] = { PIN(GPIODV_25, EE_OFF) }; 209 - static const unsigned int i2c_sda_a_pins[] = { PIN(GPIODV_24, EE_OFF) }; 204 + static const unsigned int i2c_sck_a_pins[] = { GPIODV_25 }; 205 + static const unsigned int i2c_sda_a_pins[] = { GPIODV_24 }; 210 206 211 - static const unsigned int i2c_sck_b_pins[] = { PIN(GPIODV_27, EE_OFF) }; 212 - static const unsigned int i2c_sda_b_pins[] = { PIN(GPIODV_26, EE_OFF) }; 207 + static const unsigned int i2c_sck_b_pins[] = { GPIODV_27 }; 208 + static const unsigned int i2c_sda_b_pins[] = { GPIODV_26 }; 213 209 214 - static const unsigned int i2c_sck_c_pins[] = { PIN(GPIODV_29, EE_OFF) }; 215 - static const unsigned int i2c_sda_c_pins[] = { PIN(GPIODV_28, EE_OFF) }; 210 + static const unsigned int i2c_sck_c_pins[] = { GPIODV_29 }; 211 + static const unsigned int i2c_sda_c_pins[] = { GPIODV_28 }; 216 212 217 - static const unsigned int eth_mdio_pins[] = { PIN(GPIOZ_0, EE_OFF) }; 218 - static const unsigned int eth_mdc_pins[] = { PIN(GPIOZ_1, EE_OFF) }; 219 - static const unsigned int eth_clk_rx_clk_pins[] = { PIN(GPIOZ_2, EE_OFF) }; 220 - static const unsigned int eth_rx_dv_pins[] = { PIN(GPIOZ_3, EE_OFF) }; 221 - static const unsigned int eth_rxd0_pins[] = { PIN(GPIOZ_4, EE_OFF) }; 222 - static const unsigned int eth_rxd1_pins[] = { PIN(GPIOZ_5, EE_OFF) }; 223 - static const unsigned int eth_rxd2_pins[] = { PIN(GPIOZ_6, EE_OFF) }; 224 - static const unsigned int eth_rxd3_pins[] = { PIN(GPIOZ_7, EE_OFF) }; 225 - static const unsigned int eth_rgmii_tx_clk_pins[] = { PIN(GPIOZ_8, EE_OFF) }; 226 - static const unsigned int eth_tx_en_pins[] = { PIN(GPIOZ_9, EE_OFF) }; 227 - static const unsigned int eth_txd0_pins[] = { PIN(GPIOZ_10, EE_OFF) }; 228 - static const unsigned int eth_txd1_pins[] = { PIN(GPIOZ_11, EE_OFF) }; 229 - static const unsigned int eth_txd2_pins[] = { PIN(GPIOZ_12, EE_OFF) }; 230 - static const unsigned int eth_txd3_pins[] = { PIN(GPIOZ_13, EE_OFF) }; 213 + static const unsigned int eth_mdio_pins[] = { GPIOZ_0 }; 214 + static const unsigned int eth_mdc_pins[] = { GPIOZ_1 }; 215 + static const unsigned int eth_clk_rx_clk_pins[] = { GPIOZ_2 }; 216 + static const unsigned int eth_rx_dv_pins[] = { GPIOZ_3 }; 217 + static const unsigned int eth_rxd0_pins[] = { GPIOZ_4 }; 218 + static const unsigned int eth_rxd1_pins[] = { GPIOZ_5 }; 219 + static const unsigned int eth_rxd2_pins[] = { GPIOZ_6 }; 220 + static const unsigned int eth_rxd3_pins[] = { GPIOZ_7 }; 221 + static const unsigned int eth_rgmii_tx_clk_pins[] = { GPIOZ_8 }; 222 + static const unsigned int eth_tx_en_pins[] = { GPIOZ_9 }; 223 + static const unsigned int eth_txd0_pins[] = { GPIOZ_10 }; 224 + static const unsigned int eth_txd1_pins[] = { GPIOZ_11 }; 225 + static const unsigned int eth_txd2_pins[] = { GPIOZ_12 }; 226 + static const unsigned int eth_txd3_pins[] = { GPIOZ_13 }; 231 227 232 - static const unsigned int pwm_a_x_pins[] = { PIN(GPIOX_6, EE_OFF) }; 233 - static const unsigned int pwm_a_y_pins[] = { PIN(GPIOY_16, EE_OFF) }; 234 - static const unsigned int pwm_b_pins[] = { PIN(GPIODV_29, EE_OFF) }; 235 - static const unsigned int pwm_d_pins[] = { PIN(GPIODV_28, EE_OFF) }; 236 - static const unsigned int pwm_e_pins[] = { PIN(GPIOX_19, EE_OFF) }; 237 - static const unsigned int pwm_f_x_pins[] = { PIN(GPIOX_7, EE_OFF) }; 238 - static const unsigned int pwm_f_y_pins[] = { PIN(GPIOY_15, EE_OFF) }; 228 + static const unsigned int pwm_a_x_pins[] = { GPIOX_6 }; 229 + static const unsigned int pwm_a_y_pins[] = { GPIOY_16 }; 230 + static const unsigned int pwm_b_pins[] = { GPIODV_29 }; 231 + static const unsigned int pwm_d_pins[] = { GPIODV_28 }; 232 + static const unsigned int pwm_e_pins[] = { GPIOX_19 }; 233 + static const unsigned int pwm_f_x_pins[] = { GPIOX_7 }; 234 + static const unsigned int pwm_f_y_pins[] = { GPIOY_15 }; 239 235 240 - static const unsigned int hdmi_hpd_pins[] = { PIN(GPIOH_0, EE_OFF) }; 241 - static const unsigned int hdmi_sda_pins[] = { PIN(GPIOH_1, EE_OFF) }; 242 - static const unsigned int hdmi_scl_pins[] = { PIN(GPIOH_2, EE_OFF) }; 236 + static const unsigned int hdmi_hpd_pins[] = { GPIOH_0 }; 237 + static const unsigned int hdmi_sda_pins[] = { GPIOH_1 }; 238 + static const unsigned int hdmi_scl_pins[] = { GPIOH_2 }; 243 239 244 - static const unsigned int i2s_out_ch23_y_pins[] = { PIN(GPIOY_8, EE_OFF) }; 245 - static const unsigned int i2s_out_ch45_y_pins[] = { PIN(GPIOY_9, EE_OFF) }; 246 - static const unsigned int i2s_out_ch67_y_pins[] = { PIN(GPIOY_10, EE_OFF) }; 240 + static const unsigned int i2s_out_ch23_y_pins[] = { GPIOY_8 }; 241 + static const unsigned int i2s_out_ch45_y_pins[] = { GPIOY_9 }; 242 + static const unsigned int i2s_out_ch67_y_pins[] = { GPIOY_10 }; 247 243 248 - static const unsigned int spdif_out_y_pins[] = { PIN(GPIOY_12, EE_OFF) }; 244 + static const unsigned int spdif_out_y_pins[] = { GPIOY_12 }; 249 245 250 246 static const struct pinctrl_pin_desc meson_gxbb_aobus_pins[] = { 251 - MESON_PIN(GPIOAO_0, 0), 252 - MESON_PIN(GPIOAO_1, 0), 253 - MESON_PIN(GPIOAO_2, 0), 254 - MESON_PIN(GPIOAO_3, 0), 255 - MESON_PIN(GPIOAO_4, 0), 256 - MESON_PIN(GPIOAO_5, 0), 257 - MESON_PIN(GPIOAO_6, 0), 258 - MESON_PIN(GPIOAO_7, 0), 259 - MESON_PIN(GPIOAO_8, 0), 260 - MESON_PIN(GPIOAO_9, 0), 261 - MESON_PIN(GPIOAO_10, 0), 262 - MESON_PIN(GPIOAO_11, 0), 263 - MESON_PIN(GPIOAO_12, 0), 264 - MESON_PIN(GPIOAO_13, 0), 247 + MESON_PIN(GPIOAO_0), 248 + MESON_PIN(GPIOAO_1), 249 + MESON_PIN(GPIOAO_2), 250 + MESON_PIN(GPIOAO_3), 251 + MESON_PIN(GPIOAO_4), 252 + MESON_PIN(GPIOAO_5), 253 + MESON_PIN(GPIOAO_6), 254 + MESON_PIN(GPIOAO_7), 255 + MESON_PIN(GPIOAO_8), 256 + MESON_PIN(GPIOAO_9), 257 + MESON_PIN(GPIOAO_10), 258 + MESON_PIN(GPIOAO_11), 259 + MESON_PIN(GPIOAO_12), 260 + MESON_PIN(GPIOAO_13), 261 + 262 + MESON_PIN(GPIO_TEST_N), 265 263 }; 266 264 267 - static const unsigned int uart_tx_ao_a_pins[] = { PIN(GPIOAO_0, 0) }; 268 - static const unsigned int uart_rx_ao_a_pins[] = { PIN(GPIOAO_1, 0) }; 269 - static const unsigned int uart_cts_ao_a_pins[] = { PIN(GPIOAO_2, 0) }; 270 - static const unsigned int uart_rts_ao_a_pins[] = { PIN(GPIOAO_3, 0) }; 271 - static const unsigned int uart_tx_ao_b_pins[] = { PIN(GPIOAO_4, 0) }; 272 - static const unsigned int uart_rx_ao_b_pins[] = { PIN(GPIOAO_5, 0) }; 273 - static const unsigned int uart_cts_ao_b_pins[] = { PIN(GPIOAO_2, 0) }; 274 - static const unsigned int uart_rts_ao_b_pins[] = { PIN(GPIOAO_3, 0) }; 265 + static const unsigned int uart_tx_ao_a_pins[] = { GPIOAO_0 }; 266 + static const unsigned int uart_rx_ao_a_pins[] = { GPIOAO_1 }; 267 + static const unsigned int uart_cts_ao_a_pins[] = { GPIOAO_2 }; 268 + static const unsigned int uart_rts_ao_a_pins[] = { GPIOAO_3 }; 269 + static const unsigned int uart_tx_ao_b_pins[] = { GPIOAO_4 }; 270 + static const unsigned int uart_rx_ao_b_pins[] = { GPIOAO_5 }; 271 + static const unsigned int uart_cts_ao_b_pins[] = { GPIOAO_2 }; 272 + static const unsigned int uart_rts_ao_b_pins[] = { GPIOAO_3 }; 275 273 276 - static const unsigned int i2c_sck_ao_pins[] = {PIN(GPIOAO_4, 0) }; 277 - static const unsigned int i2c_sda_ao_pins[] = {PIN(GPIOAO_5, 0) }; 278 - static const unsigned int i2c_slave_sck_ao_pins[] = {PIN(GPIOAO_4, 0) }; 279 - static const unsigned int i2c_slave_sda_ao_pins[] = {PIN(GPIOAO_5, 0) }; 274 + static const unsigned int i2c_sck_ao_pins[] = { GPIOAO_4 }; 275 + static const unsigned int i2c_sda_ao_pins[] = { GPIOAO_5 }; 276 + static const unsigned int i2c_slave_sck_ao_pins[] = {GPIOAO_4 }; 277 + static const unsigned int i2c_slave_sda_ao_pins[] = {GPIOAO_5 }; 280 278 281 - static const unsigned int remote_input_ao_pins[] = {PIN(GPIOAO_7, 0) }; 279 + static const unsigned int remote_input_ao_pins[] = { GPIOAO_7 }; 282 280 283 - static const unsigned int pwm_ao_a_3_pins[] = { PIN(GPIOAO_3, 0) }; 284 - static const unsigned int pwm_ao_a_6_pins[] = { PIN(GPIOAO_6, 0) }; 285 - static const unsigned int pwm_ao_a_12_pins[] = { PIN(GPIOAO_12, 0) }; 286 - static const unsigned int pwm_ao_b_pins[] = { PIN(GPIOAO_13, 0) }; 281 + static const unsigned int pwm_ao_a_3_pins[] = { GPIOAO_3 }; 282 + static const unsigned int pwm_ao_a_6_pins[] = { GPIOAO_6 }; 283 + static const unsigned int pwm_ao_a_12_pins[] = { GPIOAO_12 }; 284 + static const unsigned int pwm_ao_b_pins[] = { GPIOAO_13 }; 287 285 288 - static const unsigned int i2s_am_clk_pins[] = { PIN(GPIOAO_8, 0) }; 289 - static const unsigned int i2s_out_ao_clk_pins[] = { PIN(GPIOAO_9, 0) }; 290 - static const unsigned int i2s_out_lr_clk_pins[] = { PIN(GPIOAO_10, 0) }; 291 - static const unsigned int i2s_out_ch01_ao_pins[] = { PIN(GPIOAO_11, 0) }; 292 - static const unsigned int i2s_out_ch23_ao_pins[] = { PIN(GPIOAO_12, 0) }; 293 - static const unsigned int i2s_out_ch45_ao_pins[] = { PIN(GPIOAO_13, 0) }; 286 + static const unsigned int i2s_am_clk_pins[] = { GPIOAO_8 }; 287 + static const unsigned int i2s_out_ao_clk_pins[] = { GPIOAO_9 }; 288 + static const unsigned int i2s_out_lr_clk_pins[] = { GPIOAO_10 }; 289 + static const unsigned int i2s_out_ch01_ao_pins[] = { GPIOAO_11 }; 290 + static const unsigned int i2s_out_ch23_ao_pins[] = { GPIOAO_12 }; 291 + static const unsigned int i2s_out_ch45_ao_pins[] = { GPIOAO_13 }; 292 + static const unsigned int i2s_out_ch67_ao_pins[] = { GPIO_TEST_N }; 294 293 295 - static const unsigned int spdif_out_ao_6_pins[] = { PIN(GPIOAO_6, 0) }; 296 - static const unsigned int spdif_out_ao_13_pins[] = { PIN(GPIOAO_13, 0) }; 294 + static const unsigned int spdif_out_ao_6_pins[] = { GPIOAO_6 }; 295 + static const unsigned int spdif_out_ao_13_pins[] = { GPIOAO_13 }; 297 296 298 - static const unsigned int ao_cec_pins[] = { PIN(GPIOAO_12, 0) }; 299 - static const unsigned int ee_cec_pins[] = { PIN(GPIOAO_12, 0) }; 297 + static const unsigned int ao_cec_pins[] = { GPIOAO_12 }; 298 + static const unsigned int ee_cec_pins[] = { GPIOAO_12 }; 300 299 301 300 static struct meson_pmx_group meson_gxbb_periphs_groups[] = { 302 - GPIO_GROUP(GPIOZ_0, EE_OFF), 303 - GPIO_GROUP(GPIOZ_1, EE_OFF), 304 - GPIO_GROUP(GPIOZ_2, EE_OFF), 305 - GPIO_GROUP(GPIOZ_3, EE_OFF), 306 - GPIO_GROUP(GPIOZ_4, EE_OFF), 307 - GPIO_GROUP(GPIOZ_5, EE_OFF), 308 - GPIO_GROUP(GPIOZ_6, EE_OFF), 309 - GPIO_GROUP(GPIOZ_7, EE_OFF), 310 - GPIO_GROUP(GPIOZ_8, EE_OFF), 311 - GPIO_GROUP(GPIOZ_9, EE_OFF), 312 - GPIO_GROUP(GPIOZ_10, EE_OFF), 313 - GPIO_GROUP(GPIOZ_11, EE_OFF), 314 - GPIO_GROUP(GPIOZ_12, EE_OFF), 315 - GPIO_GROUP(GPIOZ_13, EE_OFF), 316 - GPIO_GROUP(GPIOZ_14, EE_OFF), 317 - GPIO_GROUP(GPIOZ_15, EE_OFF), 301 + GPIO_GROUP(GPIOZ_0), 302 + GPIO_GROUP(GPIOZ_1), 303 + GPIO_GROUP(GPIOZ_2), 304 + GPIO_GROUP(GPIOZ_3), 305 + GPIO_GROUP(GPIOZ_4), 306 + GPIO_GROUP(GPIOZ_5), 307 + GPIO_GROUP(GPIOZ_6), 308 + GPIO_GROUP(GPIOZ_7), 309 + GPIO_GROUP(GPIOZ_8), 310 + GPIO_GROUP(GPIOZ_9), 311 + GPIO_GROUP(GPIOZ_10), 312 + GPIO_GROUP(GPIOZ_11), 313 + GPIO_GROUP(GPIOZ_12), 314 + GPIO_GROUP(GPIOZ_13), 315 + GPIO_GROUP(GPIOZ_14), 316 + GPIO_GROUP(GPIOZ_15), 318 317 319 - GPIO_GROUP(GPIOH_0, EE_OFF), 320 - GPIO_GROUP(GPIOH_1, EE_OFF), 321 - GPIO_GROUP(GPIOH_2, EE_OFF), 322 - GPIO_GROUP(GPIOH_3, EE_OFF), 318 + GPIO_GROUP(GPIOH_0), 319 + GPIO_GROUP(GPIOH_1), 320 + GPIO_GROUP(GPIOH_2), 321 + GPIO_GROUP(GPIOH_3), 323 322 324 - GPIO_GROUP(BOOT_0, EE_OFF), 325 - GPIO_GROUP(BOOT_1, EE_OFF), 326 - GPIO_GROUP(BOOT_2, EE_OFF), 327 - GPIO_GROUP(BOOT_3, EE_OFF), 328 - GPIO_GROUP(BOOT_4, EE_OFF), 329 - GPIO_GROUP(BOOT_5, EE_OFF), 330 - GPIO_GROUP(BOOT_6, EE_OFF), 331 - GPIO_GROUP(BOOT_7, EE_OFF), 332 - GPIO_GROUP(BOOT_8, EE_OFF), 333 - GPIO_GROUP(BOOT_9, EE_OFF), 334 - GPIO_GROUP(BOOT_10, EE_OFF), 335 - GPIO_GROUP(BOOT_11, EE_OFF), 336 - GPIO_GROUP(BOOT_12, EE_OFF), 337 - GPIO_GROUP(BOOT_13, EE_OFF), 338 - GPIO_GROUP(BOOT_14, EE_OFF), 339 - GPIO_GROUP(BOOT_15, EE_OFF), 340 - GPIO_GROUP(BOOT_16, EE_OFF), 341 - GPIO_GROUP(BOOT_17, EE_OFF), 323 + GPIO_GROUP(BOOT_0), 324 + GPIO_GROUP(BOOT_1), 325 + GPIO_GROUP(BOOT_2), 326 + GPIO_GROUP(BOOT_3), 327 + GPIO_GROUP(BOOT_4), 328 + GPIO_GROUP(BOOT_5), 329 + GPIO_GROUP(BOOT_6), 330 + GPIO_GROUP(BOOT_7), 331 + GPIO_GROUP(BOOT_8), 332 + GPIO_GROUP(BOOT_9), 333 + GPIO_GROUP(BOOT_10), 334 + GPIO_GROUP(BOOT_11), 335 + GPIO_GROUP(BOOT_12), 336 + GPIO_GROUP(BOOT_13), 337 + GPIO_GROUP(BOOT_14), 338 + GPIO_GROUP(BOOT_15), 339 + GPIO_GROUP(BOOT_16), 340 + GPIO_GROUP(BOOT_17), 342 341 343 - GPIO_GROUP(CARD_0, EE_OFF), 344 - GPIO_GROUP(CARD_1, EE_OFF), 345 - GPIO_GROUP(CARD_2, EE_OFF), 346 - GPIO_GROUP(CARD_3, EE_OFF), 347 - GPIO_GROUP(CARD_4, EE_OFF), 348 - GPIO_GROUP(CARD_5, EE_OFF), 349 - GPIO_GROUP(CARD_6, EE_OFF), 342 + GPIO_GROUP(CARD_0), 343 + GPIO_GROUP(CARD_1), 344 + GPIO_GROUP(CARD_2), 345 + GPIO_GROUP(CARD_3), 346 + GPIO_GROUP(CARD_4), 347 + GPIO_GROUP(CARD_5), 348 + GPIO_GROUP(CARD_6), 350 349 351 - GPIO_GROUP(GPIODV_0, EE_OFF), 352 - GPIO_GROUP(GPIODV_1, EE_OFF), 353 - GPIO_GROUP(GPIODV_2, EE_OFF), 354 - GPIO_GROUP(GPIODV_3, EE_OFF), 355 - GPIO_GROUP(GPIODV_4, EE_OFF), 356 - GPIO_GROUP(GPIODV_5, EE_OFF), 357 - GPIO_GROUP(GPIODV_6, EE_OFF), 358 - GPIO_GROUP(GPIODV_7, EE_OFF), 359 - GPIO_GROUP(GPIODV_8, EE_OFF), 360 - GPIO_GROUP(GPIODV_9, EE_OFF), 361 - GPIO_GROUP(GPIODV_10, EE_OFF), 362 - GPIO_GROUP(GPIODV_11, EE_OFF), 363 - GPIO_GROUP(GPIODV_12, EE_OFF), 364 - GPIO_GROUP(GPIODV_13, EE_OFF), 365 - GPIO_GROUP(GPIODV_14, EE_OFF), 366 - GPIO_GROUP(GPIODV_15, EE_OFF), 367 - GPIO_GROUP(GPIODV_16, EE_OFF), 368 - GPIO_GROUP(GPIODV_17, EE_OFF), 369 - GPIO_GROUP(GPIODV_19, EE_OFF), 370 - GPIO_GROUP(GPIODV_20, EE_OFF), 371 - GPIO_GROUP(GPIODV_21, EE_OFF), 372 - GPIO_GROUP(GPIODV_22, EE_OFF), 373 - GPIO_GROUP(GPIODV_23, EE_OFF), 374 - GPIO_GROUP(GPIODV_24, EE_OFF), 375 - GPIO_GROUP(GPIODV_25, EE_OFF), 376 - GPIO_GROUP(GPIODV_26, EE_OFF), 377 - GPIO_GROUP(GPIODV_27, EE_OFF), 378 - GPIO_GROUP(GPIODV_28, EE_OFF), 379 - GPIO_GROUP(GPIODV_29, EE_OFF), 350 + GPIO_GROUP(GPIODV_0), 351 + GPIO_GROUP(GPIODV_1), 352 + GPIO_GROUP(GPIODV_2), 353 + GPIO_GROUP(GPIODV_3), 354 + GPIO_GROUP(GPIODV_4), 355 + GPIO_GROUP(GPIODV_5), 356 + GPIO_GROUP(GPIODV_6), 357 + GPIO_GROUP(GPIODV_7), 358 + GPIO_GROUP(GPIODV_8), 359 + GPIO_GROUP(GPIODV_9), 360 + GPIO_GROUP(GPIODV_10), 361 + GPIO_GROUP(GPIODV_11), 362 + GPIO_GROUP(GPIODV_12), 363 + GPIO_GROUP(GPIODV_13), 364 + GPIO_GROUP(GPIODV_14), 365 + GPIO_GROUP(GPIODV_15), 366 + GPIO_GROUP(GPIODV_16), 367 + GPIO_GROUP(GPIODV_17), 368 + GPIO_GROUP(GPIODV_19), 369 + GPIO_GROUP(GPIODV_20), 370 + GPIO_GROUP(GPIODV_21), 371 + GPIO_GROUP(GPIODV_22), 372 + GPIO_GROUP(GPIODV_23), 373 + GPIO_GROUP(GPIODV_24), 374 + GPIO_GROUP(GPIODV_25), 375 + GPIO_GROUP(GPIODV_26), 376 + GPIO_GROUP(GPIODV_27), 377 + GPIO_GROUP(GPIODV_28), 378 + GPIO_GROUP(GPIODV_29), 380 379 381 - GPIO_GROUP(GPIOY_0, EE_OFF), 382 - GPIO_GROUP(GPIOY_1, EE_OFF), 383 - GPIO_GROUP(GPIOY_2, EE_OFF), 384 - GPIO_GROUP(GPIOY_3, EE_OFF), 385 - GPIO_GROUP(GPIOY_4, EE_OFF), 386 - GPIO_GROUP(GPIOY_5, EE_OFF), 387 - GPIO_GROUP(GPIOY_6, EE_OFF), 388 - GPIO_GROUP(GPIOY_7, EE_OFF), 389 - GPIO_GROUP(GPIOY_8, EE_OFF), 390 - GPIO_GROUP(GPIOY_9, EE_OFF), 391 - GPIO_GROUP(GPIOY_10, EE_OFF), 392 - GPIO_GROUP(GPIOY_11, EE_OFF), 393 - GPIO_GROUP(GPIOY_12, EE_OFF), 394 - GPIO_GROUP(GPIOY_13, EE_OFF), 395 - GPIO_GROUP(GPIOY_14, EE_OFF), 396 - GPIO_GROUP(GPIOY_15, EE_OFF), 397 - GPIO_GROUP(GPIOY_16, EE_OFF), 380 + GPIO_GROUP(GPIOY_0), 381 + GPIO_GROUP(GPIOY_1), 382 + GPIO_GROUP(GPIOY_2), 383 + GPIO_GROUP(GPIOY_3), 384 + GPIO_GROUP(GPIOY_4), 385 + GPIO_GROUP(GPIOY_5), 386 + GPIO_GROUP(GPIOY_6), 387 + GPIO_GROUP(GPIOY_7), 388 + GPIO_GROUP(GPIOY_8), 389 + GPIO_GROUP(GPIOY_9), 390 + GPIO_GROUP(GPIOY_10), 391 + GPIO_GROUP(GPIOY_11), 392 + GPIO_GROUP(GPIOY_12), 393 + GPIO_GROUP(GPIOY_13), 394 + GPIO_GROUP(GPIOY_14), 395 + GPIO_GROUP(GPIOY_15), 396 + GPIO_GROUP(GPIOY_16), 398 397 399 - GPIO_GROUP(GPIOX_0, EE_OFF), 400 - GPIO_GROUP(GPIOX_1, EE_OFF), 401 - GPIO_GROUP(GPIOX_2, EE_OFF), 402 - GPIO_GROUP(GPIOX_3, EE_OFF), 403 - GPIO_GROUP(GPIOX_4, EE_OFF), 404 - GPIO_GROUP(GPIOX_5, EE_OFF), 405 - GPIO_GROUP(GPIOX_6, EE_OFF), 406 - GPIO_GROUP(GPIOX_7, EE_OFF), 407 - GPIO_GROUP(GPIOX_8, EE_OFF), 408 - GPIO_GROUP(GPIOX_9, EE_OFF), 409 - GPIO_GROUP(GPIOX_10, EE_OFF), 410 - GPIO_GROUP(GPIOX_11, EE_OFF), 411 - GPIO_GROUP(GPIOX_12, EE_OFF), 412 - GPIO_GROUP(GPIOX_13, EE_OFF), 413 - GPIO_GROUP(GPIOX_14, EE_OFF), 414 - GPIO_GROUP(GPIOX_15, EE_OFF), 415 - GPIO_GROUP(GPIOX_16, EE_OFF), 416 - GPIO_GROUP(GPIOX_17, EE_OFF), 417 - GPIO_GROUP(GPIOX_18, EE_OFF), 418 - GPIO_GROUP(GPIOX_19, EE_OFF), 419 - GPIO_GROUP(GPIOX_20, EE_OFF), 420 - GPIO_GROUP(GPIOX_21, EE_OFF), 421 - GPIO_GROUP(GPIOX_22, EE_OFF), 398 + GPIO_GROUP(GPIOX_0), 399 + GPIO_GROUP(GPIOX_1), 400 + GPIO_GROUP(GPIOX_2), 401 + GPIO_GROUP(GPIOX_3), 402 + GPIO_GROUP(GPIOX_4), 403 + GPIO_GROUP(GPIOX_5), 404 + GPIO_GROUP(GPIOX_6), 405 + GPIO_GROUP(GPIOX_7), 406 + GPIO_GROUP(GPIOX_8), 407 + GPIO_GROUP(GPIOX_9), 408 + GPIO_GROUP(GPIOX_10), 409 + GPIO_GROUP(GPIOX_11), 410 + GPIO_GROUP(GPIOX_12), 411 + GPIO_GROUP(GPIOX_13), 412 + GPIO_GROUP(GPIOX_14), 413 + GPIO_GROUP(GPIOX_15), 414 + GPIO_GROUP(GPIOX_16), 415 + GPIO_GROUP(GPIOX_17), 416 + GPIO_GROUP(GPIOX_18), 417 + GPIO_GROUP(GPIOX_19), 418 + GPIO_GROUP(GPIOX_20), 419 + GPIO_GROUP(GPIOX_21), 420 + GPIO_GROUP(GPIOX_22), 422 421 423 - GPIO_GROUP(GPIOCLK_0, EE_OFF), 424 - GPIO_GROUP(GPIOCLK_1, EE_OFF), 425 - GPIO_GROUP(GPIOCLK_2, EE_OFF), 426 - GPIO_GROUP(GPIOCLK_3, EE_OFF), 422 + GPIO_GROUP(GPIOCLK_0), 423 + GPIO_GROUP(GPIOCLK_1), 424 + GPIO_GROUP(GPIOCLK_2), 425 + GPIO_GROUP(GPIOCLK_3), 427 426 428 - GPIO_GROUP(GPIO_TEST_N, EE_OFF), 427 + GPIO_GROUP(GPIO_TEST_N), 429 428 430 429 /* Bank X */ 431 430 GROUP(sdio_d0, 8, 5), ··· 521 522 }; 522 523 523 524 static struct meson_pmx_group meson_gxbb_aobus_groups[] = { 524 - GPIO_GROUP(GPIOAO_0, 0), 525 - GPIO_GROUP(GPIOAO_1, 0), 526 - GPIO_GROUP(GPIOAO_2, 0), 527 - GPIO_GROUP(GPIOAO_3, 0), 528 - GPIO_GROUP(GPIOAO_4, 0), 529 - GPIO_GROUP(GPIOAO_5, 0), 530 - GPIO_GROUP(GPIOAO_6, 0), 531 - GPIO_GROUP(GPIOAO_7, 0), 532 - GPIO_GROUP(GPIOAO_8, 0), 533 - GPIO_GROUP(GPIOAO_9, 0), 534 - GPIO_GROUP(GPIOAO_10, 0), 535 - GPIO_GROUP(GPIOAO_11, 0), 536 - GPIO_GROUP(GPIOAO_12, 0), 537 - GPIO_GROUP(GPIOAO_13, 0), 525 + GPIO_GROUP(GPIOAO_0), 526 + GPIO_GROUP(GPIOAO_1), 527 + GPIO_GROUP(GPIOAO_2), 528 + GPIO_GROUP(GPIOAO_3), 529 + GPIO_GROUP(GPIOAO_4), 530 + GPIO_GROUP(GPIOAO_5), 531 + GPIO_GROUP(GPIOAO_6), 532 + GPIO_GROUP(GPIOAO_7), 533 + GPIO_GROUP(GPIOAO_8), 534 + GPIO_GROUP(GPIOAO_9), 535 + GPIO_GROUP(GPIOAO_10), 536 + GPIO_GROUP(GPIOAO_11), 537 + GPIO_GROUP(GPIOAO_12), 538 + GPIO_GROUP(GPIOAO_13), 538 539 539 540 /* bank AO */ 540 541 GROUP(uart_tx_ao_b, 0, 24), ··· 564 565 GROUP(spdif_out_ao_13, 0, 4), 565 566 GROUP(ao_cec, 0, 15), 566 567 GROUP(ee_cec, 0, 14), 568 + 569 + /* test n pin */ 570 + GROUP(i2s_out_ch67_ao, 1, 2), 567 571 }; 568 572 569 573 static const char * const gpio_periphs_groups[] = { ··· 602 600 "GPIOX_10", "GPIOX_11", "GPIOX_12", "GPIOX_13", "GPIOX_14", 603 601 "GPIOX_15", "GPIOX_16", "GPIOX_17", "GPIOX_18", "GPIOX_19", 604 602 "GPIOX_20", "GPIOX_21", "GPIOX_22", 605 - 606 - "GPIO_TEST_N", 607 603 }; 608 604 609 605 static const char * const emmc_groups[] = { ··· 710 710 "GPIOAO_0", "GPIOAO_1", "GPIOAO_2", "GPIOAO_3", "GPIOAO_4", 711 711 "GPIOAO_5", "GPIOAO_6", "GPIOAO_7", "GPIOAO_8", "GPIOAO_9", 712 712 "GPIOAO_10", "GPIOAO_11", "GPIOAO_12", "GPIOAO_13", 713 + 714 + "GPIO_TEST_N", 713 715 }; 714 716 715 717 static const char * const uart_ao_groups[] = { ··· 753 751 static const char * const i2s_out_ao_groups[] = { 754 752 "i2s_am_clk", "i2s_out_ao_clk", "i2s_out_lr_clk", 755 753 "i2s_out_ch01_ao", "i2s_out_ch23_ao", "i2s_out_ch45_ao", 754 + "i2s_out_ch67_ao", 756 755 }; 757 756 758 757 static const char * const spdif_out_ao_groups[] = { ··· 809 806 }; 810 807 811 808 static struct meson_bank meson_gxbb_periphs_banks[] = { 812 - /* name first last irq pullen pull dir out in */ 813 - BANK("X", PIN(GPIOX_0, EE_OFF), PIN(GPIOX_22, EE_OFF), 106, 128, 4, 0, 4, 0, 12, 0, 13, 0, 14, 0), 814 - BANK("Y", PIN(GPIOY_0, EE_OFF), PIN(GPIOY_16, EE_OFF), 89, 105, 1, 0, 1, 0, 3, 0, 4, 0, 5, 0), 815 - BANK("DV", PIN(GPIODV_0, EE_OFF), PIN(GPIODV_29, EE_OFF), 59, 88, 0, 0, 0, 0, 0, 0, 1, 0, 2, 0), 816 - BANK("H", PIN(GPIOH_0, EE_OFF), PIN(GPIOH_3, EE_OFF), 30, 33, 1, 20, 1, 20, 3, 20, 4, 20, 5, 20), 817 - BANK("Z", PIN(GPIOZ_0, EE_OFF), PIN(GPIOZ_15, EE_OFF), 14, 29, 3, 0, 3, 0, 9, 0, 10, 0, 11, 0), 818 - BANK("CARD", PIN(CARD_0, EE_OFF), PIN(CARD_6, EE_OFF), 52, 58, 2, 20, 2, 20, 6, 20, 7, 20, 8, 20), 819 - BANK("BOOT", PIN(BOOT_0, EE_OFF), PIN(BOOT_17, EE_OFF), 34, 51, 2, 0, 2, 0, 6, 0, 7, 0, 8, 0), 820 - BANK("CLK", PIN(GPIOCLK_0, EE_OFF), PIN(GPIOCLK_3, EE_OFF), 129, 132, 3, 28, 3, 28, 9, 28, 10, 28, 11, 28), 809 + /* name first last irq pullen pull dir out in */ 810 + BANK("X", GPIOX_0, GPIOX_22, 106, 128, 4, 0, 4, 0, 12, 0, 13, 0, 14, 0), 811 + BANK("Y", GPIOY_0, GPIOY_16, 89, 105, 1, 0, 1, 0, 3, 0, 4, 0, 5, 0), 812 + BANK("DV", GPIODV_0, GPIODV_29, 59, 88, 0, 0, 0, 0, 0, 0, 1, 0, 2, 0), 813 + BANK("H", GPIOH_0, GPIOH_3, 30, 33, 1, 20, 1, 20, 3, 20, 4, 20, 5, 20), 814 + BANK("Z", GPIOZ_0, GPIOZ_15, 14, 29, 3, 0, 3, 0, 9, 0, 10, 0, 11, 0), 815 + BANK("CARD", CARD_0, CARD_6, 52, 58, 2, 20, 2, 20, 6, 20, 7, 20, 8, 20), 816 + BANK("BOOT", BOOT_0, BOOT_17, 34, 51, 2, 0, 2, 0, 6, 0, 7, 0, 8, 0), 817 + BANK("CLK", GPIOCLK_0, GPIOCLK_3, 129, 132, 3, 28, 3, 28, 9, 28, 10, 28, 11, 28), 821 818 }; 822 819 823 820 static struct meson_bank meson_gxbb_aobus_banks[] = { 824 - /* name first last irq pullen pull dir out in */ 825 - BANK("AO", PIN(GPIOAO_0, 0), PIN(GPIOAO_13, 0), 0, 13, 0, 0, 0, 16, 0, 0, 0, 16, 1, 0), 821 + /* name first last irq pullen pull dir out in */ 822 + BANK("AO", GPIOAO_0, GPIOAO_13, 0, 13, 0, 0, 0, 16, 0, 0, 0, 16, 1, 0), 826 823 }; 827 824 828 - struct meson_pinctrl_data meson_gxbb_periphs_pinctrl_data = { 825 + static struct meson_pinctrl_data meson_gxbb_periphs_pinctrl_data = { 829 826 .name = "periphs-banks", 830 - .pin_base = 14, 831 827 .pins = meson_gxbb_periphs_pins, 832 828 .groups = meson_gxbb_periphs_groups, 833 829 .funcs = meson_gxbb_periphs_functions, ··· 835 833 .num_groups = ARRAY_SIZE(meson_gxbb_periphs_groups), 836 834 .num_funcs = ARRAY_SIZE(meson_gxbb_periphs_functions), 837 835 .num_banks = ARRAY_SIZE(meson_gxbb_periphs_banks), 836 + .pmx_ops = &meson8_pmx_ops, 838 837 }; 839 838 840 - struct meson_pinctrl_data meson_gxbb_aobus_pinctrl_data = { 839 + static struct meson_pinctrl_data meson_gxbb_aobus_pinctrl_data = { 841 840 .name = "aobus-banks", 842 - .pin_base = 0, 843 841 .pins = meson_gxbb_aobus_pins, 844 842 .groups = meson_gxbb_aobus_groups, 845 843 .funcs = meson_gxbb_aobus_functions, ··· 848 846 .num_groups = ARRAY_SIZE(meson_gxbb_aobus_groups), 849 847 .num_funcs = ARRAY_SIZE(meson_gxbb_aobus_functions), 850 848 .num_banks = ARRAY_SIZE(meson_gxbb_aobus_banks), 849 + .pmx_ops = &meson8_pmx_ops, 851 850 }; 851 + 852 + static const struct of_device_id meson_gxbb_pinctrl_dt_match[] = { 853 + { 854 + .compatible = "amlogic,meson-gxbb-periphs-pinctrl", 855 + .data = &meson_gxbb_periphs_pinctrl_data, 856 + }, 857 + { 858 + .compatible = "amlogic,meson-gxbb-aobus-pinctrl", 859 + .data = &meson_gxbb_aobus_pinctrl_data, 860 + }, 861 + { }, 862 + }; 863 + 864 + static struct platform_driver meson_gxbb_pinctrl_driver = { 865 + .probe = meson_pinctrl_probe, 866 + .driver = { 867 + .name = "meson-gxbb-pinctrl", 868 + .of_match_table = meson_gxbb_pinctrl_dt_match, 869 + }, 870 + }; 871 + builtin_platform_driver(meson_gxbb_pinctrl_driver);
+387 -371
drivers/pinctrl/meson/pinctrl-meson-gxl.c
··· 14 14 15 15 #include <dt-bindings/gpio/meson-gxl-gpio.h> 16 16 #include "pinctrl-meson.h" 17 - 18 - #define EE_OFF 10 17 + #include "pinctrl-meson8-pmx.h" 19 18 20 19 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), 20 + MESON_PIN(GPIOZ_0), 21 + MESON_PIN(GPIOZ_1), 22 + MESON_PIN(GPIOZ_2), 23 + MESON_PIN(GPIOZ_3), 24 + MESON_PIN(GPIOZ_4), 25 + MESON_PIN(GPIOZ_5), 26 + MESON_PIN(GPIOZ_6), 27 + MESON_PIN(GPIOZ_7), 28 + MESON_PIN(GPIOZ_8), 29 + MESON_PIN(GPIOZ_9), 30 + MESON_PIN(GPIOZ_10), 31 + MESON_PIN(GPIOZ_11), 32 + MESON_PIN(GPIOZ_12), 33 + MESON_PIN(GPIOZ_13), 34 + MESON_PIN(GPIOZ_14), 35 + MESON_PIN(GPIOZ_15), 37 36 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), 37 + MESON_PIN(GPIOH_0), 38 + MESON_PIN(GPIOH_1), 39 + MESON_PIN(GPIOH_2), 40 + MESON_PIN(GPIOH_3), 41 + MESON_PIN(GPIOH_4), 42 + MESON_PIN(GPIOH_5), 43 + MESON_PIN(GPIOH_6), 44 + MESON_PIN(GPIOH_7), 45 + MESON_PIN(GPIOH_8), 46 + MESON_PIN(GPIOH_9), 48 47 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), 48 + MESON_PIN(BOOT_0), 49 + MESON_PIN(BOOT_1), 50 + MESON_PIN(BOOT_2), 51 + MESON_PIN(BOOT_3), 52 + MESON_PIN(BOOT_4), 53 + MESON_PIN(BOOT_5), 54 + MESON_PIN(BOOT_6), 55 + MESON_PIN(BOOT_7), 56 + MESON_PIN(BOOT_8), 57 + MESON_PIN(BOOT_9), 58 + MESON_PIN(BOOT_10), 59 + MESON_PIN(BOOT_11), 60 + MESON_PIN(BOOT_12), 61 + MESON_PIN(BOOT_13), 62 + MESON_PIN(BOOT_14), 63 + MESON_PIN(BOOT_15), 65 64 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), 65 + MESON_PIN(CARD_0), 66 + MESON_PIN(CARD_1), 67 + MESON_PIN(CARD_2), 68 + MESON_PIN(CARD_3), 69 + MESON_PIN(CARD_4), 70 + MESON_PIN(CARD_5), 71 + MESON_PIN(CARD_6), 73 72 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_18, EE_OFF), 93 - MESON_PIN(GPIODV_19, EE_OFF), 94 - MESON_PIN(GPIODV_20, EE_OFF), 95 - MESON_PIN(GPIODV_21, EE_OFF), 96 - MESON_PIN(GPIODV_22, EE_OFF), 97 - MESON_PIN(GPIODV_23, EE_OFF), 98 - MESON_PIN(GPIODV_24, EE_OFF), 99 - MESON_PIN(GPIODV_25, EE_OFF), 100 - MESON_PIN(GPIODV_26, EE_OFF), 101 - MESON_PIN(GPIODV_27, EE_OFF), 102 - MESON_PIN(GPIODV_28, EE_OFF), 103 - MESON_PIN(GPIODV_29, EE_OFF), 73 + MESON_PIN(GPIODV_0), 74 + MESON_PIN(GPIODV_1), 75 + MESON_PIN(GPIODV_2), 76 + MESON_PIN(GPIODV_3), 77 + MESON_PIN(GPIODV_4), 78 + MESON_PIN(GPIODV_5), 79 + MESON_PIN(GPIODV_6), 80 + MESON_PIN(GPIODV_7), 81 + MESON_PIN(GPIODV_8), 82 + MESON_PIN(GPIODV_9), 83 + MESON_PIN(GPIODV_10), 84 + MESON_PIN(GPIODV_11), 85 + MESON_PIN(GPIODV_12), 86 + MESON_PIN(GPIODV_13), 87 + MESON_PIN(GPIODV_14), 88 + MESON_PIN(GPIODV_15), 89 + MESON_PIN(GPIODV_16), 90 + MESON_PIN(GPIODV_17), 91 + MESON_PIN(GPIODV_18), 92 + MESON_PIN(GPIODV_19), 93 + MESON_PIN(GPIODV_20), 94 + MESON_PIN(GPIODV_21), 95 + MESON_PIN(GPIODV_22), 96 + MESON_PIN(GPIODV_23), 97 + MESON_PIN(GPIODV_24), 98 + MESON_PIN(GPIODV_25), 99 + MESON_PIN(GPIODV_26), 100 + MESON_PIN(GPIODV_27), 101 + MESON_PIN(GPIODV_28), 102 + MESON_PIN(GPIODV_29), 104 103 105 - MESON_PIN(GPIOX_0, EE_OFF), 106 - MESON_PIN(GPIOX_1, EE_OFF), 107 - MESON_PIN(GPIOX_2, EE_OFF), 108 - MESON_PIN(GPIOX_3, EE_OFF), 109 - MESON_PIN(GPIOX_4, EE_OFF), 110 - MESON_PIN(GPIOX_5, EE_OFF), 111 - MESON_PIN(GPIOX_6, EE_OFF), 112 - MESON_PIN(GPIOX_7, EE_OFF), 113 - MESON_PIN(GPIOX_8, EE_OFF), 114 - MESON_PIN(GPIOX_9, EE_OFF), 115 - MESON_PIN(GPIOX_10, EE_OFF), 116 - MESON_PIN(GPIOX_11, EE_OFF), 117 - MESON_PIN(GPIOX_12, EE_OFF), 118 - MESON_PIN(GPIOX_13, EE_OFF), 119 - MESON_PIN(GPIOX_14, EE_OFF), 120 - MESON_PIN(GPIOX_15, EE_OFF), 121 - MESON_PIN(GPIOX_16, EE_OFF), 122 - MESON_PIN(GPIOX_17, EE_OFF), 123 - MESON_PIN(GPIOX_18, EE_OFF), 104 + MESON_PIN(GPIOX_0), 105 + MESON_PIN(GPIOX_1), 106 + MESON_PIN(GPIOX_2), 107 + MESON_PIN(GPIOX_3), 108 + MESON_PIN(GPIOX_4), 109 + MESON_PIN(GPIOX_5), 110 + MESON_PIN(GPIOX_6), 111 + MESON_PIN(GPIOX_7), 112 + MESON_PIN(GPIOX_8), 113 + MESON_PIN(GPIOX_9), 114 + MESON_PIN(GPIOX_10), 115 + MESON_PIN(GPIOX_11), 116 + MESON_PIN(GPIOX_12), 117 + MESON_PIN(GPIOX_13), 118 + MESON_PIN(GPIOX_14), 119 + MESON_PIN(GPIOX_15), 120 + MESON_PIN(GPIOX_16), 121 + MESON_PIN(GPIOX_17), 122 + MESON_PIN(GPIOX_18), 124 123 125 - MESON_PIN(GPIOCLK_0, EE_OFF), 126 - MESON_PIN(GPIOCLK_1, EE_OFF), 127 - 128 - MESON_PIN(GPIO_TEST_N, EE_OFF), 124 + MESON_PIN(GPIOCLK_0), 125 + MESON_PIN(GPIOCLK_1), 129 126 }; 130 127 131 128 static const unsigned int emmc_nand_d07_pins[] = { 132 - PIN(BOOT_0, EE_OFF), PIN(BOOT_1, EE_OFF), PIN(BOOT_2, EE_OFF), 133 - PIN(BOOT_3, EE_OFF), PIN(BOOT_4, EE_OFF), PIN(BOOT_5, EE_OFF), 134 - PIN(BOOT_6, EE_OFF), PIN(BOOT_7, EE_OFF), 129 + BOOT_0, BOOT_1, BOOT_2, BOOT_3, BOOT_4, BOOT_5, BOOT_6, BOOT_7, 135 130 }; 136 - static const unsigned int emmc_clk_pins[] = { PIN(BOOT_8, EE_OFF) }; 137 - static const unsigned int emmc_cmd_pins[] = { PIN(BOOT_10, EE_OFF) }; 138 - static const unsigned int emmc_ds_pins[] = { PIN(BOOT_15, EE_OFF) }; 131 + static const unsigned int emmc_clk_pins[] = { BOOT_8 }; 132 + static const unsigned int emmc_cmd_pins[] = { BOOT_10 }; 133 + static const unsigned int emmc_ds_pins[] = { BOOT_15 }; 139 134 140 - static const unsigned int nor_d_pins[] = { PIN(BOOT_11, EE_OFF) }; 141 - static const unsigned int nor_q_pins[] = { PIN(BOOT_12, EE_OFF) }; 142 - static const unsigned int nor_c_pins[] = { PIN(BOOT_13, EE_OFF) }; 143 - static const unsigned int nor_cs_pins[] = { PIN(BOOT_15, EE_OFF) }; 135 + static const unsigned int nor_d_pins[] = { BOOT_11 }; 136 + static const unsigned int nor_q_pins[] = { BOOT_12 }; 137 + static const unsigned int nor_c_pins[] = { BOOT_13 }; 138 + static const unsigned int nor_cs_pins[] = { BOOT_15 }; 144 139 145 - static const unsigned int spi_mosi_pins[] = { PIN(GPIOX_8, EE_OFF) }; 146 - static const unsigned int spi_miso_pins[] = { PIN(GPIOX_9, EE_OFF) }; 147 - static const unsigned int spi_ss0_pins[] = { PIN(GPIOX_10, EE_OFF) }; 148 - static const unsigned int spi_sclk_pins[] = { PIN(GPIOX_11, EE_OFF) }; 140 + static const unsigned int spi_mosi_pins[] = { GPIOX_8 }; 141 + static const unsigned int spi_miso_pins[] = { GPIOX_9 }; 142 + static const unsigned int spi_ss0_pins[] = { GPIOX_10 }; 143 + static const unsigned int spi_sclk_pins[] = { GPIOX_11 }; 149 144 150 - static const unsigned int sdcard_d0_pins[] = { PIN(CARD_1, EE_OFF) }; 151 - static const unsigned int sdcard_d1_pins[] = { PIN(CARD_0, EE_OFF) }; 152 - static const unsigned int sdcard_d2_pins[] = { PIN(CARD_5, EE_OFF) }; 153 - static const unsigned int sdcard_d3_pins[] = { PIN(CARD_4, EE_OFF) }; 154 - static const unsigned int sdcard_cmd_pins[] = { PIN(CARD_3, EE_OFF) }; 155 - static const unsigned int sdcard_clk_pins[] = { PIN(CARD_2, EE_OFF) }; 145 + static const unsigned int sdcard_d0_pins[] = { CARD_1 }; 146 + static const unsigned int sdcard_d1_pins[] = { CARD_0 }; 147 + static const unsigned int sdcard_d2_pins[] = { CARD_5 }; 148 + static const unsigned int sdcard_d3_pins[] = { CARD_4 }; 149 + static const unsigned int sdcard_cmd_pins[] = { CARD_3 }; 150 + static const unsigned int sdcard_clk_pins[] = { CARD_2 }; 156 151 157 - static const unsigned int sdio_d0_pins[] = { PIN(GPIOX_0, EE_OFF) }; 158 - static const unsigned int sdio_d1_pins[] = { PIN(GPIOX_1, EE_OFF) }; 159 - static const unsigned int sdio_d2_pins[] = { PIN(GPIOX_2, EE_OFF) }; 160 - static const unsigned int sdio_d3_pins[] = { PIN(GPIOX_3, EE_OFF) }; 161 - static const unsigned int sdio_cmd_pins[] = { PIN(GPIOX_4, EE_OFF) }; 162 - static const unsigned int sdio_clk_pins[] = { PIN(GPIOX_5, EE_OFF) }; 163 - static const unsigned int sdio_irq_pins[] = { PIN(GPIOX_7, EE_OFF) }; 152 + static const unsigned int sdio_d0_pins[] = { GPIOX_0 }; 153 + static const unsigned int sdio_d1_pins[] = { GPIOX_1 }; 154 + static const unsigned int sdio_d2_pins[] = { GPIOX_2 }; 155 + static const unsigned int sdio_d3_pins[] = { GPIOX_3 }; 156 + static const unsigned int sdio_cmd_pins[] = { GPIOX_4 }; 157 + static const unsigned int sdio_clk_pins[] = { GPIOX_5 }; 158 + static const unsigned int sdio_irq_pins[] = { GPIOX_7 }; 164 159 165 - static const unsigned int nand_ce0_pins[] = { PIN(BOOT_8, EE_OFF) }; 166 - static const unsigned int nand_ce1_pins[] = { PIN(BOOT_9, EE_OFF) }; 167 - static const unsigned int nand_rb0_pins[] = { PIN(BOOT_10, EE_OFF) }; 168 - static const unsigned int nand_ale_pins[] = { PIN(BOOT_11, EE_OFF) }; 169 - static const unsigned int nand_cle_pins[] = { PIN(BOOT_12, EE_OFF) }; 170 - static const unsigned int nand_wen_clk_pins[] = { PIN(BOOT_13, EE_OFF) }; 171 - static const unsigned int nand_ren_wr_pins[] = { PIN(BOOT_14, EE_OFF) }; 172 - static const unsigned int nand_dqs_pins[] = { PIN(BOOT_15, EE_OFF) }; 160 + static const unsigned int nand_ce0_pins[] = { BOOT_8 }; 161 + static const unsigned int nand_ce1_pins[] = { BOOT_9 }; 162 + static const unsigned int nand_rb0_pins[] = { BOOT_10 }; 163 + static const unsigned int nand_ale_pins[] = { BOOT_11 }; 164 + static const unsigned int nand_cle_pins[] = { BOOT_12 }; 165 + static const unsigned int nand_wen_clk_pins[] = { BOOT_13 }; 166 + static const unsigned int nand_ren_wr_pins[] = { BOOT_14 }; 167 + static const unsigned int nand_dqs_pins[] = { BOOT_15 }; 173 168 174 - static const unsigned int uart_tx_a_pins[] = { PIN(GPIOX_12, EE_OFF) }; 175 - static const unsigned int uart_rx_a_pins[] = { PIN(GPIOX_13, EE_OFF) }; 176 - static const unsigned int uart_cts_a_pins[] = { PIN(GPIOX_14, EE_OFF) }; 177 - static const unsigned int uart_rts_a_pins[] = { PIN(GPIOX_15, EE_OFF) }; 169 + static const unsigned int uart_tx_a_pins[] = { GPIOX_12 }; 170 + static const unsigned int uart_rx_a_pins[] = { GPIOX_13 }; 171 + static const unsigned int uart_cts_a_pins[] = { GPIOX_14 }; 172 + static const unsigned int uart_rts_a_pins[] = { GPIOX_15 }; 178 173 179 - static const unsigned int uart_tx_b_pins[] = { PIN(GPIODV_24, EE_OFF) }; 180 - static const unsigned int uart_rx_b_pins[] = { PIN(GPIODV_25, EE_OFF) }; 181 - static const unsigned int uart_cts_b_pins[] = { PIN(GPIODV_26, EE_OFF) }; 182 - static const unsigned int uart_rts_b_pins[] = { PIN(GPIODV_27, EE_OFF) }; 174 + static const unsigned int uart_tx_b_pins[] = { GPIODV_24 }; 175 + static const unsigned int uart_rx_b_pins[] = { GPIODV_25 }; 176 + static const unsigned int uart_cts_b_pins[] = { GPIODV_26 }; 177 + static const unsigned int uart_rts_b_pins[] = { GPIODV_27 }; 183 178 184 - static const unsigned int uart_tx_c_pins[] = { PIN(GPIOX_8, EE_OFF) }; 185 - static const unsigned int uart_rx_c_pins[] = { PIN(GPIOX_9, EE_OFF) }; 186 - static const unsigned int uart_cts_c_pins[] = { PIN(GPIOX_10, EE_OFF) }; 187 - static const unsigned int uart_rts_c_pins[] = { PIN(GPIOX_11, EE_OFF) }; 179 + static const unsigned int uart_tx_c_pins[] = { GPIOX_8 }; 180 + static const unsigned int uart_rx_c_pins[] = { GPIOX_9 }; 181 + static const unsigned int uart_cts_c_pins[] = { GPIOX_10 }; 182 + static const unsigned int uart_rts_c_pins[] = { GPIOX_11 }; 188 183 189 - static const unsigned int i2c_sck_a_pins[] = { PIN(GPIODV_25, EE_OFF) }; 190 - static const unsigned int i2c_sda_a_pins[] = { PIN(GPIODV_24, EE_OFF) }; 184 + static const unsigned int i2c_sck_a_pins[] = { GPIODV_25 }; 185 + static const unsigned int i2c_sda_a_pins[] = { GPIODV_24 }; 191 186 192 - static const unsigned int i2c_sck_b_pins[] = { PIN(GPIODV_27, EE_OFF) }; 193 - static const unsigned int i2c_sda_b_pins[] = { PIN(GPIODV_26, EE_OFF) }; 187 + static const unsigned int i2c_sck_b_pins[] = { GPIODV_27 }; 188 + static const unsigned int i2c_sda_b_pins[] = { GPIODV_26 }; 194 189 195 - static const unsigned int i2c_sck_c_pins[] = { PIN(GPIODV_29, EE_OFF) }; 196 - static const unsigned int i2c_sda_c_pins[] = { PIN(GPIODV_28, EE_OFF) }; 190 + static const unsigned int i2c_sck_c_pins[] = { GPIODV_29 }; 191 + static const unsigned int i2c_sda_c_pins[] = { GPIODV_28 }; 197 192 198 - static const unsigned int i2c_sck_c_dv19_pins[] = { PIN(GPIODV_19, EE_OFF) }; 199 - static const unsigned int i2c_sda_c_dv18_pins[] = { PIN(GPIODV_18, EE_OFF) }; 193 + static const unsigned int i2c_sck_c_dv19_pins[] = { GPIODV_19 }; 194 + static const unsigned int i2c_sda_c_dv18_pins[] = { GPIODV_18 }; 200 195 201 - static const unsigned int eth_mdio_pins[] = { PIN(GPIOZ_0, EE_OFF) }; 202 - static const unsigned int eth_mdc_pins[] = { PIN(GPIOZ_1, EE_OFF) }; 203 - static const unsigned int eth_clk_rx_clk_pins[] = { PIN(GPIOZ_2, EE_OFF) }; 204 - static const unsigned int eth_rx_dv_pins[] = { PIN(GPIOZ_3, EE_OFF) }; 205 - static const unsigned int eth_rxd0_pins[] = { PIN(GPIOZ_4, EE_OFF) }; 206 - static const unsigned int eth_rxd1_pins[] = { PIN(GPIOZ_5, EE_OFF) }; 207 - static const unsigned int eth_rxd2_pins[] = { PIN(GPIOZ_6, EE_OFF) }; 208 - static const unsigned int eth_rxd3_pins[] = { PIN(GPIOZ_7, EE_OFF) }; 209 - static const unsigned int eth_rgmii_tx_clk_pins[] = { PIN(GPIOZ_8, EE_OFF) }; 210 - static const unsigned int eth_tx_en_pins[] = { PIN(GPIOZ_9, EE_OFF) }; 211 - static const unsigned int eth_txd0_pins[] = { PIN(GPIOZ_10, EE_OFF) }; 212 - static const unsigned int eth_txd1_pins[] = { PIN(GPIOZ_11, EE_OFF) }; 213 - static const unsigned int eth_txd2_pins[] = { PIN(GPIOZ_12, EE_OFF) }; 214 - static const unsigned int eth_txd3_pins[] = { PIN(GPIOZ_13, EE_OFF) }; 196 + static const unsigned int eth_mdio_pins[] = { GPIOZ_0 }; 197 + static const unsigned int eth_mdc_pins[] = { GPIOZ_1 }; 198 + static const unsigned int eth_clk_rx_clk_pins[] = { GPIOZ_2 }; 199 + static const unsigned int eth_rx_dv_pins[] = { GPIOZ_3 }; 200 + static const unsigned int eth_rxd0_pins[] = { GPIOZ_4 }; 201 + static const unsigned int eth_rxd1_pins[] = { GPIOZ_5 }; 202 + static const unsigned int eth_rxd2_pins[] = { GPIOZ_6 }; 203 + static const unsigned int eth_rxd3_pins[] = { GPIOZ_7 }; 204 + static const unsigned int eth_rgmii_tx_clk_pins[] = { GPIOZ_8 }; 205 + static const unsigned int eth_tx_en_pins[] = { GPIOZ_9 }; 206 + static const unsigned int eth_txd0_pins[] = { GPIOZ_10 }; 207 + static const unsigned int eth_txd1_pins[] = { GPIOZ_11 }; 208 + static const unsigned int eth_txd2_pins[] = { GPIOZ_12 }; 209 + static const unsigned int eth_txd3_pins[] = { GPIOZ_13 }; 215 210 216 - static const unsigned int pwm_a_pins[] = { PIN(GPIOX_6, EE_OFF) }; 211 + static const unsigned int pwm_a_pins[] = { GPIOX_6 }; 217 212 218 - static const unsigned int pwm_b_pins[] = { PIN(GPIODV_29, EE_OFF) }; 213 + static const unsigned int pwm_b_pins[] = { GPIODV_29 }; 219 214 220 - static const unsigned int pwm_c_pins[] = { PIN(GPIOZ_15, EE_OFF) }; 215 + static const unsigned int pwm_c_pins[] = { GPIOZ_15 }; 221 216 222 - static const unsigned int pwm_d_pins[] = { PIN(GPIODV_28, EE_OFF) }; 217 + static const unsigned int pwm_d_pins[] = { GPIODV_28 }; 223 218 224 - static const unsigned int pwm_e_pins[] = { PIN(GPIOX_16, EE_OFF) }; 219 + static const unsigned int pwm_e_pins[] = { GPIOX_16 }; 225 220 226 - static const unsigned int pwm_f_clk_pins[] = { PIN(GPIOCLK_1, EE_OFF) }; 227 - static const unsigned int pwm_f_x_pins[] = { PIN(GPIOX_7, EE_OFF) }; 221 + static const unsigned int pwm_f_clk_pins[] = { GPIOCLK_1 }; 222 + static const unsigned int pwm_f_x_pins[] = { GPIOX_7 }; 228 223 229 - static const unsigned int hdmi_hpd_pins[] = { PIN(GPIOH_0, EE_OFF) }; 230 - static const unsigned int hdmi_sda_pins[] = { PIN(GPIOH_1, EE_OFF) }; 231 - static const unsigned int hdmi_scl_pins[] = { PIN(GPIOH_2, EE_OFF) }; 224 + static const unsigned int hdmi_hpd_pins[] = { GPIOH_0 }; 225 + static const unsigned int hdmi_sda_pins[] = { GPIOH_1 }; 226 + static const unsigned int hdmi_scl_pins[] = { GPIOH_2 }; 232 227 233 - static const unsigned int i2s_am_clk_pins[] = { PIN(GPIOH_6, EE_OFF) }; 234 - static const unsigned int i2s_out_ao_clk_pins[] = { PIN(GPIOH_7, EE_OFF) }; 235 - static const unsigned int i2s_out_lr_clk_pins[] = { PIN(GPIOH_8, EE_OFF) }; 236 - static const unsigned int i2s_out_ch01_pins[] = { PIN(GPIOH_9, EE_OFF) }; 237 - static const unsigned int i2s_out_ch23_z_pins[] = { PIN(GPIOZ_5, EE_OFF) }; 238 - static const unsigned int i2s_out_ch45_z_pins[] = { PIN(GPIOZ_6, EE_OFF) }; 239 - static const unsigned int i2s_out_ch67_z_pins[] = { PIN(GPIOZ_7, EE_OFF) }; 228 + static const unsigned int i2s_am_clk_pins[] = { GPIOH_6 }; 229 + static const unsigned int i2s_out_ao_clk_pins[] = { GPIOH_7 }; 230 + static const unsigned int i2s_out_lr_clk_pins[] = { GPIOH_8 }; 231 + static const unsigned int i2s_out_ch01_pins[] = { GPIOH_9 }; 232 + static const unsigned int i2s_out_ch23_z_pins[] = { GPIOZ_5 }; 233 + static const unsigned int i2s_out_ch45_z_pins[] = { GPIOZ_6 }; 234 + static const unsigned int i2s_out_ch67_z_pins[] = { GPIOZ_7 }; 240 235 241 - static const unsigned int spdif_out_h_pins[] = { PIN(GPIOH_4, EE_OFF) }; 236 + static const unsigned int spdif_out_h_pins[] = { GPIOH_4 }; 242 237 243 - static const unsigned int eth_link_led_pins[] = { PIN(GPIOZ_14, EE_OFF) }; 244 - static const unsigned int eth_act_led_pins[] = { PIN(GPIOZ_15, EE_OFF) }; 238 + static const unsigned int eth_link_led_pins[] = { GPIOZ_14 }; 239 + static const unsigned int eth_act_led_pins[] = { GPIOZ_15 }; 245 240 246 - static const unsigned int tsin_a_d0_pins[] = { PIN(GPIODV_0, EE_OFF) }; 247 - static const unsigned int tsin_a_d0_x_pins[] = { PIN(GPIOX_10, EE_OFF) }; 248 - static const unsigned int tsin_a_clk_pins[] = { PIN(GPIODV_8, EE_OFF) }; 249 - static const unsigned int tsin_a_clk_x_pins[] = { PIN(GPIOX_11, EE_OFF) }; 250 - static const unsigned int tsin_a_sop_pins[] = { PIN(GPIODV_9, EE_OFF) }; 251 - static const unsigned int tsin_a_sop_x_pins[] = { PIN(GPIOX_8, EE_OFF) }; 252 - static const unsigned int tsin_a_d_valid_pins[] = { PIN(GPIODV_10, EE_OFF) }; 253 - static const unsigned int tsin_a_d_valid_x_pins[] = { PIN(GPIOX_9, EE_OFF) }; 254 - static const unsigned int tsin_a_fail_pins[] = { PIN(GPIODV_11, EE_OFF) }; 241 + static const unsigned int tsin_a_d0_pins[] = { GPIODV_0 }; 242 + static const unsigned int tsin_a_d0_x_pins[] = { GPIOX_10 }; 243 + static const unsigned int tsin_a_clk_pins[] = { GPIODV_8 }; 244 + static const unsigned int tsin_a_clk_x_pins[] = { GPIOX_11 }; 245 + static const unsigned int tsin_a_sop_pins[] = { GPIODV_9 }; 246 + static const unsigned int tsin_a_sop_x_pins[] = { GPIOX_8 }; 247 + static const unsigned int tsin_a_d_valid_pins[] = { GPIODV_10 }; 248 + static const unsigned int tsin_a_d_valid_x_pins[] = { GPIOX_9 }; 249 + static const unsigned int tsin_a_fail_pins[] = { GPIODV_11 }; 255 250 static const unsigned int tsin_a_dp_pins[] = { 256 - PIN(GPIODV_1, EE_OFF), 257 - PIN(GPIODV_2, EE_OFF), 258 - PIN(GPIODV_3, EE_OFF), 259 - PIN(GPIODV_4, EE_OFF), 260 - PIN(GPIODV_5, EE_OFF), 261 - PIN(GPIODV_6, EE_OFF), 262 - PIN(GPIODV_7, EE_OFF), 251 + GPIODV_1, GPIODV_2, GPIODV_3, GPIODV_4, GPIODV_5, GPIODV_6, GPIODV_7, 263 252 }; 264 253 265 254 static const struct pinctrl_pin_desc meson_gxl_aobus_pins[] = { 266 - MESON_PIN(GPIOAO_0, 0), 267 - MESON_PIN(GPIOAO_1, 0), 268 - MESON_PIN(GPIOAO_2, 0), 269 - MESON_PIN(GPIOAO_3, 0), 270 - MESON_PIN(GPIOAO_4, 0), 271 - MESON_PIN(GPIOAO_5, 0), 272 - MESON_PIN(GPIOAO_6, 0), 273 - MESON_PIN(GPIOAO_7, 0), 274 - MESON_PIN(GPIOAO_8, 0), 275 - MESON_PIN(GPIOAO_9, 0), 255 + MESON_PIN(GPIOAO_0), 256 + MESON_PIN(GPIOAO_1), 257 + MESON_PIN(GPIOAO_2), 258 + MESON_PIN(GPIOAO_3), 259 + MESON_PIN(GPIOAO_4), 260 + MESON_PIN(GPIOAO_5), 261 + MESON_PIN(GPIOAO_6), 262 + MESON_PIN(GPIOAO_7), 263 + MESON_PIN(GPIOAO_8), 264 + MESON_PIN(GPIOAO_9), 265 + 266 + MESON_PIN(GPIO_TEST_N), 276 267 }; 277 268 278 - static const unsigned int uart_tx_ao_a_pins[] = { PIN(GPIOAO_0, 0) }; 279 - static const unsigned int uart_rx_ao_a_pins[] = { PIN(GPIOAO_1, 0) }; 280 - static const unsigned int uart_tx_ao_b_0_pins[] = { PIN(GPIOAO_0, 0) }; 281 - static const unsigned int uart_rx_ao_b_1_pins[] = { PIN(GPIOAO_1, 0) }; 282 - static const unsigned int uart_cts_ao_a_pins[] = { PIN(GPIOAO_2, 0) }; 283 - static const unsigned int uart_rts_ao_a_pins[] = { PIN(GPIOAO_3, 0) }; 284 - static const unsigned int uart_tx_ao_b_pins[] = { PIN(GPIOAO_4, 0) }; 285 - static const unsigned int uart_rx_ao_b_pins[] = { PIN(GPIOAO_5, 0) }; 286 - static const unsigned int uart_cts_ao_b_pins[] = { PIN(GPIOAO_2, 0) }; 287 - static const unsigned int uart_rts_ao_b_pins[] = { PIN(GPIOAO_3, 0) }; 269 + static const unsigned int uart_tx_ao_a_pins[] = { GPIOAO_0 }; 270 + static const unsigned int uart_rx_ao_a_pins[] = { GPIOAO_1 }; 271 + static const unsigned int uart_tx_ao_b_0_pins[] = { GPIOAO_0 }; 272 + static const unsigned int uart_rx_ao_b_1_pins[] = { GPIOAO_1 }; 273 + static const unsigned int uart_cts_ao_a_pins[] = { GPIOAO_2 }; 274 + static const unsigned int uart_rts_ao_a_pins[] = { GPIOAO_3 }; 275 + static const unsigned int uart_tx_ao_b_pins[] = { GPIOAO_4 }; 276 + static const unsigned int uart_rx_ao_b_pins[] = { GPIOAO_5 }; 277 + static const unsigned int uart_cts_ao_b_pins[] = { GPIOAO_2 }; 278 + static const unsigned int uart_rts_ao_b_pins[] = { GPIOAO_3 }; 288 279 289 - static const unsigned int i2c_sck_ao_pins[] = {PIN(GPIOAO_4, 0) }; 290 - static const unsigned int i2c_sda_ao_pins[] = {PIN(GPIOAO_5, 0) }; 291 - static const unsigned int i2c_slave_sck_ao_pins[] = {PIN(GPIOAO_4, 0) }; 292 - static const unsigned int i2c_slave_sda_ao_pins[] = {PIN(GPIOAO_5, 0) }; 280 + static const unsigned int i2c_sck_ao_pins[] = {GPIOAO_4 }; 281 + static const unsigned int i2c_sda_ao_pins[] = {GPIOAO_5 }; 282 + static const unsigned int i2c_slave_sck_ao_pins[] = {GPIOAO_4 }; 283 + static const unsigned int i2c_slave_sda_ao_pins[] = {GPIOAO_5 }; 293 284 294 - static const unsigned int remote_input_ao_pins[] = {PIN(GPIOAO_7, 0) }; 285 + static const unsigned int remote_input_ao_pins[] = {GPIOAO_7 }; 295 286 296 - static const unsigned int pwm_ao_a_3_pins[] = { PIN(GPIOAO_3, 0) }; 297 - static const unsigned int pwm_ao_a_8_pins[] = { PIN(GPIOAO_8, 0) }; 287 + static const unsigned int pwm_ao_a_3_pins[] = { GPIOAO_3 }; 288 + static const unsigned int pwm_ao_a_8_pins[] = { GPIOAO_8 }; 298 289 299 - static const unsigned int pwm_ao_b_pins[] = { PIN(GPIOAO_9, 0) }; 300 - static const unsigned int pwm_ao_b_6_pins[] = { PIN(GPIOAO_6, 0) }; 290 + static const unsigned int pwm_ao_b_pins[] = { GPIOAO_9 }; 291 + static const unsigned int pwm_ao_b_6_pins[] = { GPIOAO_6 }; 301 292 302 - static const unsigned int i2s_out_ch23_ao_pins[] = { PIN(GPIOAO_8, 0) }; 303 - static const unsigned int i2s_out_ch45_ao_pins[] = { PIN(GPIOAO_9, 0) }; 293 + static const unsigned int i2s_out_ch23_ao_pins[] = { GPIOAO_8 }; 294 + static const unsigned int i2s_out_ch45_ao_pins[] = { GPIOAO_9 }; 295 + static const unsigned int i2s_out_ch67_ao_pins[] = { GPIO_TEST_N }; 304 296 305 - static const unsigned int spdif_out_ao_6_pins[] = { PIN(GPIOAO_6, 0) }; 306 - static const unsigned int spdif_out_ao_9_pins[] = { PIN(GPIOAO_9, 0) }; 297 + static const unsigned int spdif_out_ao_6_pins[] = { GPIOAO_6 }; 298 + static const unsigned int spdif_out_ao_9_pins[] = { GPIOAO_9 }; 307 299 308 - static const unsigned int ao_cec_pins[] = { PIN(GPIOAO_8, 0) }; 309 - static const unsigned int ee_cec_pins[] = { PIN(GPIOAO_8, 0) }; 300 + static const unsigned int ao_cec_pins[] = { GPIOAO_8 }; 301 + static const unsigned int ee_cec_pins[] = { GPIOAO_8 }; 310 302 311 303 static struct meson_pmx_group meson_gxl_periphs_groups[] = { 312 - GPIO_GROUP(GPIOZ_0, EE_OFF), 313 - GPIO_GROUP(GPIOZ_1, EE_OFF), 314 - GPIO_GROUP(GPIOZ_2, EE_OFF), 315 - GPIO_GROUP(GPIOZ_3, EE_OFF), 316 - GPIO_GROUP(GPIOZ_4, EE_OFF), 317 - GPIO_GROUP(GPIOZ_5, EE_OFF), 318 - GPIO_GROUP(GPIOZ_6, EE_OFF), 319 - GPIO_GROUP(GPIOZ_7, EE_OFF), 320 - GPIO_GROUP(GPIOZ_8, EE_OFF), 321 - GPIO_GROUP(GPIOZ_9, EE_OFF), 322 - GPIO_GROUP(GPIOZ_10, EE_OFF), 323 - GPIO_GROUP(GPIOZ_11, EE_OFF), 324 - GPIO_GROUP(GPIOZ_12, EE_OFF), 325 - GPIO_GROUP(GPIOZ_13, EE_OFF), 326 - GPIO_GROUP(GPIOZ_14, EE_OFF), 327 - GPIO_GROUP(GPIOZ_15, EE_OFF), 304 + GPIO_GROUP(GPIOZ_0), 305 + GPIO_GROUP(GPIOZ_1), 306 + GPIO_GROUP(GPIOZ_2), 307 + GPIO_GROUP(GPIOZ_3), 308 + GPIO_GROUP(GPIOZ_4), 309 + GPIO_GROUP(GPIOZ_5), 310 + GPIO_GROUP(GPIOZ_6), 311 + GPIO_GROUP(GPIOZ_7), 312 + GPIO_GROUP(GPIOZ_8), 313 + GPIO_GROUP(GPIOZ_9), 314 + GPIO_GROUP(GPIOZ_10), 315 + GPIO_GROUP(GPIOZ_11), 316 + GPIO_GROUP(GPIOZ_12), 317 + GPIO_GROUP(GPIOZ_13), 318 + GPIO_GROUP(GPIOZ_14), 319 + GPIO_GROUP(GPIOZ_15), 328 320 329 - GPIO_GROUP(GPIOH_0, EE_OFF), 330 - GPIO_GROUP(GPIOH_1, EE_OFF), 331 - GPIO_GROUP(GPIOH_2, EE_OFF), 332 - GPIO_GROUP(GPIOH_3, EE_OFF), 333 - GPIO_GROUP(GPIOH_4, EE_OFF), 334 - GPIO_GROUP(GPIOH_5, EE_OFF), 335 - GPIO_GROUP(GPIOH_6, EE_OFF), 336 - GPIO_GROUP(GPIOH_7, EE_OFF), 337 - GPIO_GROUP(GPIOH_8, EE_OFF), 338 - GPIO_GROUP(GPIOH_9, EE_OFF), 321 + GPIO_GROUP(GPIOH_0), 322 + GPIO_GROUP(GPIOH_1), 323 + GPIO_GROUP(GPIOH_2), 324 + GPIO_GROUP(GPIOH_3), 325 + GPIO_GROUP(GPIOH_4), 326 + GPIO_GROUP(GPIOH_5), 327 + GPIO_GROUP(GPIOH_6), 328 + GPIO_GROUP(GPIOH_7), 329 + GPIO_GROUP(GPIOH_8), 330 + GPIO_GROUP(GPIOH_9), 339 331 340 - GPIO_GROUP(BOOT_0, EE_OFF), 341 - GPIO_GROUP(BOOT_1, EE_OFF), 342 - GPIO_GROUP(BOOT_2, EE_OFF), 343 - GPIO_GROUP(BOOT_3, EE_OFF), 344 - GPIO_GROUP(BOOT_4, EE_OFF), 345 - GPIO_GROUP(BOOT_5, EE_OFF), 346 - GPIO_GROUP(BOOT_6, EE_OFF), 347 - GPIO_GROUP(BOOT_7, EE_OFF), 348 - GPIO_GROUP(BOOT_8, EE_OFF), 349 - GPIO_GROUP(BOOT_9, EE_OFF), 350 - GPIO_GROUP(BOOT_10, EE_OFF), 351 - GPIO_GROUP(BOOT_11, EE_OFF), 352 - GPIO_GROUP(BOOT_12, EE_OFF), 353 - GPIO_GROUP(BOOT_13, EE_OFF), 354 - GPIO_GROUP(BOOT_14, EE_OFF), 355 - GPIO_GROUP(BOOT_15, EE_OFF), 332 + GPIO_GROUP(BOOT_0), 333 + GPIO_GROUP(BOOT_1), 334 + GPIO_GROUP(BOOT_2), 335 + GPIO_GROUP(BOOT_3), 336 + GPIO_GROUP(BOOT_4), 337 + GPIO_GROUP(BOOT_5), 338 + GPIO_GROUP(BOOT_6), 339 + GPIO_GROUP(BOOT_7), 340 + GPIO_GROUP(BOOT_8), 341 + GPIO_GROUP(BOOT_9), 342 + GPIO_GROUP(BOOT_10), 343 + GPIO_GROUP(BOOT_11), 344 + GPIO_GROUP(BOOT_12), 345 + GPIO_GROUP(BOOT_13), 346 + GPIO_GROUP(BOOT_14), 347 + GPIO_GROUP(BOOT_15), 356 348 357 - GPIO_GROUP(CARD_0, EE_OFF), 358 - GPIO_GROUP(CARD_1, EE_OFF), 359 - GPIO_GROUP(CARD_2, EE_OFF), 360 - GPIO_GROUP(CARD_3, EE_OFF), 361 - GPIO_GROUP(CARD_4, EE_OFF), 362 - GPIO_GROUP(CARD_5, EE_OFF), 363 - GPIO_GROUP(CARD_6, EE_OFF), 349 + GPIO_GROUP(CARD_0), 350 + GPIO_GROUP(CARD_1), 351 + GPIO_GROUP(CARD_2), 352 + GPIO_GROUP(CARD_3), 353 + GPIO_GROUP(CARD_4), 354 + GPIO_GROUP(CARD_5), 355 + GPIO_GROUP(CARD_6), 364 356 365 - GPIO_GROUP(GPIODV_0, EE_OFF), 366 - GPIO_GROUP(GPIODV_1, EE_OFF), 367 - GPIO_GROUP(GPIODV_2, EE_OFF), 368 - GPIO_GROUP(GPIODV_3, EE_OFF), 369 - GPIO_GROUP(GPIODV_4, EE_OFF), 370 - GPIO_GROUP(GPIODV_5, EE_OFF), 371 - GPIO_GROUP(GPIODV_6, EE_OFF), 372 - GPIO_GROUP(GPIODV_7, EE_OFF), 373 - GPIO_GROUP(GPIODV_8, EE_OFF), 374 - GPIO_GROUP(GPIODV_9, EE_OFF), 375 - GPIO_GROUP(GPIODV_10, EE_OFF), 376 - GPIO_GROUP(GPIODV_11, EE_OFF), 377 - GPIO_GROUP(GPIODV_12, EE_OFF), 378 - GPIO_GROUP(GPIODV_13, EE_OFF), 379 - GPIO_GROUP(GPIODV_14, EE_OFF), 380 - GPIO_GROUP(GPIODV_15, EE_OFF), 381 - GPIO_GROUP(GPIODV_16, EE_OFF), 382 - GPIO_GROUP(GPIODV_17, EE_OFF), 383 - GPIO_GROUP(GPIODV_19, EE_OFF), 384 - GPIO_GROUP(GPIODV_20, EE_OFF), 385 - GPIO_GROUP(GPIODV_21, EE_OFF), 386 - GPIO_GROUP(GPIODV_22, EE_OFF), 387 - GPIO_GROUP(GPIODV_23, EE_OFF), 388 - GPIO_GROUP(GPIODV_24, EE_OFF), 389 - GPIO_GROUP(GPIODV_25, EE_OFF), 390 - GPIO_GROUP(GPIODV_26, EE_OFF), 391 - GPIO_GROUP(GPIODV_27, EE_OFF), 392 - GPIO_GROUP(GPIODV_28, EE_OFF), 393 - GPIO_GROUP(GPIODV_29, EE_OFF), 357 + GPIO_GROUP(GPIODV_0), 358 + GPIO_GROUP(GPIODV_1), 359 + GPIO_GROUP(GPIODV_2), 360 + GPIO_GROUP(GPIODV_3), 361 + GPIO_GROUP(GPIODV_4), 362 + GPIO_GROUP(GPIODV_5), 363 + GPIO_GROUP(GPIODV_6), 364 + GPIO_GROUP(GPIODV_7), 365 + GPIO_GROUP(GPIODV_8), 366 + GPIO_GROUP(GPIODV_9), 367 + GPIO_GROUP(GPIODV_10), 368 + GPIO_GROUP(GPIODV_11), 369 + GPIO_GROUP(GPIODV_12), 370 + GPIO_GROUP(GPIODV_13), 371 + GPIO_GROUP(GPIODV_14), 372 + GPIO_GROUP(GPIODV_15), 373 + GPIO_GROUP(GPIODV_16), 374 + GPIO_GROUP(GPIODV_17), 375 + GPIO_GROUP(GPIODV_19), 376 + GPIO_GROUP(GPIODV_20), 377 + GPIO_GROUP(GPIODV_21), 378 + GPIO_GROUP(GPIODV_22), 379 + GPIO_GROUP(GPIODV_23), 380 + GPIO_GROUP(GPIODV_24), 381 + GPIO_GROUP(GPIODV_25), 382 + GPIO_GROUP(GPIODV_26), 383 + GPIO_GROUP(GPIODV_27), 384 + GPIO_GROUP(GPIODV_28), 385 + GPIO_GROUP(GPIODV_29), 394 386 395 - GPIO_GROUP(GPIOX_0, EE_OFF), 396 - GPIO_GROUP(GPIOX_1, EE_OFF), 397 - GPIO_GROUP(GPIOX_2, EE_OFF), 398 - GPIO_GROUP(GPIOX_3, EE_OFF), 399 - GPIO_GROUP(GPIOX_4, EE_OFF), 400 - GPIO_GROUP(GPIOX_5, EE_OFF), 401 - GPIO_GROUP(GPIOX_6, EE_OFF), 402 - GPIO_GROUP(GPIOX_7, EE_OFF), 403 - GPIO_GROUP(GPIOX_8, EE_OFF), 404 - GPIO_GROUP(GPIOX_9, EE_OFF), 405 - GPIO_GROUP(GPIOX_10, EE_OFF), 406 - GPIO_GROUP(GPIOX_11, EE_OFF), 407 - GPIO_GROUP(GPIOX_12, EE_OFF), 408 - GPIO_GROUP(GPIOX_13, EE_OFF), 409 - GPIO_GROUP(GPIOX_14, EE_OFF), 410 - GPIO_GROUP(GPIOX_15, EE_OFF), 411 - GPIO_GROUP(GPIOX_16, EE_OFF), 412 - GPIO_GROUP(GPIOX_17, EE_OFF), 413 - GPIO_GROUP(GPIOX_18, EE_OFF), 387 + GPIO_GROUP(GPIOX_0), 388 + GPIO_GROUP(GPIOX_1), 389 + GPIO_GROUP(GPIOX_2), 390 + GPIO_GROUP(GPIOX_3), 391 + GPIO_GROUP(GPIOX_4), 392 + GPIO_GROUP(GPIOX_5), 393 + GPIO_GROUP(GPIOX_6), 394 + GPIO_GROUP(GPIOX_7), 395 + GPIO_GROUP(GPIOX_8), 396 + GPIO_GROUP(GPIOX_9), 397 + GPIO_GROUP(GPIOX_10), 398 + GPIO_GROUP(GPIOX_11), 399 + GPIO_GROUP(GPIOX_12), 400 + GPIO_GROUP(GPIOX_13), 401 + GPIO_GROUP(GPIOX_14), 402 + GPIO_GROUP(GPIOX_15), 403 + GPIO_GROUP(GPIOX_16), 404 + GPIO_GROUP(GPIOX_17), 405 + GPIO_GROUP(GPIOX_18), 414 406 415 - GPIO_GROUP(GPIOCLK_0, EE_OFF), 416 - GPIO_GROUP(GPIOCLK_1, EE_OFF), 407 + GPIO_GROUP(GPIOCLK_0), 408 + GPIO_GROUP(GPIOCLK_1), 417 409 418 - GPIO_GROUP(GPIO_TEST_N, EE_OFF), 410 + GPIO_GROUP(GPIO_TEST_N), 419 411 420 412 /* Bank X */ 421 413 GROUP(sdio_d0, 5, 31), ··· 522 530 }; 523 531 524 532 static struct meson_pmx_group meson_gxl_aobus_groups[] = { 525 - GPIO_GROUP(GPIOAO_0, 0), 526 - GPIO_GROUP(GPIOAO_1, 0), 527 - GPIO_GROUP(GPIOAO_2, 0), 528 - GPIO_GROUP(GPIOAO_3, 0), 529 - GPIO_GROUP(GPIOAO_4, 0), 530 - GPIO_GROUP(GPIOAO_5, 0), 531 - GPIO_GROUP(GPIOAO_6, 0), 532 - GPIO_GROUP(GPIOAO_7, 0), 533 - GPIO_GROUP(GPIOAO_8, 0), 534 - GPIO_GROUP(GPIOAO_9, 0), 533 + GPIO_GROUP(GPIOAO_0), 534 + GPIO_GROUP(GPIOAO_1), 535 + GPIO_GROUP(GPIOAO_2), 536 + GPIO_GROUP(GPIOAO_3), 537 + GPIO_GROUP(GPIOAO_4), 538 + GPIO_GROUP(GPIOAO_5), 539 + GPIO_GROUP(GPIOAO_6), 540 + GPIO_GROUP(GPIOAO_7), 541 + GPIO_GROUP(GPIOAO_8), 542 + GPIO_GROUP(GPIOAO_9), 535 543 536 544 /* bank AO */ 537 545 GROUP(uart_tx_ao_b_0, 0, 26), ··· 559 567 GROUP(spdif_out_ao_9, 0, 4), 560 568 GROUP(ao_cec, 0, 15), 561 569 GROUP(ee_cec, 0, 14), 570 + 571 + /* test n pin */ 572 + GROUP(i2s_out_ch67_ao, 1, 2), 562 573 }; 563 574 564 575 static const char * const gpio_periphs_groups[] = { ··· 592 597 "GPIOX_5", "GPIOX_6", "GPIOX_7", "GPIOX_8", "GPIOX_9", 593 598 "GPIOX_10", "GPIOX_11", "GPIOX_12", "GPIOX_13", "GPIOX_14", 594 599 "GPIOX_15", "GPIOX_16", "GPIOX_17", "GPIOX_18", 595 - 596 - "GPIO_TEST_N", 597 600 }; 598 601 599 602 static const char * const emmc_groups[] = { ··· 706 713 static const char * const gpio_aobus_groups[] = { 707 714 "GPIOAO_0", "GPIOAO_1", "GPIOAO_2", "GPIOAO_3", "GPIOAO_4", 708 715 "GPIOAO_5", "GPIOAO_6", "GPIOAO_7", "GPIOAO_8", "GPIOAO_9", 716 + 717 + "GPIO_TEST_N", 709 718 }; 710 719 711 720 static const char * const uart_ao_groups[] = { ··· 740 745 }; 741 746 742 747 static const char * const i2s_out_ao_groups[] = { 743 - "i2s_out_ch23_ao", "i2s_out_ch45_ao", 748 + "i2s_out_ch23_ao", "i2s_out_ch45_ao", "i2s_out_ch67_ao", 744 749 }; 745 750 746 751 static const char * const spdif_out_ao_groups[] = { ··· 795 800 }; 796 801 797 802 static struct meson_bank meson_gxl_periphs_banks[] = { 798 - /* name first last irq pullen pull dir out in */ 799 - BANK("X", PIN(GPIOX_0, EE_OFF), PIN(GPIOX_18, EE_OFF), 89, 107, 4, 0, 4, 0, 12, 0, 13, 0, 14, 0), 800 - BANK("DV", PIN(GPIODV_0, EE_OFF), PIN(GPIODV_29, EE_OFF), 83, 88, 0, 0, 0, 0, 0, 0, 1, 0, 2, 0), 801 - BANK("H", PIN(GPIOH_0, EE_OFF), PIN(GPIOH_9, EE_OFF), 26, 35, 1, 20, 1, 20, 3, 20, 4, 20, 5, 20), 802 - BANK("Z", PIN(GPIOZ_0, EE_OFF), PIN(GPIOZ_15, EE_OFF), 10, 25, 3, 0, 3, 0, 9, 0, 10, 0, 11, 0), 803 - BANK("CARD", PIN(CARD_0, EE_OFF), PIN(CARD_6, EE_OFF), 52, 58, 2, 20, 2, 20, 6, 20, 7, 20, 8, 20), 804 - BANK("BOOT", PIN(BOOT_0, EE_OFF), PIN(BOOT_15, EE_OFF), 36, 51, 2, 0, 2, 0, 6, 0, 7, 0, 8, 0), 805 - BANK("CLK", PIN(GPIOCLK_0, EE_OFF), PIN(GPIOCLK_1, EE_OFF), 108, 109, 3, 28, 3, 28, 9, 28, 10, 28, 11, 28), 803 + /* name first last irq pullen pull dir out in */ 804 + BANK("X", GPIOX_0, GPIOX_18, 89, 107, 4, 0, 4, 0, 12, 0, 13, 0, 14, 0), 805 + BANK("DV", GPIODV_0, GPIODV_29, 83, 88, 0, 0, 0, 0, 0, 0, 1, 0, 2, 0), 806 + BANK("H", GPIOH_0, GPIOH_9, 26, 35, 1, 20, 1, 20, 3, 20, 4, 20, 5, 20), 807 + BANK("Z", GPIOZ_0, GPIOZ_15, 10, 25, 3, 0, 3, 0, 9, 0, 10, 0, 11, 0), 808 + BANK("CARD", CARD_0, CARD_6, 52, 58, 2, 20, 2, 20, 6, 20, 7, 20, 8, 20), 809 + BANK("BOOT", BOOT_0, BOOT_15, 36, 51, 2, 0, 2, 0, 6, 0, 7, 0, 8, 0), 810 + BANK("CLK", GPIOCLK_0, GPIOCLK_1, 108, 109, 3, 28, 3, 28, 9, 28, 10, 28, 11, 28), 806 811 }; 807 812 808 813 static struct meson_bank meson_gxl_aobus_banks[] = { 809 - /* name first last irq pullen pull dir out in */ 810 - BANK("AO", PIN(GPIOAO_0, 0), PIN(GPIOAO_9, 0), 0, 9, 0, 0, 0, 16, 0, 0, 0, 16, 1, 0), 814 + /* name first last irq pullen pull dir out in */ 815 + BANK("AO", GPIOAO_0, GPIOAO_9, 0, 9, 0, 0, 0, 16, 0, 0, 0, 16, 1, 0), 811 816 }; 812 817 813 - struct meson_pinctrl_data meson_gxl_periphs_pinctrl_data = { 818 + static struct meson_pinctrl_data meson_gxl_periphs_pinctrl_data = { 814 819 .name = "periphs-banks", 815 - .pin_base = 10, 816 820 .pins = meson_gxl_periphs_pins, 817 821 .groups = meson_gxl_periphs_groups, 818 822 .funcs = meson_gxl_periphs_functions, ··· 820 826 .num_groups = ARRAY_SIZE(meson_gxl_periphs_groups), 821 827 .num_funcs = ARRAY_SIZE(meson_gxl_periphs_functions), 822 828 .num_banks = ARRAY_SIZE(meson_gxl_periphs_banks), 829 + .pmx_ops = &meson8_pmx_ops, 823 830 }; 824 831 825 - struct meson_pinctrl_data meson_gxl_aobus_pinctrl_data = { 832 + static struct meson_pinctrl_data meson_gxl_aobus_pinctrl_data = { 826 833 .name = "aobus-banks", 827 - .pin_base = 0, 828 834 .pins = meson_gxl_aobus_pins, 829 835 .groups = meson_gxl_aobus_groups, 830 836 .funcs = meson_gxl_aobus_functions, ··· 833 839 .num_groups = ARRAY_SIZE(meson_gxl_aobus_groups), 834 840 .num_funcs = ARRAY_SIZE(meson_gxl_aobus_functions), 835 841 .num_banks = ARRAY_SIZE(meson_gxl_aobus_banks), 842 + .pmx_ops = &meson8_pmx_ops, 836 843 }; 844 + 845 + static const struct of_device_id meson_gxl_pinctrl_dt_match[] = { 846 + { 847 + .compatible = "amlogic,meson-gxl-periphs-pinctrl", 848 + .data = &meson_gxl_periphs_pinctrl_data, 849 + }, 850 + { 851 + .compatible = "amlogic,meson-gxl-aobus-pinctrl", 852 + .data = &meson_gxl_aobus_pinctrl_data, 853 + }, 854 + { }, 855 + }; 856 + 857 + static struct platform_driver meson_gxl_pinctrl_driver = { 858 + .probe = meson_pinctrl_probe, 859 + .driver = { 860 + .name = "meson-gxl-pinctrl", 861 + .of_match_table = meson_gxl_pinctrl_dt_match, 862 + }, 863 + }; 864 + builtin_platform_driver(meson_gxl_pinctrl_driver);
+28 -172
drivers/pinctrl/meson/pinctrl-meson.c
··· 31 31 * In some cases the register ranges for pull enable and pull 32 32 * direction are the same and thus there are only 3 register ranges. 33 33 * 34 - * Every pinmux group can be enabled by a specific bit in the first 35 - * register range; when all groups for a given pin are disabled the 36 - * pin acts as a GPIO. 37 - * 38 34 * For the pull and GPIO configuration every bank uses a contiguous 39 35 * set of bits in the register sets described above; the same register 40 36 * can be shared by more banks with different offsets. ··· 46 50 #include <linux/io.h> 47 51 #include <linux/of.h> 48 52 #include <linux/of_address.h> 53 + #include <linux/of_device.h> 49 54 #include <linux/pinctrl/pinconf-generic.h> 50 55 #include <linux/pinctrl/pinconf.h> 51 56 #include <linux/pinctrl/pinctrl.h> ··· 144 147 .pin_dbg_show = meson_pin_dbg_show, 145 148 }; 146 149 147 - /** 148 - * meson_pmx_disable_other_groups() - disable other groups using a given pin 149 - * 150 - * @pc: meson pin controller device 151 - * @pin: number of the pin 152 - * @sel_group: index of the selected group, or -1 if none 153 - * 154 - * The function disables all pinmux groups using a pin except the 155 - * selected one. If @sel_group is -1 all groups are disabled, leaving 156 - * the pin in GPIO mode. 157 - */ 158 - static void meson_pmx_disable_other_groups(struct meson_pinctrl *pc, 159 - unsigned int pin, int sel_group) 160 - { 161 - struct meson_pmx_group *group; 162 - int i, j; 163 - 164 - for (i = 0; i < pc->data->num_groups; i++) { 165 - group = &pc->data->groups[i]; 166 - if (group->is_gpio || i == sel_group) 167 - continue; 168 - 169 - for (j = 0; j < group->num_pins; j++) { 170 - if (group->pins[j] == pin) { 171 - /* We have found a group using the pin */ 172 - regmap_update_bits(pc->reg_mux, 173 - group->reg * 4, 174 - BIT(group->bit), 0); 175 - } 176 - } 177 - } 178 - } 179 - 180 - static int meson_pmx_set_mux(struct pinctrl_dev *pcdev, unsigned func_num, 181 - unsigned group_num) 182 - { 183 - struct meson_pinctrl *pc = pinctrl_dev_get_drvdata(pcdev); 184 - struct meson_pmx_func *func = &pc->data->funcs[func_num]; 185 - struct meson_pmx_group *group = &pc->data->groups[group_num]; 186 - int i, ret = 0; 187 - 188 - dev_dbg(pc->dev, "enable function %s, group %s\n", func->name, 189 - group->name); 190 - 191 - /* 192 - * Disable groups using the same pin. 193 - * The selected group is not disabled to avoid glitches. 194 - */ 195 - for (i = 0; i < group->num_pins; i++) 196 - meson_pmx_disable_other_groups(pc, group->pins[i], group_num); 197 - 198 - /* Function 0 (GPIO) doesn't need any additional setting */ 199 - if (func_num) 200 - ret = regmap_update_bits(pc->reg_mux, group->reg * 4, 201 - BIT(group->bit), BIT(group->bit)); 202 - 203 - return ret; 204 - } 205 - 206 - static int meson_pmx_request_gpio(struct pinctrl_dev *pcdev, 207 - struct pinctrl_gpio_range *range, 208 - unsigned offset) 209 - { 210 - struct meson_pinctrl *pc = pinctrl_dev_get_drvdata(pcdev); 211 - 212 - meson_pmx_disable_other_groups(pc, offset, -1); 213 - 214 - return 0; 215 - } 216 - 217 - static int meson_pmx_get_funcs_count(struct pinctrl_dev *pcdev) 150 + int meson_pmx_get_funcs_count(struct pinctrl_dev *pcdev) 218 151 { 219 152 struct meson_pinctrl *pc = pinctrl_dev_get_drvdata(pcdev); 220 153 221 154 return pc->data->num_funcs; 222 155 } 223 156 224 - static const char *meson_pmx_get_func_name(struct pinctrl_dev *pcdev, 225 - unsigned selector) 157 + const char *meson_pmx_get_func_name(struct pinctrl_dev *pcdev, 158 + unsigned selector) 226 159 { 227 160 struct meson_pinctrl *pc = pinctrl_dev_get_drvdata(pcdev); 228 161 229 162 return pc->data->funcs[selector].name; 230 163 } 231 164 232 - static int meson_pmx_get_groups(struct pinctrl_dev *pcdev, unsigned selector, 233 - const char * const **groups, 234 - unsigned * const num_groups) 165 + int meson_pmx_get_groups(struct pinctrl_dev *pcdev, unsigned selector, 166 + const char * const **groups, 167 + unsigned * const num_groups) 235 168 { 236 169 struct meson_pinctrl *pc = pinctrl_dev_get_drvdata(pcdev); 237 170 ··· 170 243 171 244 return 0; 172 245 } 173 - 174 - static const struct pinmux_ops meson_pmx_ops = { 175 - .set_mux = meson_pmx_set_mux, 176 - .get_functions_count = meson_pmx_get_funcs_count, 177 - .get_function_name = meson_pmx_get_func_name, 178 - .get_function_groups = meson_pmx_get_groups, 179 - .gpio_request_enable = meson_pmx_request_gpio, 180 - }; 181 246 182 247 static int meson_pinconf_set(struct pinctrl_dev *pcdev, unsigned int pin, 183 248 unsigned long *configs, unsigned num_configs) ··· 318 399 static int meson_pinconf_group_get(struct pinctrl_dev *pcdev, 319 400 unsigned int group, unsigned long *config) 320 401 { 321 - return -ENOSYS; 402 + return -ENOTSUPP; 322 403 } 323 404 324 405 static const struct pinconf_ops meson_pinconf_ops = { ··· 329 410 .is_generic = true, 330 411 }; 331 412 332 - static int meson_gpio_request(struct gpio_chip *chip, unsigned gpio) 333 - { 334 - return pinctrl_request_gpio(chip->base + gpio); 335 - } 336 - 337 - static void meson_gpio_free(struct gpio_chip *chip, unsigned gpio) 338 - { 339 - struct meson_pinctrl *pc = gpiochip_get_data(chip); 340 - 341 - pinctrl_free_gpio(pc->data->pin_base + gpio); 342 - } 343 - 344 413 static int meson_gpio_direction_input(struct gpio_chip *chip, unsigned gpio) 345 414 { 346 415 struct meson_pinctrl *pc = gpiochip_get_data(chip); 347 - unsigned int reg, bit, pin; 416 + unsigned int reg, bit; 348 417 struct meson_bank *bank; 349 418 int ret; 350 419 351 - pin = pc->data->pin_base + gpio; 352 - ret = meson_get_bank(pc, pin, &bank); 420 + ret = meson_get_bank(pc, gpio, &bank); 353 421 if (ret) 354 422 return ret; 355 423 356 - meson_calc_reg_and_bit(bank, pin, REG_DIR, &reg, &bit); 424 + meson_calc_reg_and_bit(bank, gpio, REG_DIR, &reg, &bit); 357 425 358 426 return regmap_update_bits(pc->reg_gpio, reg, BIT(bit), BIT(bit)); 359 427 } ··· 349 443 int value) 350 444 { 351 445 struct meson_pinctrl *pc = gpiochip_get_data(chip); 352 - unsigned int reg, bit, pin; 446 + unsigned int reg, bit; 353 447 struct meson_bank *bank; 354 448 int ret; 355 449 356 - pin = pc->data->pin_base + gpio; 357 - ret = meson_get_bank(pc, pin, &bank); 450 + ret = meson_get_bank(pc, gpio, &bank); 358 451 if (ret) 359 452 return ret; 360 453 361 - meson_calc_reg_and_bit(bank, pin, REG_DIR, &reg, &bit); 454 + meson_calc_reg_and_bit(bank, gpio, REG_DIR, &reg, &bit); 362 455 ret = regmap_update_bits(pc->reg_gpio, reg, BIT(bit), 0); 363 456 if (ret) 364 457 return ret; 365 458 366 - meson_calc_reg_and_bit(bank, pin, REG_OUT, &reg, &bit); 459 + meson_calc_reg_and_bit(bank, gpio, REG_OUT, &reg, &bit); 367 460 return regmap_update_bits(pc->reg_gpio, reg, BIT(bit), 368 461 value ? BIT(bit) : 0); 369 462 } ··· 370 465 static void meson_gpio_set(struct gpio_chip *chip, unsigned gpio, int value) 371 466 { 372 467 struct meson_pinctrl *pc = gpiochip_get_data(chip); 373 - unsigned int reg, bit, pin; 468 + unsigned int reg, bit; 374 469 struct meson_bank *bank; 375 470 int ret; 376 471 377 - pin = pc->data->pin_base + gpio; 378 - ret = meson_get_bank(pc, pin, &bank); 472 + ret = meson_get_bank(pc, gpio, &bank); 379 473 if (ret) 380 474 return; 381 475 382 - meson_calc_reg_and_bit(bank, pin, REG_OUT, &reg, &bit); 476 + meson_calc_reg_and_bit(bank, gpio, REG_OUT, &reg, &bit); 383 477 regmap_update_bits(pc->reg_gpio, reg, BIT(bit), 384 478 value ? BIT(bit) : 0); 385 479 } ··· 386 482 static int meson_gpio_get(struct gpio_chip *chip, unsigned gpio) 387 483 { 388 484 struct meson_pinctrl *pc = gpiochip_get_data(chip); 389 - unsigned int reg, bit, val, pin; 485 + unsigned int reg, bit, val; 390 486 struct meson_bank *bank; 391 487 int ret; 392 488 393 - pin = pc->data->pin_base + gpio; 394 - ret = meson_get_bank(pc, pin, &bank); 489 + ret = meson_get_bank(pc, gpio, &bank); 395 490 if (ret) 396 491 return ret; 397 492 398 - meson_calc_reg_and_bit(bank, pin, REG_IN, &reg, &bit); 493 + meson_calc_reg_and_bit(bank, gpio, REG_IN, &reg, &bit); 399 494 regmap_read(pc->reg_gpio, reg, &val); 400 495 401 496 return !!(val & BIT(bit)); 402 497 } 403 - 404 - static const struct of_device_id meson_pinctrl_dt_match[] = { 405 - { 406 - .compatible = "amlogic,meson8-cbus-pinctrl", 407 - .data = &meson8_cbus_pinctrl_data, 408 - }, 409 - { 410 - .compatible = "amlogic,meson8b-cbus-pinctrl", 411 - .data = &meson8b_cbus_pinctrl_data, 412 - }, 413 - { 414 - .compatible = "amlogic,meson8-aobus-pinctrl", 415 - .data = &meson8_aobus_pinctrl_data, 416 - }, 417 - { 418 - .compatible = "amlogic,meson8b-aobus-pinctrl", 419 - .data = &meson8b_aobus_pinctrl_data, 420 - }, 421 - { 422 - .compatible = "amlogic,meson-gxbb-periphs-pinctrl", 423 - .data = &meson_gxbb_periphs_pinctrl_data, 424 - }, 425 - { 426 - .compatible = "amlogic,meson-gxbb-aobus-pinctrl", 427 - .data = &meson_gxbb_aobus_pinctrl_data, 428 - }, 429 - { 430 - .compatible = "amlogic,meson-gxl-periphs-pinctrl", 431 - .data = &meson_gxl_periphs_pinctrl_data, 432 - }, 433 - { 434 - .compatible = "amlogic,meson-gxl-aobus-pinctrl", 435 - .data = &meson_gxl_aobus_pinctrl_data, 436 - }, 437 - { }, 438 - }; 439 498 440 499 static int meson_gpiolib_register(struct meson_pinctrl *pc) 441 500 { ··· 406 539 407 540 pc->chip.label = pc->data->name; 408 541 pc->chip.parent = pc->dev; 409 - pc->chip.request = meson_gpio_request; 410 - pc->chip.free = meson_gpio_free; 542 + pc->chip.request = gpiochip_generic_request; 543 + pc->chip.free = gpiochip_generic_free; 411 544 pc->chip.direction_input = meson_gpio_direction_input; 412 545 pc->chip.direction_output = meson_gpio_direction_output; 413 546 pc->chip.get = meson_gpio_get; 414 547 pc->chip.set = meson_gpio_set; 415 - pc->chip.base = pc->data->pin_base; 548 + pc->chip.base = -1; 416 549 pc->chip.ngpio = pc->data->num_pins; 417 550 pc->chip.can_sleep = false; 418 551 pc->chip.of_node = pc->of_node; ··· 507 640 return 0; 508 641 } 509 642 510 - static int meson_pinctrl_probe(struct platform_device *pdev) 643 + int meson_pinctrl_probe(struct platform_device *pdev) 511 644 { 512 - const struct of_device_id *match; 513 645 struct device *dev = &pdev->dev; 514 646 struct meson_pinctrl *pc; 515 647 int ret; ··· 518 652 return -ENOMEM; 519 653 520 654 pc->dev = dev; 521 - match = of_match_node(meson_pinctrl_dt_match, pdev->dev.of_node); 522 - pc->data = (struct meson_pinctrl_data *) match->data; 655 + pc->data = (struct meson_pinctrl_data *) of_device_get_match_data(dev); 523 656 524 - ret = meson_pinctrl_parse_dt(pc, pdev->dev.of_node); 657 + ret = meson_pinctrl_parse_dt(pc, dev->of_node); 525 658 if (ret) 526 659 return ret; 527 660 528 661 pc->desc.name = "pinctrl-meson"; 529 662 pc->desc.owner = THIS_MODULE; 530 663 pc->desc.pctlops = &meson_pctrl_ops; 531 - pc->desc.pmxops = &meson_pmx_ops; 664 + pc->desc.pmxops = pc->data->pmx_ops; 532 665 pc->desc.confops = &meson_pinconf_ops; 533 666 pc->desc.pins = pc->data->pins; 534 667 pc->desc.npins = pc->data->num_pins; ··· 540 675 541 676 return meson_gpiolib_register(pc); 542 677 } 543 - 544 - static struct platform_driver meson_pinctrl_driver = { 545 - .probe = meson_pinctrl_probe, 546 - .driver = { 547 - .name = "meson-pinctrl", 548 - .of_match_table = meson_pinctrl_dt_match, 549 - }, 550 - }; 551 - builtin_platform_driver(meson_pinctrl_driver);
+15 -32
drivers/pinctrl/meson/pinctrl-meson.h
··· 13 13 14 14 #include <linux/gpio.h> 15 15 #include <linux/pinctrl/pinctrl.h> 16 + #include <linux/platform_device.h> 16 17 #include <linux/regmap.h> 17 18 #include <linux/types.h> 18 19 ··· 32 31 const char *name; 33 32 const unsigned int *pins; 34 33 unsigned int num_pins; 35 - bool is_gpio; 36 - unsigned int reg; 37 - unsigned int bit; 34 + const void *data; 38 35 }; 39 36 40 37 /** ··· 102 103 const struct pinctrl_pin_desc *pins; 103 104 struct meson_pmx_group *groups; 104 105 struct meson_pmx_func *funcs; 105 - unsigned int pin_base; 106 106 unsigned int num_pins; 107 107 unsigned int num_groups; 108 108 unsigned int num_funcs; 109 109 struct meson_bank *banks; 110 110 unsigned int num_banks; 111 + const struct pinmux_ops *pmx_ops; 111 112 }; 112 113 113 114 struct meson_pinctrl { ··· 122 123 struct gpio_chip chip; 123 124 struct device_node *of_node; 124 125 }; 125 - 126 - #define PIN(x, b) (b + x) 127 - 128 - #define GROUP(grp, r, b) \ 129 - { \ 130 - .name = #grp, \ 131 - .pins = grp ## _pins, \ 132 - .num_pins = ARRAY_SIZE(grp ## _pins), \ 133 - .reg = r, \ 134 - .bit = b, \ 135 - } 136 - 137 - #define GPIO_GROUP(gpio, b) \ 138 - { \ 139 - .name = #gpio, \ 140 - .pins = (const unsigned int[]){ PIN(gpio, b) }, \ 141 - .num_pins = 1, \ 142 - .is_gpio = true, \ 143 - } 144 126 145 127 #define FUNCTION(fn) \ 146 128 { \ ··· 146 166 }, \ 147 167 } 148 168 149 - #define MESON_PIN(x, b) PINCTRL_PIN(PIN(x, b), #x) 169 + #define MESON_PIN(x) PINCTRL_PIN(x, #x) 150 170 151 - extern struct meson_pinctrl_data meson8_cbus_pinctrl_data; 152 - extern struct meson_pinctrl_data meson8_aobus_pinctrl_data; 153 - extern struct meson_pinctrl_data meson8b_cbus_pinctrl_data; 154 - extern struct meson_pinctrl_data meson8b_aobus_pinctrl_data; 155 - extern struct meson_pinctrl_data meson_gxbb_periphs_pinctrl_data; 156 - extern struct meson_pinctrl_data meson_gxbb_aobus_pinctrl_data; 157 - extern struct meson_pinctrl_data meson_gxl_periphs_pinctrl_data; 158 - extern struct meson_pinctrl_data meson_gxl_aobus_pinctrl_data; 171 + /* Common pmx functions */ 172 + int meson_pmx_get_funcs_count(struct pinctrl_dev *pcdev); 173 + const char *meson_pmx_get_func_name(struct pinctrl_dev *pcdev, 174 + unsigned selector); 175 + int meson_pmx_get_groups(struct pinctrl_dev *pcdev, 176 + unsigned selector, 177 + const char * const **groups, 178 + unsigned * const num_groups); 179 + 180 + /* Common probe function */ 181 + int meson_pinctrl_probe(struct platform_device *pdev);
+108
drivers/pinctrl/meson/pinctrl-meson8-pmx.c
··· 1 + /* 2 + * First generation of pinmux driver for Amlogic Meson SoCs 3 + * 4 + * Copyright (C) 2014 Beniamino Galvani <b.galvani@gmail.com> 5 + * Copyright (C) 2017 Jerome Brunet <jbrunet@baylibre.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 + /* For this first generation of pinctrl driver every pinmux group can be 16 + * enabled by a specific bit in the first register range. When all groups for 17 + * a given pin are disabled the pin acts as a GPIO. 18 + */ 19 + #include <linux/device.h> 20 + #include <linux/regmap.h> 21 + #include <linux/pinctrl/pinctrl.h> 22 + #include <linux/pinctrl/pinmux.h> 23 + 24 + #include "pinctrl-meson.h" 25 + #include "pinctrl-meson8-pmx.h" 26 + 27 + /** 28 + * meson8_pmx_disable_other_groups() - disable other groups using a given pin 29 + * 30 + * @pc: meson pin controller device 31 + * @pin: number of the pin 32 + * @sel_group: index of the selected group, or -1 if none 33 + * 34 + * The function disables all pinmux groups using a pin except the 35 + * selected one. If @sel_group is -1 all groups are disabled, leaving 36 + * the pin in GPIO mode. 37 + */ 38 + static void meson8_pmx_disable_other_groups(struct meson_pinctrl *pc, 39 + unsigned int pin, int sel_group) 40 + { 41 + struct meson_pmx_group *group; 42 + struct meson8_pmx_data *pmx_data; 43 + int i, j; 44 + 45 + for (i = 0; i < pc->data->num_groups; i++) { 46 + group = &pc->data->groups[i]; 47 + pmx_data = (struct meson8_pmx_data *)group->data; 48 + if (pmx_data->is_gpio || i == sel_group) 49 + continue; 50 + 51 + for (j = 0; j < group->num_pins; j++) { 52 + if (group->pins[j] == pin) { 53 + /* We have found a group using the pin */ 54 + regmap_update_bits(pc->reg_mux, 55 + pmx_data->reg * 4, 56 + BIT(pmx_data->bit), 0); 57 + } 58 + } 59 + } 60 + } 61 + 62 + static int meson8_pmx_set_mux(struct pinctrl_dev *pcdev, unsigned func_num, 63 + unsigned group_num) 64 + { 65 + struct meson_pinctrl *pc = pinctrl_dev_get_drvdata(pcdev); 66 + struct meson_pmx_func *func = &pc->data->funcs[func_num]; 67 + struct meson_pmx_group *group = &pc->data->groups[group_num]; 68 + struct meson8_pmx_data *pmx_data = 69 + (struct meson8_pmx_data *)group->data; 70 + int i, ret = 0; 71 + 72 + dev_dbg(pc->dev, "enable function %s, group %s\n", func->name, 73 + group->name); 74 + 75 + /* 76 + * Disable groups using the same pin. 77 + * The selected group is not disabled to avoid glitches. 78 + */ 79 + for (i = 0; i < group->num_pins; i++) 80 + meson8_pmx_disable_other_groups(pc, group->pins[i], group_num); 81 + 82 + /* Function 0 (GPIO) doesn't need any additional setting */ 83 + if (func_num) 84 + ret = regmap_update_bits(pc->reg_mux, pmx_data->reg * 4, 85 + BIT(pmx_data->bit), 86 + BIT(pmx_data->bit)); 87 + 88 + return ret; 89 + } 90 + 91 + static int meson8_pmx_request_gpio(struct pinctrl_dev *pcdev, 92 + struct pinctrl_gpio_range *range, 93 + unsigned offset) 94 + { 95 + struct meson_pinctrl *pc = pinctrl_dev_get_drvdata(pcdev); 96 + 97 + meson8_pmx_disable_other_groups(pc, offset, -1); 98 + 99 + return 0; 100 + } 101 + 102 + const struct pinmux_ops meson8_pmx_ops = { 103 + .set_mux = meson8_pmx_set_mux, 104 + .get_functions_count = meson_pmx_get_funcs_count, 105 + .get_function_name = meson_pmx_get_func_name, 106 + .get_function_groups = meson_pmx_get_groups, 107 + .gpio_request_enable = meson8_pmx_request_gpio, 108 + };
+48
drivers/pinctrl/meson/pinctrl-meson8-pmx.h
··· 1 + /* 2 + * First generation of pinmux driver for Amlogic Meson SoCs 3 + * 4 + * Copyright (C) 2014 Beniamino Galvani <b.galvani@gmail.com> 5 + * Copyright (C) 2017 Jerome Brunet <jbrunet@baylibre.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 + struct meson8_pmx_data { 16 + bool is_gpio; 17 + unsigned int reg; 18 + unsigned int bit; 19 + }; 20 + 21 + #define PMX_DATA(r, b, g) \ 22 + { \ 23 + .reg = r, \ 24 + .bit = b, \ 25 + .is_gpio = g, \ 26 + } 27 + 28 + #define GROUP(grp, r, b) \ 29 + { \ 30 + .name = #grp, \ 31 + .pins = grp ## _pins, \ 32 + .num_pins = ARRAY_SIZE(grp ## _pins), \ 33 + .data = (const struct meson8_pmx_data[]){ \ 34 + PMX_DATA(r, b, false), \ 35 + }, \ 36 + } 37 + 38 + #define GPIO_GROUP(gpio) \ 39 + { \ 40 + .name = #gpio, \ 41 + .pins = (const unsigned int[]){ gpio }, \ 42 + .num_pins = 1, \ 43 + .data = (const struct meson8_pmx_data[]){ \ 44 + PMX_DATA(0, 0, true), \ 45 + }, \ 46 + } 47 + 48 + extern const struct pinmux_ops meson8_pmx_ops;
+477 -467
drivers/pinctrl/meson/pinctrl-meson8.c
··· 13 13 14 14 #include <dt-bindings/gpio/meson8-gpio.h> 15 15 #include "pinctrl-meson.h" 16 - 17 - #define AO_OFF 120 16 + #include "pinctrl-meson8-pmx.h" 18 17 19 18 static const struct pinctrl_pin_desc meson8_cbus_pins[] = { 20 - MESON_PIN(GPIOX_0, 0), 21 - MESON_PIN(GPIOX_1, 0), 22 - MESON_PIN(GPIOX_2, 0), 23 - MESON_PIN(GPIOX_3, 0), 24 - MESON_PIN(GPIOX_4, 0), 25 - MESON_PIN(GPIOX_5, 0), 26 - MESON_PIN(GPIOX_6, 0), 27 - MESON_PIN(GPIOX_7, 0), 28 - MESON_PIN(GPIOX_8, 0), 29 - MESON_PIN(GPIOX_9, 0), 30 - MESON_PIN(GPIOX_10, 0), 31 - MESON_PIN(GPIOX_11, 0), 32 - MESON_PIN(GPIOX_12, 0), 33 - MESON_PIN(GPIOX_13, 0), 34 - MESON_PIN(GPIOX_14, 0), 35 - MESON_PIN(GPIOX_15, 0), 36 - MESON_PIN(GPIOX_16, 0), 37 - MESON_PIN(GPIOX_17, 0), 38 - MESON_PIN(GPIOX_18, 0), 39 - MESON_PIN(GPIOX_19, 0), 40 - MESON_PIN(GPIOX_20, 0), 41 - MESON_PIN(GPIOX_21, 0), 42 - MESON_PIN(GPIOY_0, 0), 43 - MESON_PIN(GPIOY_1, 0), 44 - MESON_PIN(GPIOY_2, 0), 45 - MESON_PIN(GPIOY_3, 0), 46 - MESON_PIN(GPIOY_4, 0), 47 - MESON_PIN(GPIOY_5, 0), 48 - MESON_PIN(GPIOY_6, 0), 49 - MESON_PIN(GPIOY_7, 0), 50 - MESON_PIN(GPIOY_8, 0), 51 - MESON_PIN(GPIOY_9, 0), 52 - MESON_PIN(GPIOY_10, 0), 53 - MESON_PIN(GPIOY_11, 0), 54 - MESON_PIN(GPIOY_12, 0), 55 - MESON_PIN(GPIOY_13, 0), 56 - MESON_PIN(GPIOY_14, 0), 57 - MESON_PIN(GPIOY_15, 0), 58 - MESON_PIN(GPIOY_16, 0), 59 - MESON_PIN(GPIODV_0, 0), 60 - MESON_PIN(GPIODV_1, 0), 61 - MESON_PIN(GPIODV_2, 0), 62 - MESON_PIN(GPIODV_3, 0), 63 - MESON_PIN(GPIODV_4, 0), 64 - MESON_PIN(GPIODV_5, 0), 65 - MESON_PIN(GPIODV_6, 0), 66 - MESON_PIN(GPIODV_7, 0), 67 - MESON_PIN(GPIODV_8, 0), 68 - MESON_PIN(GPIODV_9, 0), 69 - MESON_PIN(GPIODV_10, 0), 70 - MESON_PIN(GPIODV_11, 0), 71 - MESON_PIN(GPIODV_12, 0), 72 - MESON_PIN(GPIODV_13, 0), 73 - MESON_PIN(GPIODV_14, 0), 74 - MESON_PIN(GPIODV_15, 0), 75 - MESON_PIN(GPIODV_16, 0), 76 - MESON_PIN(GPIODV_17, 0), 77 - MESON_PIN(GPIODV_18, 0), 78 - MESON_PIN(GPIODV_19, 0), 79 - MESON_PIN(GPIODV_20, 0), 80 - MESON_PIN(GPIODV_21, 0), 81 - MESON_PIN(GPIODV_22, 0), 82 - MESON_PIN(GPIODV_23, 0), 83 - MESON_PIN(GPIODV_24, 0), 84 - MESON_PIN(GPIODV_25, 0), 85 - MESON_PIN(GPIODV_26, 0), 86 - MESON_PIN(GPIODV_27, 0), 87 - MESON_PIN(GPIODV_28, 0), 88 - MESON_PIN(GPIODV_29, 0), 89 - MESON_PIN(GPIOH_0, 0), 90 - MESON_PIN(GPIOH_1, 0), 91 - MESON_PIN(GPIOH_2, 0), 92 - MESON_PIN(GPIOH_3, 0), 93 - MESON_PIN(GPIOH_4, 0), 94 - MESON_PIN(GPIOH_5, 0), 95 - MESON_PIN(GPIOH_6, 0), 96 - MESON_PIN(GPIOH_7, 0), 97 - MESON_PIN(GPIOH_8, 0), 98 - MESON_PIN(GPIOH_9, 0), 99 - MESON_PIN(GPIOZ_0, 0), 100 - MESON_PIN(GPIOZ_1, 0), 101 - MESON_PIN(GPIOZ_2, 0), 102 - MESON_PIN(GPIOZ_3, 0), 103 - MESON_PIN(GPIOZ_4, 0), 104 - MESON_PIN(GPIOZ_5, 0), 105 - MESON_PIN(GPIOZ_6, 0), 106 - MESON_PIN(GPIOZ_7, 0), 107 - MESON_PIN(GPIOZ_8, 0), 108 - MESON_PIN(GPIOZ_9, 0), 109 - MESON_PIN(GPIOZ_10, 0), 110 - MESON_PIN(GPIOZ_11, 0), 111 - MESON_PIN(GPIOZ_12, 0), 112 - MESON_PIN(GPIOZ_13, 0), 113 - MESON_PIN(GPIOZ_14, 0), 114 - MESON_PIN(CARD_0, 0), 115 - MESON_PIN(CARD_1, 0), 116 - MESON_PIN(CARD_2, 0), 117 - MESON_PIN(CARD_3, 0), 118 - MESON_PIN(CARD_4, 0), 119 - MESON_PIN(CARD_5, 0), 120 - MESON_PIN(CARD_6, 0), 121 - MESON_PIN(BOOT_0, 0), 122 - MESON_PIN(BOOT_1, 0), 123 - MESON_PIN(BOOT_2, 0), 124 - MESON_PIN(BOOT_3, 0), 125 - MESON_PIN(BOOT_4, 0), 126 - MESON_PIN(BOOT_5, 0), 127 - MESON_PIN(BOOT_6, 0), 128 - MESON_PIN(BOOT_7, 0), 129 - MESON_PIN(BOOT_8, 0), 130 - MESON_PIN(BOOT_9, 0), 131 - MESON_PIN(BOOT_10, 0), 132 - MESON_PIN(BOOT_11, 0), 133 - MESON_PIN(BOOT_12, 0), 134 - MESON_PIN(BOOT_13, 0), 135 - MESON_PIN(BOOT_14, 0), 136 - MESON_PIN(BOOT_15, 0), 137 - MESON_PIN(BOOT_16, 0), 138 - MESON_PIN(BOOT_17, 0), 139 - MESON_PIN(BOOT_18, 0), 19 + MESON_PIN(GPIOX_0), 20 + MESON_PIN(GPIOX_1), 21 + MESON_PIN(GPIOX_2), 22 + MESON_PIN(GPIOX_3), 23 + MESON_PIN(GPIOX_4), 24 + MESON_PIN(GPIOX_5), 25 + MESON_PIN(GPIOX_6), 26 + MESON_PIN(GPIOX_7), 27 + MESON_PIN(GPIOX_8), 28 + MESON_PIN(GPIOX_9), 29 + MESON_PIN(GPIOX_10), 30 + MESON_PIN(GPIOX_11), 31 + MESON_PIN(GPIOX_12), 32 + MESON_PIN(GPIOX_13), 33 + MESON_PIN(GPIOX_14), 34 + MESON_PIN(GPIOX_15), 35 + MESON_PIN(GPIOX_16), 36 + MESON_PIN(GPIOX_17), 37 + MESON_PIN(GPIOX_18), 38 + MESON_PIN(GPIOX_19), 39 + MESON_PIN(GPIOX_20), 40 + MESON_PIN(GPIOX_21), 41 + MESON_PIN(GPIOY_0), 42 + MESON_PIN(GPIOY_1), 43 + MESON_PIN(GPIOY_2), 44 + MESON_PIN(GPIOY_3), 45 + MESON_PIN(GPIOY_4), 46 + MESON_PIN(GPIOY_5), 47 + MESON_PIN(GPIOY_6), 48 + MESON_PIN(GPIOY_7), 49 + MESON_PIN(GPIOY_8), 50 + MESON_PIN(GPIOY_9), 51 + MESON_PIN(GPIOY_10), 52 + MESON_PIN(GPIOY_11), 53 + MESON_PIN(GPIOY_12), 54 + MESON_PIN(GPIOY_13), 55 + MESON_PIN(GPIOY_14), 56 + MESON_PIN(GPIOY_15), 57 + MESON_PIN(GPIOY_16), 58 + MESON_PIN(GPIODV_0), 59 + MESON_PIN(GPIODV_1), 60 + MESON_PIN(GPIODV_2), 61 + MESON_PIN(GPIODV_3), 62 + MESON_PIN(GPIODV_4), 63 + MESON_PIN(GPIODV_5), 64 + MESON_PIN(GPIODV_6), 65 + MESON_PIN(GPIODV_7), 66 + MESON_PIN(GPIODV_8), 67 + MESON_PIN(GPIODV_9), 68 + MESON_PIN(GPIODV_10), 69 + MESON_PIN(GPIODV_11), 70 + MESON_PIN(GPIODV_12), 71 + MESON_PIN(GPIODV_13), 72 + MESON_PIN(GPIODV_14), 73 + MESON_PIN(GPIODV_15), 74 + MESON_PIN(GPIODV_16), 75 + MESON_PIN(GPIODV_17), 76 + MESON_PIN(GPIODV_18), 77 + MESON_PIN(GPIODV_19), 78 + MESON_PIN(GPIODV_20), 79 + MESON_PIN(GPIODV_21), 80 + MESON_PIN(GPIODV_22), 81 + MESON_PIN(GPIODV_23), 82 + MESON_PIN(GPIODV_24), 83 + MESON_PIN(GPIODV_25), 84 + MESON_PIN(GPIODV_26), 85 + MESON_PIN(GPIODV_27), 86 + MESON_PIN(GPIODV_28), 87 + MESON_PIN(GPIODV_29), 88 + MESON_PIN(GPIOH_0), 89 + MESON_PIN(GPIOH_1), 90 + MESON_PIN(GPIOH_2), 91 + MESON_PIN(GPIOH_3), 92 + MESON_PIN(GPIOH_4), 93 + MESON_PIN(GPIOH_5), 94 + MESON_PIN(GPIOH_6), 95 + MESON_PIN(GPIOH_7), 96 + MESON_PIN(GPIOH_8), 97 + MESON_PIN(GPIOH_9), 98 + MESON_PIN(GPIOZ_0), 99 + MESON_PIN(GPIOZ_1), 100 + MESON_PIN(GPIOZ_2), 101 + MESON_PIN(GPIOZ_3), 102 + MESON_PIN(GPIOZ_4), 103 + MESON_PIN(GPIOZ_5), 104 + MESON_PIN(GPIOZ_6), 105 + MESON_PIN(GPIOZ_7), 106 + MESON_PIN(GPIOZ_8), 107 + MESON_PIN(GPIOZ_9), 108 + MESON_PIN(GPIOZ_10), 109 + MESON_PIN(GPIOZ_11), 110 + MESON_PIN(GPIOZ_12), 111 + MESON_PIN(GPIOZ_13), 112 + MESON_PIN(GPIOZ_14), 113 + MESON_PIN(CARD_0), 114 + MESON_PIN(CARD_1), 115 + MESON_PIN(CARD_2), 116 + MESON_PIN(CARD_3), 117 + MESON_PIN(CARD_4), 118 + MESON_PIN(CARD_5), 119 + MESON_PIN(CARD_6), 120 + MESON_PIN(BOOT_0), 121 + MESON_PIN(BOOT_1), 122 + MESON_PIN(BOOT_2), 123 + MESON_PIN(BOOT_3), 124 + MESON_PIN(BOOT_4), 125 + MESON_PIN(BOOT_5), 126 + MESON_PIN(BOOT_6), 127 + MESON_PIN(BOOT_7), 128 + MESON_PIN(BOOT_8), 129 + MESON_PIN(BOOT_9), 130 + MESON_PIN(BOOT_10), 131 + MESON_PIN(BOOT_11), 132 + MESON_PIN(BOOT_12), 133 + MESON_PIN(BOOT_13), 134 + MESON_PIN(BOOT_14), 135 + MESON_PIN(BOOT_15), 136 + MESON_PIN(BOOT_16), 137 + MESON_PIN(BOOT_17), 138 + MESON_PIN(BOOT_18), 140 139 }; 141 140 142 141 static const struct pinctrl_pin_desc meson8_aobus_pins[] = { 143 - MESON_PIN(GPIOAO_0, AO_OFF), 144 - MESON_PIN(GPIOAO_1, AO_OFF), 145 - MESON_PIN(GPIOAO_2, AO_OFF), 146 - MESON_PIN(GPIOAO_3, AO_OFF), 147 - MESON_PIN(GPIOAO_4, AO_OFF), 148 - MESON_PIN(GPIOAO_5, AO_OFF), 149 - MESON_PIN(GPIOAO_6, AO_OFF), 150 - MESON_PIN(GPIOAO_7, AO_OFF), 151 - MESON_PIN(GPIOAO_8, AO_OFF), 152 - MESON_PIN(GPIOAO_9, AO_OFF), 153 - MESON_PIN(GPIOAO_10, AO_OFF), 154 - MESON_PIN(GPIOAO_11, AO_OFF), 155 - MESON_PIN(GPIOAO_12, AO_OFF), 156 - MESON_PIN(GPIOAO_13, AO_OFF), 157 - MESON_PIN(GPIO_BSD_EN, AO_OFF), 158 - MESON_PIN(GPIO_TEST_N, AO_OFF), 142 + MESON_PIN(GPIOAO_0), 143 + MESON_PIN(GPIOAO_1), 144 + MESON_PIN(GPIOAO_2), 145 + MESON_PIN(GPIOAO_3), 146 + MESON_PIN(GPIOAO_4), 147 + MESON_PIN(GPIOAO_5), 148 + MESON_PIN(GPIOAO_6), 149 + MESON_PIN(GPIOAO_7), 150 + MESON_PIN(GPIOAO_8), 151 + MESON_PIN(GPIOAO_9), 152 + MESON_PIN(GPIOAO_10), 153 + MESON_PIN(GPIOAO_11), 154 + MESON_PIN(GPIOAO_12), 155 + MESON_PIN(GPIOAO_13), 156 + MESON_PIN(GPIO_BSD_EN), 157 + MESON_PIN(GPIO_TEST_N), 159 158 }; 160 159 161 160 /* bank X */ 162 - static const unsigned int sd_d0_a_pins[] = { PIN(GPIOX_0, 0) }; 163 - static const unsigned int sd_d1_a_pins[] = { PIN(GPIOX_1, 0) }; 164 - static const unsigned int sd_d2_a_pins[] = { PIN(GPIOX_2, 0) }; 165 - static const unsigned int sd_d3_a_pins[] = { PIN(GPIOX_3, 0) }; 166 - static const unsigned int sd_clk_a_pins[] = { PIN(GPIOX_8, 0) }; 167 - static const unsigned int sd_cmd_a_pins[] = { PIN(GPIOX_9, 0) }; 161 + static const unsigned int sd_d0_a_pins[] = { GPIOX_0 }; 162 + static const unsigned int sd_d1_a_pins[] = { GPIOX_1 }; 163 + static const unsigned int sd_d2_a_pins[] = { GPIOX_2 }; 164 + static const unsigned int sd_d3_a_pins[] = { GPIOX_3 }; 165 + static const unsigned int sd_clk_a_pins[] = { GPIOX_8 }; 166 + static const unsigned int sd_cmd_a_pins[] = { GPIOX_9 }; 168 167 169 - static const unsigned int sdxc_d0_a_pins[] = { PIN(GPIOX_0, 0) }; 170 - static const unsigned int sdxc_d13_a_pins[] = { PIN(GPIOX_1, 0), PIN(GPIOX_2, 0), 171 - PIN(GPIOX_3, 0) }; 172 - static const unsigned int sdxc_d47_a_pins[] = { PIN(GPIOX_4, 0), PIN(GPIOX_5, 0), 173 - PIN(GPIOX_6, 0), PIN(GPIOX_7, 0) }; 174 - static const unsigned int sdxc_clk_a_pins[] = { PIN(GPIOX_8, 0) }; 175 - static const unsigned int sdxc_cmd_a_pins[] = { PIN(GPIOX_9, 0) }; 168 + static const unsigned int sdxc_d0_a_pins[] = { GPIOX_0 }; 169 + static const unsigned int sdxc_d13_a_pins[] = { GPIOX_1, GPIOX_2, GPIOX_3 }; 170 + static const unsigned int sdxc_d47_a_pins[] = { GPIOX_4, GPIOX_5, GPIOX_6, 171 + GPIOX_7 }; 172 + static const unsigned int sdxc_clk_a_pins[] = { GPIOX_8 }; 173 + static const unsigned int sdxc_cmd_a_pins[] = { GPIOX_9 }; 176 174 177 - static const unsigned int pcm_out_a_pins[] = { PIN(GPIOX_4, 0) }; 178 - static const unsigned int pcm_in_a_pins[] = { PIN(GPIOX_5, 0) }; 179 - static const unsigned int pcm_fs_a_pins[] = { PIN(GPIOX_6, 0) }; 180 - static const unsigned int pcm_clk_a_pins[] = { PIN(GPIOX_7, 0) }; 175 + static const unsigned int pcm_out_a_pins[] = { GPIOX_4 }; 176 + static const unsigned int pcm_in_a_pins[] = { GPIOX_5 }; 177 + static const unsigned int pcm_fs_a_pins[] = { GPIOX_6 }; 178 + static const unsigned int pcm_clk_a_pins[] = { GPIOX_7 }; 181 179 182 - static const unsigned int uart_tx_a0_pins[] = { PIN(GPIOX_4, 0) }; 183 - static const unsigned int uart_rx_a0_pins[] = { PIN(GPIOX_5, 0) }; 184 - static const unsigned int uart_cts_a0_pins[] = { PIN(GPIOX_6, 0) }; 185 - static const unsigned int uart_rts_a0_pins[] = { PIN(GPIOX_7, 0) }; 180 + static const unsigned int uart_tx_a0_pins[] = { GPIOX_4 }; 181 + static const unsigned int uart_rx_a0_pins[] = { GPIOX_5 }; 182 + static const unsigned int uart_cts_a0_pins[] = { GPIOX_6 }; 183 + static const unsigned int uart_rts_a0_pins[] = { GPIOX_7 }; 186 184 187 - static const unsigned int uart_tx_a1_pins[] = { PIN(GPIOX_12, 0) }; 188 - static const unsigned int uart_rx_a1_pins[] = { PIN(GPIOX_13, 0) }; 189 - static const unsigned int uart_cts_a1_pins[] = { PIN(GPIOX_14, 0) }; 190 - static const unsigned int uart_rts_a1_pins[] = { PIN(GPIOX_15, 0) }; 185 + static const unsigned int uart_tx_a1_pins[] = { GPIOX_12 }; 186 + static const unsigned int uart_rx_a1_pins[] = { GPIOX_13 }; 187 + static const unsigned int uart_cts_a1_pins[] = { GPIOX_14 }; 188 + static const unsigned int uart_rts_a1_pins[] = { GPIOX_15 }; 191 189 192 - static const unsigned int uart_tx_b0_pins[] = { PIN(GPIOX_16, 0) }; 193 - static const unsigned int uart_rx_b0_pins[] = { PIN(GPIOX_17, 0) }; 194 - static const unsigned int uart_cts_b0_pins[] = { PIN(GPIOX_18, 0) }; 195 - static const unsigned int uart_rts_b0_pins[] = { PIN(GPIOX_19, 0) }; 190 + static const unsigned int uart_tx_b0_pins[] = { GPIOX_16 }; 191 + static const unsigned int uart_rx_b0_pins[] = { GPIOX_17 }; 192 + static const unsigned int uart_cts_b0_pins[] = { GPIOX_18 }; 193 + static const unsigned int uart_rts_b0_pins[] = { GPIOX_19 }; 196 194 197 - static const unsigned int iso7816_det_pins[] = { PIN(GPIOX_16, 0) }; 198 - static const unsigned int iso7816_reset_pins[] = { PIN(GPIOX_17, 0) }; 199 - static const unsigned int iso7816_clk_pins[] = { PIN(GPIOX_18, 0) }; 200 - static const unsigned int iso7816_data_pins[] = { PIN(GPIOX_19, 0) }; 195 + static const unsigned int iso7816_det_pins[] = { GPIOX_16 }; 196 + static const unsigned int iso7816_reset_pins[] = { GPIOX_17 }; 197 + static const unsigned int iso7816_clk_pins[] = { GPIOX_18 }; 198 + static const unsigned int iso7816_data_pins[] = { GPIOX_19 }; 201 199 202 - static const unsigned int i2c_sda_d0_pins[] = { PIN(GPIOX_16, 0) }; 203 - static const unsigned int i2c_sck_d0_pins[] = { PIN(GPIOX_17, 0) }; 200 + static const unsigned int i2c_sda_d0_pins[] = { GPIOX_16 }; 201 + static const unsigned int i2c_sck_d0_pins[] = { GPIOX_17 }; 204 202 205 - static const unsigned int xtal_32k_out_pins[] = { PIN(GPIOX_10, 0) }; 206 - static const unsigned int xtal_24m_out_pins[] = { PIN(GPIOX_11, 0) }; 203 + static const unsigned int xtal_32k_out_pins[] = { GPIOX_10 }; 204 + static const unsigned int xtal_24m_out_pins[] = { GPIOX_11 }; 207 205 208 - static const unsigned int pwm_e_pins[] = { PIN(GPIOX_10, 0) }; 209 - static const unsigned int pwm_b_x_pins[] = { PIN(GPIOX_11, 0) }; 206 + static const unsigned int pwm_e_pins[] = { GPIOX_10 }; 207 + static const unsigned int pwm_b_x_pins[] = { GPIOX_11 }; 210 208 211 209 /* bank Y */ 212 - static const unsigned int uart_tx_c_pins[] = { PIN(GPIOY_0, 0) }; 213 - static const unsigned int uart_rx_c_pins[] = { PIN(GPIOY_1, 0) }; 214 - static const unsigned int uart_cts_c_pins[] = { PIN(GPIOY_2, 0) }; 215 - static const unsigned int uart_rts_c_pins[] = { PIN(GPIOY_3, 0) }; 210 + static const unsigned int uart_tx_c_pins[] = { GPIOY_0 }; 211 + static const unsigned int uart_rx_c_pins[] = { GPIOY_1 }; 212 + static const unsigned int uart_cts_c_pins[] = { GPIOY_2 }; 213 + static const unsigned int uart_rts_c_pins[] = { GPIOY_3 }; 216 214 217 - static const unsigned int pcm_out_b_pins[] = { PIN(GPIOY_4, 0) }; 218 - static const unsigned int pcm_in_b_pins[] = { PIN(GPIOY_5, 0) }; 219 - static const unsigned int pcm_fs_b_pins[] = { PIN(GPIOY_6, 0) }; 220 - static const unsigned int pcm_clk_b_pins[] = { PIN(GPIOY_7, 0) }; 215 + static const unsigned int pcm_out_b_pins[] = { GPIOY_4 }; 216 + static const unsigned int pcm_in_b_pins[] = { GPIOY_5 }; 217 + static const unsigned int pcm_fs_b_pins[] = { GPIOY_6 }; 218 + static const unsigned int pcm_clk_b_pins[] = { GPIOY_7 }; 221 219 222 - static const unsigned int i2c_sda_c0_pins[] = { PIN(GPIOY_0, 0) }; 223 - static const unsigned int i2c_sck_c0_pins[] = { PIN(GPIOY_1, 0) }; 220 + static const unsigned int i2c_sda_c0_pins[] = { GPIOY_0 }; 221 + static const unsigned int i2c_sck_c0_pins[] = { GPIOY_1 }; 224 222 225 - static const unsigned int pwm_a_y_pins[] = { PIN(GPIOY_16, 0) }; 223 + static const unsigned int pwm_a_y_pins[] = { GPIOY_16 }; 226 224 227 - static const unsigned int i2s_out_ch45_pins[] = { PIN(GPIOY_0, 0) }; 228 - static const unsigned int i2s_out_ch23_pins[] = { PIN(GPIOY_1, 0) }; 229 - static const unsigned int i2s_out_ch01_pins[] = { PIN(GPIOY_4, 0) }; 230 - static const unsigned int i2s_in_ch01_pins[] = { PIN(GPIOY_5, 0) }; 231 - static const unsigned int i2s_lr_clk_in_pins[] = { PIN(GPIOY_6, 0) }; 232 - static const unsigned int i2s_ao_clk_in_pins[] = { PIN(GPIOY_7, 0) }; 233 - static const unsigned int i2s_am_clk_pins[] = { PIN(GPIOY_8, 0) }; 234 - static const unsigned int i2s_out_ch78_pins[] = { PIN(GPIOY_9, 0) }; 225 + static const unsigned int i2s_out_ch45_pins[] = { GPIOY_0 }; 226 + static const unsigned int i2s_out_ch23_pins[] = { GPIOY_1 }; 227 + static const unsigned int i2s_out_ch01_pins[] = { GPIOY_4 }; 228 + static const unsigned int i2s_in_ch01_pins[] = { GPIOY_5 }; 229 + static const unsigned int i2s_lr_clk_in_pins[] = { GPIOY_6 }; 230 + static const unsigned int i2s_ao_clk_in_pins[] = { GPIOY_7 }; 231 + static const unsigned int i2s_am_clk_pins[] = { GPIOY_8 }; 232 + static const unsigned int i2s_out_ch78_pins[] = { GPIOY_9 }; 235 233 236 - static const unsigned int spdif_in_pins[] = { PIN(GPIOY_2, 0) }; 237 - static const unsigned int spdif_out_pins[] = { PIN(GPIOY_3, 0) }; 234 + static const unsigned int spdif_in_pins[] = { GPIOY_2 }; 235 + static const unsigned int spdif_out_pins[] = { GPIOY_3 }; 238 236 239 237 /* bank DV */ 240 - static const unsigned int dvin_rgb_pins[] = { PIN(GPIODV_0, 0), PIN(GPIODV_1, 0), 241 - PIN(GPIODV_2, 0), PIN(GPIODV_3, 0), 242 - PIN(GPIODV_4, 0), PIN(GPIODV_5, 0), 243 - PIN(GPIODV_6, 0), PIN(GPIODV_7, 0), 244 - PIN(GPIODV_8, 0), PIN(GPIODV_9, 0), 245 - PIN(GPIODV_10, 0), PIN(GPIODV_11, 0), 246 - PIN(GPIODV_12, 0), PIN(GPIODV_13, 0), 247 - PIN(GPIODV_14, 0), PIN(GPIODV_15, 0), 248 - PIN(GPIODV_16, 0), PIN(GPIODV_17, 0), 249 - PIN(GPIODV_18, 0), PIN(GPIODV_19, 0), 250 - PIN(GPIODV_20, 0), PIN(GPIODV_21, 0), 251 - PIN(GPIODV_22, 0), PIN(GPIODV_23, 0) }; 252 - static const unsigned int dvin_vs_pins[] = { PIN(GPIODV_24, 0) }; 253 - static const unsigned int dvin_hs_pins[] = { PIN(GPIODV_25, 0) }; 254 - static const unsigned int dvin_clk_pins[] = { PIN(GPIODV_26, 0) }; 255 - static const unsigned int dvin_de_pins[] = { PIN(GPIODV_27, 0) }; 238 + static const unsigned int dvin_rgb_pins[] = { 239 + GPIODV_0, GPIODV_1, GPIODV_2, GPIODV_3, GPIODV_4, GPIODV_5, 240 + GPIODV_6, GPIODV_7, GPIODV_8, GPIODV_9, GPIODV_10, GPIODV_11, 241 + GPIODV_12, GPIODV_13, GPIODV_14, GPIODV_15, GPIODV_16, GPIODV_17, 242 + GPIODV_18, GPIODV_19, GPIODV_20, GPIODV_21, GPIODV_22, GPIODV_23 243 + }; 244 + static const unsigned int dvin_vs_pins[] = { GPIODV_24 }; 245 + static const unsigned int dvin_hs_pins[] = { GPIODV_25 }; 246 + static const unsigned int dvin_clk_pins[] = { GPIODV_26 }; 247 + static const unsigned int dvin_de_pins[] = { GPIODV_27 }; 256 248 257 - static const unsigned int enc_0_pins[] = { PIN(GPIODV_0, 0) }; 258 - static const unsigned int enc_1_pins[] = { PIN(GPIODV_1, 0) }; 259 - static const unsigned int enc_2_pins[] = { PIN(GPIODV_2, 0) }; 260 - static const unsigned int enc_3_pins[] = { PIN(GPIODV_3, 0) }; 261 - static const unsigned int enc_4_pins[] = { PIN(GPIODV_4, 0) }; 262 - static const unsigned int enc_5_pins[] = { PIN(GPIODV_5, 0) }; 263 - static const unsigned int enc_6_pins[] = { PIN(GPIODV_6, 0) }; 264 - static const unsigned int enc_7_pins[] = { PIN(GPIODV_7, 0) }; 265 - static const unsigned int enc_8_pins[] = { PIN(GPIODV_8, 0) }; 266 - static const unsigned int enc_9_pins[] = { PIN(GPIODV_9, 0) }; 267 - static const unsigned int enc_10_pins[] = { PIN(GPIODV_10, 0) }; 268 - static const unsigned int enc_11_pins[] = { PIN(GPIODV_11, 0) }; 269 - static const unsigned int enc_12_pins[] = { PIN(GPIODV_12, 0) }; 270 - static const unsigned int enc_13_pins[] = { PIN(GPIODV_13, 0) }; 271 - static const unsigned int enc_14_pins[] = { PIN(GPIODV_14, 0) }; 272 - static const unsigned int enc_15_pins[] = { PIN(GPIODV_15, 0) }; 273 - static const unsigned int enc_16_pins[] = { PIN(GPIODV_16, 0) }; 274 - static const unsigned int enc_17_pins[] = { PIN(GPIODV_17, 0) }; 249 + static const unsigned int enc_0_pins[] = { GPIODV_0 }; 250 + static const unsigned int enc_1_pins[] = { GPIODV_1 }; 251 + static const unsigned int enc_2_pins[] = { GPIODV_2 }; 252 + static const unsigned int enc_3_pins[] = { GPIODV_3 }; 253 + static const unsigned int enc_4_pins[] = { GPIODV_4 }; 254 + static const unsigned int enc_5_pins[] = { GPIODV_5 }; 255 + static const unsigned int enc_6_pins[] = { GPIODV_6 }; 256 + static const unsigned int enc_7_pins[] = { GPIODV_7 }; 257 + static const unsigned int enc_8_pins[] = { GPIODV_8 }; 258 + static const unsigned int enc_9_pins[] = { GPIODV_9 }; 259 + static const unsigned int enc_10_pins[] = { GPIODV_10 }; 260 + static const unsigned int enc_11_pins[] = { GPIODV_11 }; 261 + static const unsigned int enc_12_pins[] = { GPIODV_12 }; 262 + static const unsigned int enc_13_pins[] = { GPIODV_13 }; 263 + static const unsigned int enc_14_pins[] = { GPIODV_14 }; 264 + static const unsigned int enc_15_pins[] = { GPIODV_15 }; 265 + static const unsigned int enc_16_pins[] = { GPIODV_16 }; 266 + static const unsigned int enc_17_pins[] = { GPIODV_17 }; 275 267 276 - static const unsigned int uart_tx_b1_pins[] = { PIN(GPIODV_24, 0) }; 277 - static const unsigned int uart_rx_b1_pins[] = { PIN(GPIODV_25, 0) }; 278 - static const unsigned int uart_cts_b1_pins[] = { PIN(GPIODV_26, 0) }; 279 - static const unsigned int uart_rts_b1_pins[] = { PIN(GPIODV_27, 0) }; 268 + static const unsigned int uart_tx_b1_pins[] = { GPIODV_24 }; 269 + static const unsigned int uart_rx_b1_pins[] = { GPIODV_25 }; 270 + static const unsigned int uart_cts_b1_pins[] = { GPIODV_26 }; 271 + static const unsigned int uart_rts_b1_pins[] = { GPIODV_27 }; 280 272 281 - static const unsigned int vga_vs_pins[] = { PIN(GPIODV_24, 0) }; 282 - static const unsigned int vga_hs_pins[] = { PIN(GPIODV_25, 0) }; 273 + static const unsigned int vga_vs_pins[] = { GPIODV_24 }; 274 + static const unsigned int vga_hs_pins[] = { GPIODV_25 }; 283 275 284 - static const unsigned int pwm_c_dv9_pins[] = { PIN(GPIODV_9, 0) }; 285 - static const unsigned int pwm_c_dv29_pins[] = { PIN(GPIODV_29, 0) }; 286 - static const unsigned int pwm_d_pins[] = { PIN(GPIODV_28, 0) }; 276 + static const unsigned int pwm_c_dv9_pins[] = { GPIODV_9 }; 277 + static const unsigned int pwm_c_dv29_pins[] = { GPIODV_29 }; 278 + static const unsigned int pwm_d_pins[] = { GPIODV_28 }; 287 279 288 280 /* bank H */ 289 - static const unsigned int hdmi_hpd_pins[] = { PIN(GPIOH_0, 0) }; 290 - static const unsigned int hdmi_sda_pins[] = { PIN(GPIOH_1, 0) }; 291 - static const unsigned int hdmi_scl_pins[] = { PIN(GPIOH_2, 0) }; 292 - static const unsigned int hdmi_cec_pins[] = { PIN(GPIOH_3, 0) }; 281 + static const unsigned int hdmi_hpd_pins[] = { GPIOH_0 }; 282 + static const unsigned int hdmi_sda_pins[] = { GPIOH_1 }; 283 + static const unsigned int hdmi_scl_pins[] = { GPIOH_2 }; 284 + static const unsigned int hdmi_cec_pins[] = { GPIOH_3 }; 293 285 294 - static const unsigned int spi_ss0_0_pins[] = { PIN(GPIOH_3, 0) }; 295 - static const unsigned int spi_miso_0_pins[] = { PIN(GPIOH_4, 0) }; 296 - static const unsigned int spi_mosi_0_pins[] = { PIN(GPIOH_5, 0) }; 297 - static const unsigned int spi_sclk_0_pins[] = { PIN(GPIOH_6, 0) }; 286 + static const unsigned int spi_ss0_0_pins[] = { GPIOH_3 }; 287 + static const unsigned int spi_miso_0_pins[] = { GPIOH_4 }; 288 + static const unsigned int spi_mosi_0_pins[] = { GPIOH_5 }; 289 + static const unsigned int spi_sclk_0_pins[] = { GPIOH_6 }; 298 290 299 - static const unsigned int i2c_sda_d1_pins[] = { PIN(GPIOH_7, 0) }; 300 - static const unsigned int i2c_sck_d1_pins[] = { PIN(GPIOH_8, 0) }; 291 + static const unsigned int i2c_sda_d1_pins[] = { GPIOH_7 }; 292 + static const unsigned int i2c_sck_d1_pins[] = { GPIOH_8 }; 301 293 302 294 /* bank Z */ 303 - static const unsigned int spi_ss0_1_pins[] = { PIN(GPIOZ_9, 0) }; 304 - static const unsigned int spi_ss1_1_pins[] = { PIN(GPIOZ_10, 0) }; 305 - static const unsigned int spi_sclk_1_pins[] = { PIN(GPIOZ_11, 0) }; 306 - static const unsigned int spi_mosi_1_pins[] = { PIN(GPIOZ_12, 0) }; 307 - static const unsigned int spi_miso_1_pins[] = { PIN(GPIOZ_13, 0) }; 308 - static const unsigned int spi_ss2_1_pins[] = { PIN(GPIOZ_14, 0) }; 295 + static const unsigned int spi_ss0_1_pins[] = { GPIOZ_9 }; 296 + static const unsigned int spi_ss1_1_pins[] = { GPIOZ_10 }; 297 + static const unsigned int spi_sclk_1_pins[] = { GPIOZ_11 }; 298 + static const unsigned int spi_mosi_1_pins[] = { GPIOZ_12 }; 299 + static const unsigned int spi_miso_1_pins[] = { GPIOZ_13 }; 300 + static const unsigned int spi_ss2_1_pins[] = { GPIOZ_14 }; 309 301 310 - static const unsigned int eth_tx_clk_50m_pins[] = { PIN(GPIOZ_4, 0) }; 311 - static const unsigned int eth_tx_en_pins[] = { PIN(GPIOZ_5, 0) }; 312 - static const unsigned int eth_txd1_pins[] = { PIN(GPIOZ_6, 0) }; 313 - static const unsigned int eth_txd0_pins[] = { PIN(GPIOZ_7, 0) }; 314 - static const unsigned int eth_rx_clk_in_pins[] = { PIN(GPIOZ_8, 0) }; 315 - static const unsigned int eth_rx_dv_pins[] = { PIN(GPIOZ_9, 0) }; 316 - static const unsigned int eth_rxd1_pins[] = { PIN(GPIOZ_10, 0) }; 317 - static const unsigned int eth_rxd0_pins[] = { PIN(GPIOZ_11, 0) }; 318 - static const unsigned int eth_mdio_pins[] = { PIN(GPIOZ_12, 0) }; 319 - static const unsigned int eth_mdc_pins[] = { PIN(GPIOZ_13, 0) }; 302 + static const unsigned int eth_tx_clk_50m_pins[] = { GPIOZ_4 }; 303 + static const unsigned int eth_tx_en_pins[] = { GPIOZ_5 }; 304 + static const unsigned int eth_txd1_pins[] = { GPIOZ_6 }; 305 + static const unsigned int eth_txd0_pins[] = { GPIOZ_7 }; 306 + static const unsigned int eth_rx_clk_in_pins[] = { GPIOZ_8 }; 307 + static const unsigned int eth_rx_dv_pins[] = { GPIOZ_9 }; 308 + static const unsigned int eth_rxd1_pins[] = { GPIOZ_10 }; 309 + static const unsigned int eth_rxd0_pins[] = { GPIOZ_11 }; 310 + static const unsigned int eth_mdio_pins[] = { GPIOZ_12 }; 311 + static const unsigned int eth_mdc_pins[] = { GPIOZ_13 }; 320 312 321 - static const unsigned int i2c_sda_a0_pins[] = { PIN(GPIOZ_0, 0) }; 322 - static const unsigned int i2c_sck_a0_pins[] = { PIN(GPIOZ_1, 0) }; 313 + static const unsigned int i2c_sda_a0_pins[] = { GPIOZ_0 }; 314 + static const unsigned int i2c_sck_a0_pins[] = { GPIOZ_1 }; 323 315 324 - static const unsigned int i2c_sda_b_pins[] = { PIN(GPIOZ_2, 0) }; 325 - static const unsigned int i2c_sck_b_pins[] = { PIN(GPIOZ_3, 0) }; 316 + static const unsigned int i2c_sda_b_pins[] = { GPIOZ_2 }; 317 + static const unsigned int i2c_sck_b_pins[] = { GPIOZ_3 }; 326 318 327 - static const unsigned int i2c_sda_c1_pins[] = { PIN(GPIOZ_4, 0) }; 328 - static const unsigned int i2c_sck_c1_pins[] = { PIN(GPIOZ_5, 0) }; 319 + static const unsigned int i2c_sda_c1_pins[] = { GPIOZ_4 }; 320 + static const unsigned int i2c_sck_c1_pins[] = { GPIOZ_5 }; 329 321 330 - static const unsigned int i2c_sda_a1_pins[] = { PIN(GPIOZ_0, 0) }; 331 - static const unsigned int i2c_sck_a1_pins[] = { PIN(GPIOZ_1, 0) }; 322 + static const unsigned int i2c_sda_a1_pins[] = { GPIOZ_0 }; 323 + static const unsigned int i2c_sck_a1_pins[] = { GPIOZ_1 }; 332 324 333 - static const unsigned int i2c_sda_a2_pins[] = { PIN(GPIOZ_0, 0) }; 334 - static const unsigned int i2c_sck_a2_pins[] = { PIN(GPIOZ_1, 0) }; 325 + static const unsigned int i2c_sda_a2_pins[] = { GPIOZ_0 }; 326 + static const unsigned int i2c_sck_a2_pins[] = { GPIOZ_1 }; 335 327 336 - static const unsigned int pwm_a_z0_pins[] = { PIN(GPIOZ_0, 0) }; 337 - static const unsigned int pwm_a_z7_pins[] = { PIN(GPIOZ_7, 0) }; 338 - static const unsigned int pwm_b_z_pins[] = { PIN(GPIOZ_1, 0) }; 339 - static const unsigned int pwm_c_z_pins[] = { PIN(GPIOZ_8, 0) }; 328 + static const unsigned int pwm_a_z0_pins[] = { GPIOZ_0 }; 329 + static const unsigned int pwm_a_z7_pins[] = { GPIOZ_7 }; 330 + static const unsigned int pwm_b_z_pins[] = { GPIOZ_1 }; 331 + static const unsigned int pwm_c_z_pins[] = { GPIOZ_8 }; 340 332 341 333 /* bank BOOT */ 342 - static const unsigned int sd_d0_c_pins[] = { PIN(BOOT_0, 0) }; 343 - static const unsigned int sd_d1_c_pins[] = { PIN(BOOT_1, 0) }; 344 - static const unsigned int sd_d2_c_pins[] = { PIN(BOOT_2, 0) }; 345 - static const unsigned int sd_d3_c_pins[] = { PIN(BOOT_3, 0) }; 346 - static const unsigned int sd_cmd_c_pins[] = { PIN(BOOT_16, 0) }; 347 - static const unsigned int sd_clk_c_pins[] = { PIN(BOOT_17, 0) }; 334 + static const unsigned int sd_d0_c_pins[] = { BOOT_0 }; 335 + static const unsigned int sd_d1_c_pins[] = { BOOT_1 }; 336 + static const unsigned int sd_d2_c_pins[] = { BOOT_2 }; 337 + static const unsigned int sd_d3_c_pins[] = { BOOT_3 }; 338 + static const unsigned int sd_cmd_c_pins[] = { BOOT_16 }; 339 + static const unsigned int sd_clk_c_pins[] = { BOOT_17 }; 348 340 349 - static const unsigned int sdxc_d0_c_pins[] = { PIN(BOOT_0, 0)}; 350 - static const unsigned int sdxc_d13_c_pins[] = { PIN(BOOT_1, 0), PIN(BOOT_2, 0), 351 - PIN(BOOT_3, 0) }; 352 - static const unsigned int sdxc_d47_c_pins[] = { PIN(BOOT_4, 0), PIN(BOOT_5, 0), 353 - PIN(BOOT_6, 0), PIN(BOOT_7, 0) }; 354 - static const unsigned int sdxc_cmd_c_pins[] = { PIN(BOOT_16, 0) }; 355 - static const unsigned int sdxc_clk_c_pins[] = { PIN(BOOT_17, 0) }; 341 + static const unsigned int sdxc_d0_c_pins[] = { BOOT_0}; 342 + static const unsigned int sdxc_d13_c_pins[] = { BOOT_1, BOOT_2, BOOT_3 }; 343 + static const unsigned int sdxc_d47_c_pins[] = { BOOT_4, BOOT_5, BOOT_6, 344 + BOOT_7 }; 345 + static const unsigned int sdxc_cmd_c_pins[] = { BOOT_16 }; 346 + static const unsigned int sdxc_clk_c_pins[] = { BOOT_17 }; 356 347 357 - static const unsigned int nand_io_pins[] = { PIN(BOOT_0, 0), PIN(BOOT_1, 0), 358 - PIN(BOOT_2, 0), PIN(BOOT_3, 0), 359 - PIN(BOOT_4, 0), PIN(BOOT_5, 0), 360 - PIN(BOOT_6, 0), PIN(BOOT_7, 0) }; 361 - static const unsigned int nand_io_ce0_pins[] = { PIN(BOOT_8, 0) }; 362 - static const unsigned int nand_io_ce1_pins[] = { PIN(BOOT_9, 0) }; 363 - static const unsigned int nand_io_rb0_pins[] = { PIN(BOOT_10, 0) }; 364 - static const unsigned int nand_ale_pins[] = { PIN(BOOT_11, 0) }; 365 - static const unsigned int nand_cle_pins[] = { PIN(BOOT_12, 0) }; 366 - static const unsigned int nand_wen_clk_pins[] = { PIN(BOOT_13, 0) }; 367 - static const unsigned int nand_ren_clk_pins[] = { PIN(BOOT_14, 0) }; 368 - static const unsigned int nand_dqs_pins[] = { PIN(BOOT_15, 0) }; 369 - static const unsigned int nand_ce2_pins[] = { PIN(BOOT_16, 0) }; 370 - static const unsigned int nand_ce3_pins[] = { PIN(BOOT_17, 0) }; 348 + static const unsigned int nand_io_pins[] = { 349 + BOOT_0, BOOT_1, BOOT_2, BOOT_3, BOOT_4, BOOT_5, BOOT_6, BOOT_7 350 + }; 351 + static const unsigned int nand_io_ce0_pins[] = { BOOT_8 }; 352 + static const unsigned int nand_io_ce1_pins[] = { BOOT_9 }; 353 + static const unsigned int nand_io_rb0_pins[] = { BOOT_10 }; 354 + static const unsigned int nand_ale_pins[] = { BOOT_11 }; 355 + static const unsigned int nand_cle_pins[] = { BOOT_12 }; 356 + static const unsigned int nand_wen_clk_pins[] = { BOOT_13 }; 357 + static const unsigned int nand_ren_clk_pins[] = { BOOT_14 }; 358 + static const unsigned int nand_dqs_pins[] = { BOOT_15 }; 359 + static const unsigned int nand_ce2_pins[] = { BOOT_16 }; 360 + static const unsigned int nand_ce3_pins[] = { BOOT_17 }; 371 361 372 - static const unsigned int nor_d_pins[] = { PIN(BOOT_11, 0) }; 373 - static const unsigned int nor_q_pins[] = { PIN(BOOT_12, 0) }; 374 - static const unsigned int nor_c_pins[] = { PIN(BOOT_13, 0) }; 375 - static const unsigned int nor_cs_pins[] = { PIN(BOOT_18, 0) }; 362 + static const unsigned int nor_d_pins[] = { BOOT_11 }; 363 + static const unsigned int nor_q_pins[] = { BOOT_12 }; 364 + static const unsigned int nor_c_pins[] = { BOOT_13 }; 365 + static const unsigned int nor_cs_pins[] = { BOOT_18 }; 376 366 377 367 /* bank CARD */ 378 - static const unsigned int sd_d1_b_pins[] = { PIN(CARD_0, 0) }; 379 - static const unsigned int sd_d0_b_pins[] = { PIN(CARD_1, 0) }; 380 - static const unsigned int sd_clk_b_pins[] = { PIN(CARD_2, 0) }; 381 - static const unsigned int sd_cmd_b_pins[] = { PIN(CARD_3, 0) }; 382 - static const unsigned int sd_d3_b_pins[] = { PIN(CARD_4, 0) }; 383 - static const unsigned int sd_d2_b_pins[] = { PIN(CARD_5, 0) }; 368 + static const unsigned int sd_d1_b_pins[] = { CARD_0 }; 369 + static const unsigned int sd_d0_b_pins[] = { CARD_1 }; 370 + static const unsigned int sd_clk_b_pins[] = { CARD_2 }; 371 + static const unsigned int sd_cmd_b_pins[] = { CARD_3 }; 372 + static const unsigned int sd_d3_b_pins[] = { CARD_4 }; 373 + static const unsigned int sd_d2_b_pins[] = { CARD_5 }; 384 374 385 - static const unsigned int sdxc_d13_b_pins[] = { PIN(CARD_0, 0), PIN(CARD_4, 0), 386 - PIN(CARD_5, 0) }; 387 - static const unsigned int sdxc_d0_b_pins[] = { PIN(CARD_1, 0) }; 388 - static const unsigned int sdxc_clk_b_pins[] = { PIN(CARD_2, 0) }; 389 - static const unsigned int sdxc_cmd_b_pins[] = { PIN(CARD_3, 0) }; 375 + static const unsigned int sdxc_d13_b_pins[] = { CARD_0, CARD_4, CARD_5 }; 376 + static const unsigned int sdxc_d0_b_pins[] = { CARD_1 }; 377 + static const unsigned int sdxc_clk_b_pins[] = { CARD_2 }; 378 + static const unsigned int sdxc_cmd_b_pins[] = { CARD_3 }; 390 379 391 380 /* bank AO */ 392 - static const unsigned int uart_tx_ao_a_pins[] = { PIN(GPIOAO_0, AO_OFF) }; 393 - static const unsigned int uart_rx_ao_a_pins[] = { PIN(GPIOAO_1, AO_OFF) }; 394 - static const unsigned int uart_cts_ao_a_pins[] = { PIN(GPIOAO_2, AO_OFF) }; 395 - static const unsigned int uart_rts_ao_a_pins[] = { PIN(GPIOAO_3, AO_OFF) }; 381 + static const unsigned int uart_tx_ao_a_pins[] = { GPIOAO_0 }; 382 + static const unsigned int uart_rx_ao_a_pins[] = { GPIOAO_1 }; 383 + static const unsigned int uart_cts_ao_a_pins[] = { GPIOAO_2 }; 384 + static const unsigned int uart_rts_ao_a_pins[] = { GPIOAO_3 }; 396 385 397 - static const unsigned int remote_input_pins[] = { PIN(GPIOAO_7, AO_OFF) }; 398 - static const unsigned int remote_output_ao_pins[] = { PIN(GPIOAO_13, AO_OFF) }; 386 + static const unsigned int remote_input_pins[] = { GPIOAO_7 }; 387 + static const unsigned int remote_output_ao_pins[] = { GPIOAO_13 }; 399 388 400 - static const unsigned int i2c_slave_sck_ao_pins[] = { PIN(GPIOAO_4, AO_OFF) }; 401 - static const unsigned int i2c_slave_sda_ao_pins[] = { PIN(GPIOAO_5, AO_OFF) }; 389 + static const unsigned int i2c_slave_sck_ao_pins[] = { GPIOAO_4 }; 390 + static const unsigned int i2c_slave_sda_ao_pins[] = { GPIOAO_5 }; 402 391 403 - static const unsigned int uart_tx_ao_b0_pins[] = { PIN(GPIOAO_0, AO_OFF) }; 404 - static const unsigned int uart_rx_ao_b0_pins[] = { PIN(GPIOAO_1, AO_OFF) }; 392 + static const unsigned int uart_tx_ao_b0_pins[] = { GPIOAO_0 }; 393 + static const unsigned int uart_rx_ao_b0_pins[] = { GPIOAO_1 }; 405 394 406 - static const unsigned int uart_tx_ao_b1_pins[] = { PIN(GPIOAO_4, AO_OFF) }; 407 - static const unsigned int uart_rx_ao_b1_pins[] = { PIN(GPIOAO_5, AO_OFF) }; 395 + static const unsigned int uart_tx_ao_b1_pins[] = { GPIOAO_4 }; 396 + static const unsigned int uart_rx_ao_b1_pins[] = { GPIOAO_5 }; 408 397 409 - static const unsigned int i2c_mst_sck_ao_pins[] = { PIN(GPIOAO_4, AO_OFF) }; 410 - static const unsigned int i2c_mst_sda_ao_pins[] = { PIN(GPIOAO_5, AO_OFF) }; 398 + static const unsigned int i2c_mst_sck_ao_pins[] = { GPIOAO_4 }; 399 + static const unsigned int i2c_mst_sda_ao_pins[] = { GPIOAO_5 }; 411 400 412 - static const unsigned int pwm_f_ao_pins[] = { PIN(GPIO_TEST_N, AO_OFF) }; 401 + static const unsigned int pwm_f_ao_pins[] = { GPIO_TEST_N }; 413 402 414 - static const unsigned int i2s_am_clk_out_ao_pins[] = { PIN(GPIOAO_8, AO_OFF) }; 415 - static const unsigned int i2s_ao_clk_out_ao_pins[] = { PIN(GPIOAO_9, AO_OFF) }; 416 - static const unsigned int i2s_lr_clk_out_ao_pins[] = { PIN(GPIOAO_10, AO_OFF) }; 417 - static const unsigned int i2s_out_ch01_ao_pins[] = { PIN(GPIOAO_11, AO_OFF) }; 403 + static const unsigned int i2s_am_clk_out_ao_pins[] = { GPIOAO_8 }; 404 + static const unsigned int i2s_ao_clk_out_ao_pins[] = { GPIOAO_9 }; 405 + static const unsigned int i2s_lr_clk_out_ao_pins[] = { GPIOAO_10 }; 406 + static const unsigned int i2s_out_ch01_ao_pins[] = { GPIOAO_11 }; 418 407 419 - static const unsigned int hdmi_cec_ao_pins[] = { PIN(GPIOAO_12, AO_OFF) }; 408 + static const unsigned int hdmi_cec_ao_pins[] = { GPIOAO_12 }; 420 409 421 410 static struct meson_pmx_group meson8_cbus_groups[] = { 422 - GPIO_GROUP(GPIOX_0, 0), 423 - GPIO_GROUP(GPIOX_1, 0), 424 - GPIO_GROUP(GPIOX_2, 0), 425 - GPIO_GROUP(GPIOX_3, 0), 426 - GPIO_GROUP(GPIOX_4, 0), 427 - GPIO_GROUP(GPIOX_5, 0), 428 - GPIO_GROUP(GPIOX_6, 0), 429 - GPIO_GROUP(GPIOX_7, 0), 430 - GPIO_GROUP(GPIOX_8, 0), 431 - GPIO_GROUP(GPIOX_9, 0), 432 - GPIO_GROUP(GPIOX_10, 0), 433 - GPIO_GROUP(GPIOX_11, 0), 434 - GPIO_GROUP(GPIOX_12, 0), 435 - GPIO_GROUP(GPIOX_13, 0), 436 - GPIO_GROUP(GPIOX_14, 0), 437 - GPIO_GROUP(GPIOX_15, 0), 438 - GPIO_GROUP(GPIOX_16, 0), 439 - GPIO_GROUP(GPIOX_17, 0), 440 - GPIO_GROUP(GPIOX_18, 0), 441 - GPIO_GROUP(GPIOX_19, 0), 442 - GPIO_GROUP(GPIOX_20, 0), 443 - GPIO_GROUP(GPIOX_21, 0), 444 - GPIO_GROUP(GPIOY_0, 0), 445 - GPIO_GROUP(GPIOY_1, 0), 446 - GPIO_GROUP(GPIOY_2, 0), 447 - GPIO_GROUP(GPIOY_3, 0), 448 - GPIO_GROUP(GPIOY_4, 0), 449 - GPIO_GROUP(GPIOY_5, 0), 450 - GPIO_GROUP(GPIOY_6, 0), 451 - GPIO_GROUP(GPIOY_7, 0), 452 - GPIO_GROUP(GPIOY_8, 0), 453 - GPIO_GROUP(GPIOY_9, 0), 454 - GPIO_GROUP(GPIOY_10, 0), 455 - GPIO_GROUP(GPIOY_11, 0), 456 - GPIO_GROUP(GPIOY_12, 0), 457 - GPIO_GROUP(GPIOY_13, 0), 458 - GPIO_GROUP(GPIOY_14, 0), 459 - GPIO_GROUP(GPIOY_15, 0), 460 - GPIO_GROUP(GPIOY_16, 0), 461 - GPIO_GROUP(GPIODV_0, 0), 462 - GPIO_GROUP(GPIODV_1, 0), 463 - GPIO_GROUP(GPIODV_2, 0), 464 - GPIO_GROUP(GPIODV_3, 0), 465 - GPIO_GROUP(GPIODV_4, 0), 466 - GPIO_GROUP(GPIODV_5, 0), 467 - GPIO_GROUP(GPIODV_6, 0), 468 - GPIO_GROUP(GPIODV_7, 0), 469 - GPIO_GROUP(GPIODV_8, 0), 470 - GPIO_GROUP(GPIODV_9, 0), 471 - GPIO_GROUP(GPIODV_10, 0), 472 - GPIO_GROUP(GPIODV_11, 0), 473 - GPIO_GROUP(GPIODV_12, 0), 474 - GPIO_GROUP(GPIODV_13, 0), 475 - GPIO_GROUP(GPIODV_14, 0), 476 - GPIO_GROUP(GPIODV_15, 0), 477 - GPIO_GROUP(GPIODV_16, 0), 478 - GPIO_GROUP(GPIODV_17, 0), 479 - GPIO_GROUP(GPIODV_18, 0), 480 - GPIO_GROUP(GPIODV_19, 0), 481 - GPIO_GROUP(GPIODV_20, 0), 482 - GPIO_GROUP(GPIODV_21, 0), 483 - GPIO_GROUP(GPIODV_22, 0), 484 - GPIO_GROUP(GPIODV_23, 0), 485 - GPIO_GROUP(GPIODV_24, 0), 486 - GPIO_GROUP(GPIODV_25, 0), 487 - GPIO_GROUP(GPIODV_26, 0), 488 - GPIO_GROUP(GPIODV_27, 0), 489 - GPIO_GROUP(GPIODV_28, 0), 490 - GPIO_GROUP(GPIODV_29, 0), 491 - GPIO_GROUP(GPIOH_0, 0), 492 - GPIO_GROUP(GPIOH_1, 0), 493 - GPIO_GROUP(GPIOH_2, 0), 494 - GPIO_GROUP(GPIOH_3, 0), 495 - GPIO_GROUP(GPIOH_4, 0), 496 - GPIO_GROUP(GPIOH_5, 0), 497 - GPIO_GROUP(GPIOH_6, 0), 498 - GPIO_GROUP(GPIOH_7, 0), 499 - GPIO_GROUP(GPIOH_8, 0), 500 - GPIO_GROUP(GPIOH_9, 0), 501 - GPIO_GROUP(GPIOZ_0, 0), 502 - GPIO_GROUP(GPIOZ_1, 0), 503 - GPIO_GROUP(GPIOZ_2, 0), 504 - GPIO_GROUP(GPIOZ_3, 0), 505 - GPIO_GROUP(GPIOZ_4, 0), 506 - GPIO_GROUP(GPIOZ_5, 0), 507 - GPIO_GROUP(GPIOZ_6, 0), 508 - GPIO_GROUP(GPIOZ_7, 0), 509 - GPIO_GROUP(GPIOZ_8, 0), 510 - GPIO_GROUP(GPIOZ_9, 0), 511 - GPIO_GROUP(GPIOZ_10, 0), 512 - GPIO_GROUP(GPIOZ_11, 0), 513 - GPIO_GROUP(GPIOZ_12, 0), 514 - GPIO_GROUP(GPIOZ_13, 0), 515 - GPIO_GROUP(GPIOZ_14, 0), 411 + GPIO_GROUP(GPIOX_0), 412 + GPIO_GROUP(GPIOX_1), 413 + GPIO_GROUP(GPIOX_2), 414 + GPIO_GROUP(GPIOX_3), 415 + GPIO_GROUP(GPIOX_4), 416 + GPIO_GROUP(GPIOX_5), 417 + GPIO_GROUP(GPIOX_6), 418 + GPIO_GROUP(GPIOX_7), 419 + GPIO_GROUP(GPIOX_8), 420 + GPIO_GROUP(GPIOX_9), 421 + GPIO_GROUP(GPIOX_10), 422 + GPIO_GROUP(GPIOX_11), 423 + GPIO_GROUP(GPIOX_12), 424 + GPIO_GROUP(GPIOX_13), 425 + GPIO_GROUP(GPIOX_14), 426 + GPIO_GROUP(GPIOX_15), 427 + GPIO_GROUP(GPIOX_16), 428 + GPIO_GROUP(GPIOX_17), 429 + GPIO_GROUP(GPIOX_18), 430 + GPIO_GROUP(GPIOX_19), 431 + GPIO_GROUP(GPIOX_20), 432 + GPIO_GROUP(GPIOX_21), 433 + GPIO_GROUP(GPIOY_0), 434 + GPIO_GROUP(GPIOY_1), 435 + GPIO_GROUP(GPIOY_2), 436 + GPIO_GROUP(GPIOY_3), 437 + GPIO_GROUP(GPIOY_4), 438 + GPIO_GROUP(GPIOY_5), 439 + GPIO_GROUP(GPIOY_6), 440 + GPIO_GROUP(GPIOY_7), 441 + GPIO_GROUP(GPIOY_8), 442 + GPIO_GROUP(GPIOY_9), 443 + GPIO_GROUP(GPIOY_10), 444 + GPIO_GROUP(GPIOY_11), 445 + GPIO_GROUP(GPIOY_12), 446 + GPIO_GROUP(GPIOY_13), 447 + GPIO_GROUP(GPIOY_14), 448 + GPIO_GROUP(GPIOY_15), 449 + GPIO_GROUP(GPIOY_16), 450 + GPIO_GROUP(GPIODV_0), 451 + GPIO_GROUP(GPIODV_1), 452 + GPIO_GROUP(GPIODV_2), 453 + GPIO_GROUP(GPIODV_3), 454 + GPIO_GROUP(GPIODV_4), 455 + GPIO_GROUP(GPIODV_5), 456 + GPIO_GROUP(GPIODV_6), 457 + GPIO_GROUP(GPIODV_7), 458 + GPIO_GROUP(GPIODV_8), 459 + GPIO_GROUP(GPIODV_9), 460 + GPIO_GROUP(GPIODV_10), 461 + GPIO_GROUP(GPIODV_11), 462 + GPIO_GROUP(GPIODV_12), 463 + GPIO_GROUP(GPIODV_13), 464 + GPIO_GROUP(GPIODV_14), 465 + GPIO_GROUP(GPIODV_15), 466 + GPIO_GROUP(GPIODV_16), 467 + GPIO_GROUP(GPIODV_17), 468 + GPIO_GROUP(GPIODV_18), 469 + GPIO_GROUP(GPIODV_19), 470 + GPIO_GROUP(GPIODV_20), 471 + GPIO_GROUP(GPIODV_21), 472 + GPIO_GROUP(GPIODV_22), 473 + GPIO_GROUP(GPIODV_23), 474 + GPIO_GROUP(GPIODV_24), 475 + GPIO_GROUP(GPIODV_25), 476 + GPIO_GROUP(GPIODV_26), 477 + GPIO_GROUP(GPIODV_27), 478 + GPIO_GROUP(GPIODV_28), 479 + GPIO_GROUP(GPIODV_29), 480 + GPIO_GROUP(GPIOH_0), 481 + GPIO_GROUP(GPIOH_1), 482 + GPIO_GROUP(GPIOH_2), 483 + GPIO_GROUP(GPIOH_3), 484 + GPIO_GROUP(GPIOH_4), 485 + GPIO_GROUP(GPIOH_5), 486 + GPIO_GROUP(GPIOH_6), 487 + GPIO_GROUP(GPIOH_7), 488 + GPIO_GROUP(GPIOH_8), 489 + GPIO_GROUP(GPIOH_9), 490 + GPIO_GROUP(GPIOZ_0), 491 + GPIO_GROUP(GPIOZ_1), 492 + GPIO_GROUP(GPIOZ_2), 493 + GPIO_GROUP(GPIOZ_3), 494 + GPIO_GROUP(GPIOZ_4), 495 + GPIO_GROUP(GPIOZ_5), 496 + GPIO_GROUP(GPIOZ_6), 497 + GPIO_GROUP(GPIOZ_7), 498 + GPIO_GROUP(GPIOZ_8), 499 + GPIO_GROUP(GPIOZ_9), 500 + GPIO_GROUP(GPIOZ_10), 501 + GPIO_GROUP(GPIOZ_11), 502 + GPIO_GROUP(GPIOZ_12), 503 + GPIO_GROUP(GPIOZ_13), 504 + GPIO_GROUP(GPIOZ_14), 516 505 517 506 /* bank X */ 518 507 GROUP(sd_d0_a, 8, 5), ··· 716 727 }; 717 728 718 729 static struct meson_pmx_group meson8_aobus_groups[] = { 719 - GPIO_GROUP(GPIOAO_0, AO_OFF), 720 - GPIO_GROUP(GPIOAO_1, AO_OFF), 721 - GPIO_GROUP(GPIOAO_2, AO_OFF), 722 - GPIO_GROUP(GPIOAO_3, AO_OFF), 723 - GPIO_GROUP(GPIOAO_4, AO_OFF), 724 - GPIO_GROUP(GPIOAO_5, AO_OFF), 725 - GPIO_GROUP(GPIOAO_6, AO_OFF), 726 - GPIO_GROUP(GPIOAO_7, AO_OFF), 727 - GPIO_GROUP(GPIOAO_8, AO_OFF), 728 - GPIO_GROUP(GPIOAO_9, AO_OFF), 729 - GPIO_GROUP(GPIOAO_10, AO_OFF), 730 - GPIO_GROUP(GPIOAO_11, AO_OFF), 731 - GPIO_GROUP(GPIOAO_12, AO_OFF), 732 - GPIO_GROUP(GPIOAO_13, AO_OFF), 733 - GPIO_GROUP(GPIO_BSD_EN, AO_OFF), 734 - GPIO_GROUP(GPIO_TEST_N, AO_OFF), 730 + GPIO_GROUP(GPIOAO_0), 731 + GPIO_GROUP(GPIOAO_1), 732 + GPIO_GROUP(GPIOAO_2), 733 + GPIO_GROUP(GPIOAO_3), 734 + GPIO_GROUP(GPIOAO_4), 735 + GPIO_GROUP(GPIOAO_5), 736 + GPIO_GROUP(GPIOAO_6), 737 + GPIO_GROUP(GPIOAO_7), 738 + GPIO_GROUP(GPIOAO_8), 739 + GPIO_GROUP(GPIOAO_9), 740 + GPIO_GROUP(GPIOAO_10), 741 + GPIO_GROUP(GPIOAO_11), 742 + GPIO_GROUP(GPIOAO_12), 743 + GPIO_GROUP(GPIOAO_13), 744 + GPIO_GROUP(GPIO_BSD_EN), 745 + GPIO_GROUP(GPIO_TEST_N), 735 746 736 747 /* bank AO */ 737 748 GROUP(uart_tx_ao_a, 0, 12), ··· 1030 1041 }; 1031 1042 1032 1043 static struct meson_bank meson8_cbus_banks[] = { 1033 - /* name first last irq pullen pull dir out in */ 1034 - BANK("X", PIN(GPIOX_0, 0), PIN(GPIOX_21, 0), 112, 133, 4, 0, 4, 0, 0, 0, 1, 0, 2, 0), 1035 - BANK("Y", PIN(GPIOY_0, 0), PIN(GPIOY_16, 0), 95, 111, 3, 0, 3, 0, 3, 0, 4, 0, 5, 0), 1036 - BANK("DV", PIN(GPIODV_0, 0), PIN(GPIODV_29, 0), 65, 94, 0, 0, 0, 0, 7, 0, 8, 0, 9, 0), 1037 - BANK("H", PIN(GPIOH_0, 0), PIN(GPIOH_9, 0), 29, 38, 1, 16, 1, 16, 9, 19, 10, 19, 11, 19), 1038 - BANK("Z", PIN(GPIOZ_0, 0), PIN(GPIOZ_14, 0), 14, 28, 1, 0, 1, 0, 3, 17, 4, 17, 5, 17), 1039 - BANK("CARD", PIN(CARD_0, 0), PIN(CARD_6, 0), 58, 64, 2, 20, 2, 20, 0, 22, 1, 22, 2, 22), 1040 - BANK("BOOT", PIN(BOOT_0, 0), PIN(BOOT_18, 0), 39, 57, 2, 0, 2, 0, 9, 0, 10, 0, 11, 0), 1044 + /* name first last irq pullen pull dir out in */ 1045 + BANK("X", GPIOX_0, GPIOX_21, 112, 133, 4, 0, 4, 0, 0, 0, 1, 0, 2, 0), 1046 + BANK("Y", GPIOY_0, GPIOY_16, 95, 111, 3, 0, 3, 0, 3, 0, 4, 0, 5, 0), 1047 + BANK("DV", GPIODV_0, GPIODV_29, 65, 94, 0, 0, 0, 0, 7, 0, 8, 0, 9, 0), 1048 + BANK("H", GPIOH_0, GPIOH_9, 29, 38, 1, 16, 1, 16, 9, 19, 10, 19, 11, 19), 1049 + BANK("Z", GPIOZ_0, GPIOZ_14, 14, 28, 1, 0, 1, 0, 3, 17, 4, 17, 5, 17), 1050 + BANK("CARD", CARD_0, CARD_6, 58, 64, 2, 20, 2, 20, 0, 22, 1, 22, 2, 22), 1051 + BANK("BOOT", BOOT_0, BOOT_18, 39, 57, 2, 0, 2, 0, 9, 0, 10, 0, 11, 0), 1041 1052 }; 1042 1053 1043 1054 static struct meson_bank meson8_aobus_banks[] = { 1044 - /* name first last irq pullen pull dir out in */ 1045 - BANK("AO", PIN(GPIOAO_0, AO_OFF), PIN(GPIO_TEST_N, AO_OFF), 0, 13, 0, 0, 0, 16, 0, 0, 0, 16, 1, 0), 1055 + /* name first last irq pullen pull dir out in */ 1056 + BANK("AO", GPIOAO_0, GPIO_TEST_N, 0, 13, 0, 0, 0, 16, 0, 0, 0, 16, 1, 0), 1046 1057 }; 1047 1058 1048 - struct meson_pinctrl_data meson8_cbus_pinctrl_data = { 1059 + static struct meson_pinctrl_data meson8_cbus_pinctrl_data = { 1049 1060 .name = "cbus-banks", 1050 - .pin_base = 0, 1051 1061 .pins = meson8_cbus_pins, 1052 1062 .groups = meson8_cbus_groups, 1053 1063 .funcs = meson8_cbus_functions, ··· 1055 1067 .num_groups = ARRAY_SIZE(meson8_cbus_groups), 1056 1068 .num_funcs = ARRAY_SIZE(meson8_cbus_functions), 1057 1069 .num_banks = ARRAY_SIZE(meson8_cbus_banks), 1070 + .pmx_ops = &meson8_pmx_ops, 1058 1071 }; 1059 1072 1060 - struct meson_pinctrl_data meson8_aobus_pinctrl_data = { 1073 + static struct meson_pinctrl_data meson8_aobus_pinctrl_data = { 1061 1074 .name = "ao-bank", 1062 - .pin_base = 120, 1063 1075 .pins = meson8_aobus_pins, 1064 1076 .groups = meson8_aobus_groups, 1065 1077 .funcs = meson8_aobus_functions, ··· 1068 1080 .num_groups = ARRAY_SIZE(meson8_aobus_groups), 1069 1081 .num_funcs = ARRAY_SIZE(meson8_aobus_functions), 1070 1082 .num_banks = ARRAY_SIZE(meson8_aobus_banks), 1083 + .pmx_ops = &meson8_pmx_ops, 1071 1084 }; 1085 + 1086 + static const struct of_device_id meson8_pinctrl_dt_match[] = { 1087 + { 1088 + .compatible = "amlogic,meson8-cbus-pinctrl", 1089 + .data = &meson8_cbus_pinctrl_data, 1090 + }, 1091 + { 1092 + .compatible = "amlogic,meson8-aobus-pinctrl", 1093 + .data = &meson8_aobus_pinctrl_data, 1094 + }, 1095 + { }, 1096 + }; 1097 + 1098 + static struct platform_driver meson8_pinctrl_driver = { 1099 + .probe = meson_pinctrl_probe, 1100 + .driver = { 1101 + .name = "meson8-pinctrl", 1102 + .of_match_table = meson8_pinctrl_dt_match, 1103 + }, 1104 + }; 1105 + builtin_platform_driver(meson8_pinctrl_driver);
+390 -372
drivers/pinctrl/meson/pinctrl-meson8b.c
··· 14 14 15 15 #include <dt-bindings/gpio/meson8b-gpio.h> 16 16 #include "pinctrl-meson.h" 17 - 18 - #define AO_OFF 130 17 + #include "pinctrl-meson8-pmx.h" 19 18 20 19 static const struct pinctrl_pin_desc meson8b_cbus_pins[] = { 21 - MESON_PIN(GPIOX_0, 0), 22 - MESON_PIN(GPIOX_1, 0), 23 - MESON_PIN(GPIOX_2, 0), 24 - MESON_PIN(GPIOX_3, 0), 25 - MESON_PIN(GPIOX_4, 0), 26 - MESON_PIN(GPIOX_5, 0), 27 - MESON_PIN(GPIOX_6, 0), 28 - MESON_PIN(GPIOX_7, 0), 29 - MESON_PIN(GPIOX_8, 0), 30 - MESON_PIN(GPIOX_9, 0), 31 - MESON_PIN(GPIOX_10, 0), 32 - MESON_PIN(GPIOX_11, 0), 33 - MESON_PIN(GPIOX_16, 0), 34 - MESON_PIN(GPIOX_17, 0), 35 - MESON_PIN(GPIOX_18, 0), 36 - MESON_PIN(GPIOX_19, 0), 37 - MESON_PIN(GPIOX_20, 0), 38 - MESON_PIN(GPIOX_21, 0), 20 + MESON_PIN(GPIOX_0), 21 + MESON_PIN(GPIOX_1), 22 + MESON_PIN(GPIOX_2), 23 + MESON_PIN(GPIOX_3), 24 + MESON_PIN(GPIOX_4), 25 + MESON_PIN(GPIOX_5), 26 + MESON_PIN(GPIOX_6), 27 + MESON_PIN(GPIOX_7), 28 + MESON_PIN(GPIOX_8), 29 + MESON_PIN(GPIOX_9), 30 + MESON_PIN(GPIOX_10), 31 + MESON_PIN(GPIOX_11), 32 + MESON_PIN(GPIOX_16), 33 + MESON_PIN(GPIOX_17), 34 + MESON_PIN(GPIOX_18), 35 + MESON_PIN(GPIOX_19), 36 + MESON_PIN(GPIOX_20), 37 + MESON_PIN(GPIOX_21), 39 38 40 - MESON_PIN(GPIOY_0, 0), 41 - MESON_PIN(GPIOY_1, 0), 42 - MESON_PIN(GPIOY_3, 0), 43 - MESON_PIN(GPIOY_6, 0), 44 - MESON_PIN(GPIOY_7, 0), 45 - MESON_PIN(GPIOY_8, 0), 46 - MESON_PIN(GPIOY_9, 0), 47 - MESON_PIN(GPIOY_10, 0), 48 - MESON_PIN(GPIOY_11, 0), 49 - MESON_PIN(GPIOY_12, 0), 50 - MESON_PIN(GPIOY_13, 0), 51 - MESON_PIN(GPIOY_14, 0), 39 + MESON_PIN(GPIOY_0), 40 + MESON_PIN(GPIOY_1), 41 + MESON_PIN(GPIOY_3), 42 + MESON_PIN(GPIOY_6), 43 + MESON_PIN(GPIOY_7), 44 + MESON_PIN(GPIOY_8), 45 + MESON_PIN(GPIOY_9), 46 + MESON_PIN(GPIOY_10), 47 + MESON_PIN(GPIOY_11), 48 + MESON_PIN(GPIOY_12), 49 + MESON_PIN(GPIOY_13), 50 + MESON_PIN(GPIOY_14), 52 51 53 - MESON_PIN(GPIODV_9, 0), 54 - MESON_PIN(GPIODV_24, 0), 55 - MESON_PIN(GPIODV_25, 0), 56 - MESON_PIN(GPIODV_26, 0), 57 - MESON_PIN(GPIODV_27, 0), 58 - MESON_PIN(GPIODV_28, 0), 59 - MESON_PIN(GPIODV_29, 0), 52 + MESON_PIN(GPIODV_9), 53 + MESON_PIN(GPIODV_24), 54 + MESON_PIN(GPIODV_25), 55 + MESON_PIN(GPIODV_26), 56 + MESON_PIN(GPIODV_27), 57 + MESON_PIN(GPIODV_28), 58 + MESON_PIN(GPIODV_29), 60 59 61 - MESON_PIN(GPIOH_0, 0), 62 - MESON_PIN(GPIOH_1, 0), 63 - MESON_PIN(GPIOH_2, 0), 64 - MESON_PIN(GPIOH_3, 0), 65 - MESON_PIN(GPIOH_4, 0), 66 - MESON_PIN(GPIOH_5, 0), 67 - MESON_PIN(GPIOH_6, 0), 68 - MESON_PIN(GPIOH_7, 0), 69 - MESON_PIN(GPIOH_8, 0), 70 - MESON_PIN(GPIOH_9, 0), 60 + MESON_PIN(GPIOH_0), 61 + MESON_PIN(GPIOH_1), 62 + MESON_PIN(GPIOH_2), 63 + MESON_PIN(GPIOH_3), 64 + MESON_PIN(GPIOH_4), 65 + MESON_PIN(GPIOH_5), 66 + MESON_PIN(GPIOH_6), 67 + MESON_PIN(GPIOH_7), 68 + MESON_PIN(GPIOH_8), 69 + MESON_PIN(GPIOH_9), 71 70 72 - MESON_PIN(CARD_0, 0), 73 - MESON_PIN(CARD_1, 0), 74 - MESON_PIN(CARD_2, 0), 75 - MESON_PIN(CARD_3, 0), 76 - MESON_PIN(CARD_4, 0), 77 - MESON_PIN(CARD_5, 0), 78 - MESON_PIN(CARD_6, 0), 71 + MESON_PIN(CARD_0), 72 + MESON_PIN(CARD_1), 73 + MESON_PIN(CARD_2), 74 + MESON_PIN(CARD_3), 75 + MESON_PIN(CARD_4), 76 + MESON_PIN(CARD_5), 77 + MESON_PIN(CARD_6), 79 78 80 - MESON_PIN(BOOT_0, 0), 81 - MESON_PIN(BOOT_1, 0), 82 - MESON_PIN(BOOT_2, 0), 83 - MESON_PIN(BOOT_3, 0), 84 - MESON_PIN(BOOT_4, 0), 85 - MESON_PIN(BOOT_5, 0), 86 - MESON_PIN(BOOT_6, 0), 87 - MESON_PIN(BOOT_7, 0), 88 - MESON_PIN(BOOT_8, 0), 89 - MESON_PIN(BOOT_9, 0), 90 - MESON_PIN(BOOT_10, 0), 91 - MESON_PIN(BOOT_11, 0), 92 - MESON_PIN(BOOT_12, 0), 93 - MESON_PIN(BOOT_13, 0), 94 - MESON_PIN(BOOT_14, 0), 95 - MESON_PIN(BOOT_15, 0), 96 - MESON_PIN(BOOT_16, 0), 97 - MESON_PIN(BOOT_17, 0), 98 - MESON_PIN(BOOT_18, 0), 79 + MESON_PIN(BOOT_0), 80 + MESON_PIN(BOOT_1), 81 + MESON_PIN(BOOT_2), 82 + MESON_PIN(BOOT_3), 83 + MESON_PIN(BOOT_4), 84 + MESON_PIN(BOOT_5), 85 + MESON_PIN(BOOT_6), 86 + MESON_PIN(BOOT_7), 87 + MESON_PIN(BOOT_8), 88 + MESON_PIN(BOOT_9), 89 + MESON_PIN(BOOT_10), 90 + MESON_PIN(BOOT_11), 91 + MESON_PIN(BOOT_12), 92 + MESON_PIN(BOOT_13), 93 + MESON_PIN(BOOT_14), 94 + MESON_PIN(BOOT_15), 95 + MESON_PIN(BOOT_16), 96 + MESON_PIN(BOOT_17), 97 + MESON_PIN(BOOT_18), 99 98 100 - MESON_PIN(DIF_0_P, 0), 101 - MESON_PIN(DIF_0_N, 0), 102 - MESON_PIN(DIF_1_P, 0), 103 - MESON_PIN(DIF_1_N, 0), 104 - MESON_PIN(DIF_2_P, 0), 105 - MESON_PIN(DIF_2_N, 0), 106 - MESON_PIN(DIF_3_P, 0), 107 - MESON_PIN(DIF_3_N, 0), 108 - MESON_PIN(DIF_4_P, 0), 109 - MESON_PIN(DIF_4_N, 0), 99 + MESON_PIN(DIF_0_P), 100 + MESON_PIN(DIF_0_N), 101 + MESON_PIN(DIF_1_P), 102 + MESON_PIN(DIF_1_N), 103 + MESON_PIN(DIF_2_P), 104 + MESON_PIN(DIF_2_N), 105 + MESON_PIN(DIF_3_P), 106 + MESON_PIN(DIF_3_N), 107 + MESON_PIN(DIF_4_P), 108 + MESON_PIN(DIF_4_N), 110 109 }; 111 110 112 111 static const struct pinctrl_pin_desc meson8b_aobus_pins[] = { 113 - MESON_PIN(GPIOAO_0, AO_OFF), 114 - MESON_PIN(GPIOAO_1, AO_OFF), 115 - MESON_PIN(GPIOAO_2, AO_OFF), 116 - MESON_PIN(GPIOAO_3, AO_OFF), 117 - MESON_PIN(GPIOAO_4, AO_OFF), 118 - MESON_PIN(GPIOAO_5, AO_OFF), 119 - MESON_PIN(GPIOAO_6, AO_OFF), 120 - MESON_PIN(GPIOAO_7, AO_OFF), 121 - MESON_PIN(GPIOAO_8, AO_OFF), 122 - MESON_PIN(GPIOAO_9, AO_OFF), 123 - MESON_PIN(GPIOAO_10, AO_OFF), 124 - MESON_PIN(GPIOAO_11, AO_OFF), 125 - MESON_PIN(GPIOAO_12, AO_OFF), 126 - MESON_PIN(GPIOAO_13, AO_OFF), 112 + MESON_PIN(GPIOAO_0), 113 + MESON_PIN(GPIOAO_1), 114 + MESON_PIN(GPIOAO_2), 115 + MESON_PIN(GPIOAO_3), 116 + MESON_PIN(GPIOAO_4), 117 + MESON_PIN(GPIOAO_5), 118 + MESON_PIN(GPIOAO_6), 119 + MESON_PIN(GPIOAO_7), 120 + MESON_PIN(GPIOAO_8), 121 + MESON_PIN(GPIOAO_9), 122 + MESON_PIN(GPIOAO_10), 123 + MESON_PIN(GPIOAO_11), 124 + MESON_PIN(GPIOAO_12), 125 + MESON_PIN(GPIOAO_13), 127 126 128 127 /* 129 128 * The following 2 pins are not mentionned in the public datasheet 130 129 * According to this datasheet, they can't be used with the gpio 131 130 * interrupt controller 132 131 */ 133 - MESON_PIN(GPIO_BSD_EN, AO_OFF), 134 - MESON_PIN(GPIO_TEST_N, AO_OFF), 132 + MESON_PIN(GPIO_BSD_EN), 133 + MESON_PIN(GPIO_TEST_N), 135 134 }; 136 135 137 136 /* bank X */ 138 - static const unsigned int sd_d0_a_pins[] = { PIN(GPIOX_0, 0) }; 139 - static const unsigned int sd_d1_a_pins[] = { PIN(GPIOX_1, 0) }; 140 - static const unsigned int sd_d2_a_pins[] = { PIN(GPIOX_2, 0) }; 141 - static const unsigned int sd_d3_a_pins[] = { PIN(GPIOX_3, 0) }; 142 - static const unsigned int sdxc_d0_0_a_pins[] = { PIN(GPIOX_4, 0) }; 143 - static const unsigned int sdxc_d47_a_pins[] = { PIN(GPIOX_4, 0), PIN(GPIOX_5, 0), 144 - PIN(GPIOX_6, 0), PIN(GPIOX_7, 0) }; 145 - static const unsigned int sdxc_d13_0_a_pins[] = { PIN(GPIOX_5, 0), PIN(GPIOX_6, 0), 146 - PIN(GPIOX_7, 0) }; 147 - static const unsigned int sd_clk_a_pins[] = { PIN(GPIOX_8, 0) }; 148 - static const unsigned int sd_cmd_a_pins[] = { PIN(GPIOX_9, 0) }; 149 - static const unsigned int xtal_32k_out_pins[] = { PIN(GPIOX_10, 0) }; 150 - static const unsigned int xtal_24m_out_pins[] = { PIN(GPIOX_11, 0) }; 151 - static const unsigned int uart_tx_b0_pins[] = { PIN(GPIOX_16, 0) }; 152 - static const unsigned int uart_rx_b0_pins[] = { PIN(GPIOX_17, 0) }; 153 - static const unsigned int uart_cts_b0_pins[] = { PIN(GPIOX_18, 0) }; 154 - static const unsigned int uart_rts_b0_pins[] = { PIN(GPIOX_19, 0) }; 137 + static const unsigned int sd_d0_a_pins[] = { GPIOX_0 }; 138 + static const unsigned int sd_d1_a_pins[] = { GPIOX_1 }; 139 + static const unsigned int sd_d2_a_pins[] = { GPIOX_2 }; 140 + static const unsigned int sd_d3_a_pins[] = { GPIOX_3 }; 141 + static const unsigned int sdxc_d0_0_a_pins[] = { GPIOX_4 }; 142 + static const unsigned int sdxc_d47_a_pins[] = { GPIOX_4, GPIOX_5, 143 + GPIOX_6, GPIOX_7 }; 144 + static const unsigned int sdxc_d13_0_a_pins[] = { GPIOX_5, GPIOX_6, 145 + GPIOX_7 }; 146 + static const unsigned int sd_clk_a_pins[] = { GPIOX_8 }; 147 + static const unsigned int sd_cmd_a_pins[] = { GPIOX_9 }; 148 + static const unsigned int xtal_32k_out_pins[] = { GPIOX_10 }; 149 + static const unsigned int xtal_24m_out_pins[] = { GPIOX_11 }; 150 + static const unsigned int uart_tx_b0_pins[] = { GPIOX_16 }; 151 + static const unsigned int uart_rx_b0_pins[] = { GPIOX_17 }; 152 + static const unsigned int uart_cts_b0_pins[] = { GPIOX_18 }; 153 + static const unsigned int uart_rts_b0_pins[] = { GPIOX_19 }; 155 154 156 - static const unsigned int sdxc_d0_1_a_pins[] = { PIN(GPIOX_0, 0) }; 157 - static const unsigned int sdxc_d13_1_a_pins[] = { PIN(GPIOX_1, 0), PIN(GPIOX_2, 0), 158 - PIN(GPIOX_3, 0) }; 159 - static const unsigned int pcm_out_a_pins[] = { PIN(GPIOX_4, 0) }; 160 - static const unsigned int pcm_in_a_pins[] = { PIN(GPIOX_5, 0) }; 161 - static const unsigned int pcm_fs_a_pins[] = { PIN(GPIOX_6, 0) }; 162 - static const unsigned int pcm_clk_a_pins[] = { PIN(GPIOX_7, 0) }; 163 - static const unsigned int sdxc_clk_a_pins[] = { PIN(GPIOX_8, 0) }; 164 - static const unsigned int sdxc_cmd_a_pins[] = { PIN(GPIOX_9, 0) }; 165 - static const unsigned int pwm_vs_0_pins[] = { PIN(GPIOX_10, 0) }; 166 - static const unsigned int pwm_e_pins[] = { PIN(GPIOX_10, 0) }; 167 - static const unsigned int pwm_vs_1_pins[] = { PIN(GPIOX_11, 0) }; 155 + static const unsigned int sdxc_d0_1_a_pins[] = { GPIOX_0 }; 156 + static const unsigned int sdxc_d13_1_a_pins[] = { GPIOX_1, GPIOX_2, 157 + GPIOX_3 }; 158 + static const unsigned int pcm_out_a_pins[] = { GPIOX_4 }; 159 + static const unsigned int pcm_in_a_pins[] = { GPIOX_5 }; 160 + static const unsigned int pcm_fs_a_pins[] = { GPIOX_6 }; 161 + static const unsigned int pcm_clk_a_pins[] = { GPIOX_7 }; 162 + static const unsigned int sdxc_clk_a_pins[] = { GPIOX_8 }; 163 + static const unsigned int sdxc_cmd_a_pins[] = { GPIOX_9 }; 164 + static const unsigned int pwm_vs_0_pins[] = { GPIOX_10 }; 165 + static const unsigned int pwm_e_pins[] = { GPIOX_10 }; 166 + static const unsigned int pwm_vs_1_pins[] = { GPIOX_11 }; 168 167 169 - static const unsigned int uart_tx_a_pins[] = { PIN(GPIOX_4, 0) }; 170 - static const unsigned int uart_rx_a_pins[] = { PIN(GPIOX_5, 0) }; 171 - static const unsigned int uart_cts_a_pins[] = { PIN(GPIOX_6, 0) }; 172 - static const unsigned int uart_rts_a_pins[] = { PIN(GPIOX_7, 0) }; 173 - static const unsigned int uart_tx_b1_pins[] = { PIN(GPIOX_8, 0) }; 174 - static const unsigned int uart_rx_b1_pins[] = { PIN(GPIOX_9, 0) }; 175 - static const unsigned int uart_cts_b1_pins[] = { PIN(GPIOX_10, 0) }; 176 - static const unsigned int uart_rts_b1_pins[] = { PIN(GPIOX_20, 0) }; 168 + static const unsigned int uart_tx_a_pins[] = { GPIOX_4 }; 169 + static const unsigned int uart_rx_a_pins[] = { GPIOX_5 }; 170 + static const unsigned int uart_cts_a_pins[] = { GPIOX_6 }; 171 + static const unsigned int uart_rts_a_pins[] = { GPIOX_7 }; 172 + static const unsigned int uart_tx_b1_pins[] = { GPIOX_8 }; 173 + static const unsigned int uart_rx_b1_pins[] = { GPIOX_9 }; 174 + static const unsigned int uart_cts_b1_pins[] = { GPIOX_10 }; 175 + static const unsigned int uart_rts_b1_pins[] = { GPIOX_20 }; 177 176 178 - static const unsigned int iso7816_0_clk_pins[] = { PIN(GPIOX_6, 0) }; 179 - static const unsigned int iso7816_0_data_pins[] = { PIN(GPIOX_7, 0) }; 180 - static const unsigned int spi_sclk_0_pins[] = { PIN(GPIOX_8, 0) }; 181 - static const unsigned int spi_miso_0_pins[] = { PIN(GPIOX_9, 0) }; 182 - static const unsigned int spi_mosi_0_pins[] = { PIN(GPIOX_10, 0) }; 183 - static const unsigned int iso7816_det_pins[] = { PIN(GPIOX_16, 0) }; 184 - static const unsigned int iso7816_reset_pins[] = { PIN(GPIOX_17, 0) }; 185 - static const unsigned int iso7816_1_clk_pins[] = { PIN(GPIOX_18, 0) }; 186 - static const unsigned int iso7816_1_data_pins[] = { PIN(GPIOX_19, 0) }; 187 - static const unsigned int spi_ss0_0_pins[] = { PIN(GPIOX_20, 0) }; 177 + static const unsigned int iso7816_0_clk_pins[] = { GPIOX_6 }; 178 + static const unsigned int iso7816_0_data_pins[] = { GPIOX_7 }; 179 + static const unsigned int spi_sclk_0_pins[] = { GPIOX_8 }; 180 + static const unsigned int spi_miso_0_pins[] = { GPIOX_9 }; 181 + static const unsigned int spi_mosi_0_pins[] = { GPIOX_10 }; 182 + static const unsigned int iso7816_det_pins[] = { GPIOX_16 }; 183 + static const unsigned int iso7816_reset_pins[] = { GPIOX_17 }; 184 + static const unsigned int iso7816_1_clk_pins[] = { GPIOX_18 }; 185 + static const unsigned int iso7816_1_data_pins[] = { GPIOX_19 }; 186 + static const unsigned int spi_ss0_0_pins[] = { GPIOX_20 }; 188 187 189 - static const unsigned int tsin_clk_b_pins[] = { PIN(GPIOX_8, 0) }; 190 - static const unsigned int tsin_sop_b_pins[] = { PIN(GPIOX_9, 0) }; 191 - static const unsigned int tsin_d0_b_pins[] = { PIN(GPIOX_10, 0) }; 192 - static const unsigned int pwm_b_pins[] = { PIN(GPIOX_11, 0) }; 193 - static const unsigned int i2c_sda_d0_pins[] = { PIN(GPIOX_16, 0) }; 194 - static const unsigned int i2c_sck_d0_pins[] = { PIN(GPIOX_17, 0) }; 195 - static const unsigned int tsin_d_valid_b_pins[] = { PIN(GPIOX_20, 0) }; 188 + static const unsigned int tsin_clk_b_pins[] = { GPIOX_8 }; 189 + static const unsigned int tsin_sop_b_pins[] = { GPIOX_9 }; 190 + static const unsigned int tsin_d0_b_pins[] = { GPIOX_10 }; 191 + static const unsigned int pwm_b_pins[] = { GPIOX_11 }; 192 + static const unsigned int i2c_sda_d0_pins[] = { GPIOX_16 }; 193 + static const unsigned int i2c_sck_d0_pins[] = { GPIOX_17 }; 194 + static const unsigned int tsin_d_valid_b_pins[] = { GPIOX_20 }; 196 195 197 196 /* bank Y */ 198 - static const unsigned int tsin_d_valid_a_pins[] = { PIN(GPIOY_0, 0) }; 199 - static const unsigned int tsin_sop_a_pins[] = { PIN(GPIOY_1, 0) }; 200 - static const unsigned int tsin_d17_a_pins[] = { PIN(GPIOY_6, 0), PIN(GPIOY_7, 0), 201 - PIN(GPIOY_10, 0), PIN(GPIOY_11, 0), 202 - PIN(GPIOY_12, 0), PIN(GPIOY_13, 0), 203 - PIN(GPIOY_14, 0) }; 204 - static const unsigned int tsin_clk_a_pins[] = { PIN(GPIOY_8, 0) }; 205 - static const unsigned int tsin_d0_a_pins[] = { PIN(GPIOY_9, 0) }; 197 + static const unsigned int tsin_d_valid_a_pins[] = { GPIOY_0 }; 198 + static const unsigned int tsin_sop_a_pins[] = { GPIOY_1 }; 199 + static const unsigned int tsin_d17_a_pins[] = { 200 + GPIOY_6, GPIOY_7, GPIOY_10, GPIOY_11, GPIOY_12, GPIOY_13, GPIOY_14, 201 + }; 202 + static const unsigned int tsin_clk_a_pins[] = { GPIOY_8 }; 203 + static const unsigned int tsin_d0_a_pins[] = { GPIOY_9 }; 206 204 207 - static const unsigned int spdif_out_0_pins[] = { PIN(GPIOY_3, 0) }; 205 + static const unsigned int spdif_out_0_pins[] = { GPIOY_3 }; 208 206 209 - static const unsigned int xtal_24m_pins[] = { PIN(GPIOY_3, 0) }; 210 - static const unsigned int iso7816_2_clk_pins[] = { PIN(GPIOY_13, 0) }; 211 - static const unsigned int iso7816_2_data_pins[] = { PIN(GPIOY_14, 0) }; 207 + static const unsigned int xtal_24m_pins[] = { GPIOY_3 }; 208 + static const unsigned int iso7816_2_clk_pins[] = { GPIOY_13 }; 209 + static const unsigned int iso7816_2_data_pins[] = { GPIOY_14 }; 212 210 213 211 /* bank DV */ 214 - static const unsigned int pwm_d_pins[] = { PIN(GPIODV_28, 0) }; 215 - static const unsigned int pwm_c0_pins[] = { PIN(GPIODV_29, 0) }; 212 + static const unsigned int pwm_d_pins[] = { GPIODV_28 }; 213 + static const unsigned int pwm_c0_pins[] = { GPIODV_29 }; 216 214 217 - static const unsigned int pwm_vs_2_pins[] = { PIN(GPIODV_9, 0) }; 218 - static const unsigned int pwm_vs_3_pins[] = { PIN(GPIODV_28, 0) }; 219 - static const unsigned int pwm_vs_4_pins[] = { PIN(GPIODV_29, 0) }; 215 + static const unsigned int pwm_vs_2_pins[] = { GPIODV_9 }; 216 + static const unsigned int pwm_vs_3_pins[] = { GPIODV_28 }; 217 + static const unsigned int pwm_vs_4_pins[] = { GPIODV_29 }; 220 218 221 - static const unsigned int xtal24_out_pins[] = { PIN(GPIODV_29, 0) }; 219 + static const unsigned int xtal24_out_pins[] = { GPIODV_29 }; 222 220 223 - static const unsigned int uart_tx_c_pins[] = { PIN(GPIODV_24, 0) }; 224 - static const unsigned int uart_rx_c_pins[] = { PIN(GPIODV_25, 0) }; 225 - static const unsigned int uart_cts_c_pins[] = { PIN(GPIODV_26, 0) }; 226 - static const unsigned int uart_rts_c_pins[] = { PIN(GPIODV_27, 0) }; 221 + static const unsigned int uart_tx_c_pins[] = { GPIODV_24 }; 222 + static const unsigned int uart_rx_c_pins[] = { GPIODV_25 }; 223 + static const unsigned int uart_cts_c_pins[] = { GPIODV_26 }; 224 + static const unsigned int uart_rts_c_pins[] = { GPIODV_27 }; 227 225 228 - static const unsigned int pwm_c1_pins[] = { PIN(GPIODV_9, 0) }; 226 + static const unsigned int pwm_c1_pins[] = { GPIODV_9 }; 229 227 230 - static const unsigned int i2c_sda_a_pins[] = { PIN(GPIODV_24, 0) }; 231 - static const unsigned int i2c_sck_a_pins[] = { PIN(GPIODV_25, 0) }; 232 - static const unsigned int i2c_sda_b0_pins[] = { PIN(GPIODV_26, 0) }; 233 - static const unsigned int i2c_sck_b0_pins[] = { PIN(GPIODV_27, 0) }; 234 - static const unsigned int i2c_sda_c0_pins[] = { PIN(GPIODV_28, 0) }; 235 - static const unsigned int i2c_sck_c0_pins[] = { PIN(GPIODV_29, 0) }; 228 + static const unsigned int i2c_sda_a_pins[] = { GPIODV_24 }; 229 + static const unsigned int i2c_sck_a_pins[] = { GPIODV_25 }; 230 + static const unsigned int i2c_sda_b0_pins[] = { GPIODV_26 }; 231 + static const unsigned int i2c_sck_b0_pins[] = { GPIODV_27 }; 232 + static const unsigned int i2c_sda_c0_pins[] = { GPIODV_28 }; 233 + static const unsigned int i2c_sck_c0_pins[] = { GPIODV_29 }; 236 234 237 235 /* bank H */ 238 - static const unsigned int hdmi_hpd_pins[] = { PIN(GPIOH_0, 0) }; 239 - static const unsigned int hdmi_sda_pins[] = { PIN(GPIOH_1, 0) }; 240 - static const unsigned int hdmi_scl_pins[] = { PIN(GPIOH_2, 0) }; 241 - static const unsigned int hdmi_cec_0_pins[] = { PIN(GPIOH_3, 0) }; 242 - static const unsigned int eth_txd1_0_pins[] = { PIN(GPIOH_5, 0) }; 243 - static const unsigned int eth_txd0_0_pins[] = { PIN(GPIOH_6, 0) }; 244 - static const unsigned int clk_24m_out_pins[] = { PIN(GPIOH_9, 0) }; 236 + static const unsigned int hdmi_hpd_pins[] = { GPIOH_0 }; 237 + static const unsigned int hdmi_sda_pins[] = { GPIOH_1 }; 238 + static const unsigned int hdmi_scl_pins[] = { GPIOH_2 }; 239 + static const unsigned int hdmi_cec_0_pins[] = { GPIOH_3 }; 240 + static const unsigned int eth_txd1_0_pins[] = { GPIOH_5 }; 241 + static const unsigned int eth_txd0_0_pins[] = { GPIOH_6 }; 242 + static const unsigned int clk_24m_out_pins[] = { GPIOH_9 }; 245 243 246 - static const unsigned int spi_ss1_pins[] = { PIN(GPIOH_0, 0) }; 247 - static const unsigned int spi_ss2_pins[] = { PIN(GPIOH_1, 0) }; 248 - static const unsigned int spi_ss0_1_pins[] = { PIN(GPIOH_3, 0) }; 249 - static const unsigned int spi_miso_1_pins[] = { PIN(GPIOH_4, 0) }; 250 - static const unsigned int spi_mosi_1_pins[] = { PIN(GPIOH_5, 0) }; 251 - static const unsigned int spi_sclk_1_pins[] = { PIN(GPIOH_6, 0) }; 244 + static const unsigned int spi_ss1_pins[] = { GPIOH_0 }; 245 + static const unsigned int spi_ss2_pins[] = { GPIOH_1 }; 246 + static const unsigned int spi_ss0_1_pins[] = { GPIOH_3 }; 247 + static const unsigned int spi_miso_1_pins[] = { GPIOH_4 }; 248 + static const unsigned int spi_mosi_1_pins[] = { GPIOH_5 }; 249 + static const unsigned int spi_sclk_1_pins[] = { GPIOH_6 }; 252 250 253 - static const unsigned int eth_txd3_pins[] = { PIN(GPIOH_7, 0) }; 254 - static const unsigned int eth_txd2_pins[] = { PIN(GPIOH_8, 0) }; 255 - static const unsigned int eth_tx_clk_pins[] = { PIN(GPIOH_9, 0) }; 251 + static const unsigned int eth_txd3_pins[] = { GPIOH_7 }; 252 + static const unsigned int eth_txd2_pins[] = { GPIOH_8 }; 253 + static const unsigned int eth_tx_clk_pins[] = { GPIOH_9 }; 256 254 257 - static const unsigned int i2c_sda_b1_pins[] = { PIN(GPIOH_3, 0) }; 258 - static const unsigned int i2c_sck_b1_pins[] = { PIN(GPIOH_4, 0) }; 259 - static const unsigned int i2c_sda_c1_pins[] = { PIN(GPIOH_5, 0) }; 260 - static const unsigned int i2c_sck_c1_pins[] = { PIN(GPIOH_6, 0) }; 261 - static const unsigned int i2c_sda_d1_pins[] = { PIN(GPIOH_7, 0) }; 262 - static const unsigned int i2c_sck_d1_pins[] = { PIN(GPIOH_8, 0) }; 255 + static const unsigned int i2c_sda_b1_pins[] = { GPIOH_3 }; 256 + static const unsigned int i2c_sck_b1_pins[] = { GPIOH_4 }; 257 + static const unsigned int i2c_sda_c1_pins[] = { GPIOH_5 }; 258 + static const unsigned int i2c_sck_c1_pins[] = { GPIOH_6 }; 259 + static const unsigned int i2c_sda_d1_pins[] = { GPIOH_7 }; 260 + static const unsigned int i2c_sck_d1_pins[] = { GPIOH_8 }; 263 261 264 262 /* bank BOOT */ 265 - static const unsigned int nand_io_pins[] = { PIN(BOOT_0, 0), PIN(BOOT_1, 0), 266 - PIN(BOOT_2, 0), PIN(BOOT_3, 0), 267 - PIN(BOOT_4, 0), PIN(BOOT_5, 0), 268 - PIN(BOOT_6, 0), PIN(BOOT_7, 0) }; 269 - static const unsigned int nand_io_ce0_pins[] = { PIN(BOOT_8, 0) }; 270 - static const unsigned int nand_io_ce1_pins[] = { PIN(BOOT_9, 0) }; 271 - static const unsigned int nand_io_rb0_pins[] = { PIN(BOOT_10, 0) }; 272 - static const unsigned int nand_ale_pins[] = { PIN(BOOT_11, 0) }; 273 - static const unsigned int nand_cle_pins[] = { PIN(BOOT_12, 0) }; 274 - static const unsigned int nand_wen_clk_pins[] = { PIN(BOOT_13, 0) }; 275 - static const unsigned int nand_ren_clk_pins[] = { PIN(BOOT_14, 0) }; 276 - static const unsigned int nand_dqs_15_pins[] = { PIN(BOOT_15, 0) }; 277 - static const unsigned int nand_dqs_18_pins[] = { PIN(BOOT_18, 0) }; 263 + static const unsigned int nand_io_pins[] = { 264 + BOOT_0, BOOT_1, BOOT_2, BOOT_3, BOOT_4, BOOT_5, BOOT_6, BOOT_7 265 + }; 266 + static const unsigned int nand_io_ce0_pins[] = { BOOT_8 }; 267 + static const unsigned int nand_io_ce1_pins[] = { BOOT_9 }; 268 + static const unsigned int nand_io_rb0_pins[] = { BOOT_10 }; 269 + static const unsigned int nand_ale_pins[] = { BOOT_11 }; 270 + static const unsigned int nand_cle_pins[] = { BOOT_12 }; 271 + static const unsigned int nand_wen_clk_pins[] = { BOOT_13 }; 272 + static const unsigned int nand_ren_clk_pins[] = { BOOT_14 }; 273 + static const unsigned int nand_dqs_15_pins[] = { BOOT_15 }; 274 + static const unsigned int nand_dqs_18_pins[] = { BOOT_18 }; 278 275 279 - static const unsigned int sdxc_d0_c_pins[] = { PIN(BOOT_0, 0)}; 280 - static const unsigned int sdxc_d13_c_pins[] = { PIN(BOOT_1, 0), PIN(BOOT_2, 0), 281 - PIN(BOOT_3, 0) }; 282 - static const unsigned int sdxc_d47_c_pins[] = { PIN(BOOT_4, 0), PIN(BOOT_5, 0), 283 - PIN(BOOT_6, 0), PIN(BOOT_7, 0) }; 284 - static const unsigned int sdxc_clk_c_pins[] = { PIN(BOOT_8, 0) }; 285 - static const unsigned int sdxc_cmd_c_pins[] = { PIN(BOOT_10, 0) }; 286 - static const unsigned int nor_d_pins[] = { PIN(BOOT_11, 0) }; 287 - static const unsigned int nor_q_pins[] = { PIN(BOOT_12, 0) }; 288 - static const unsigned int nor_c_pins[] = { PIN(BOOT_13, 0) }; 289 - static const unsigned int nor_cs_pins[] = { PIN(BOOT_18, 0) }; 276 + static const unsigned int sdxc_d0_c_pins[] = { BOOT_0}; 277 + static const unsigned int sdxc_d13_c_pins[] = { BOOT_1, BOOT_2, 278 + BOOT_3 }; 279 + static const unsigned int sdxc_d47_c_pins[] = { BOOT_4, BOOT_5, 280 + BOOT_6, BOOT_7 }; 281 + static const unsigned int sdxc_clk_c_pins[] = { BOOT_8 }; 282 + static const unsigned int sdxc_cmd_c_pins[] = { BOOT_10 }; 283 + static const unsigned int nor_d_pins[] = { BOOT_11 }; 284 + static const unsigned int nor_q_pins[] = { BOOT_12 }; 285 + static const unsigned int nor_c_pins[] = { BOOT_13 }; 286 + static const unsigned int nor_cs_pins[] = { BOOT_18 }; 290 287 291 - static const unsigned int sd_d0_c_pins[] = { PIN(BOOT_0, 0) }; 292 - static const unsigned int sd_d1_c_pins[] = { PIN(BOOT_1, 0) }; 293 - static const unsigned int sd_d2_c_pins[] = { PIN(BOOT_2, 0) }; 294 - static const unsigned int sd_d3_c_pins[] = { PIN(BOOT_3, 0) }; 295 - static const unsigned int sd_cmd_c_pins[] = { PIN(BOOT_8, 0) }; 296 - static const unsigned int sd_clk_c_pins[] = { PIN(BOOT_10, 0) }; 288 + static const unsigned int sd_d0_c_pins[] = { BOOT_0 }; 289 + static const unsigned int sd_d1_c_pins[] = { BOOT_1 }; 290 + static const unsigned int sd_d2_c_pins[] = { BOOT_2 }; 291 + static const unsigned int sd_d3_c_pins[] = { BOOT_3 }; 292 + static const unsigned int sd_cmd_c_pins[] = { BOOT_8 }; 293 + static const unsigned int sd_clk_c_pins[] = { BOOT_10 }; 297 294 298 295 /* bank CARD */ 299 - static const unsigned int sd_d1_b_pins[] = { PIN(CARD_0, 0) }; 300 - static const unsigned int sd_d0_b_pins[] = { PIN(CARD_1, 0) }; 301 - static const unsigned int sd_clk_b_pins[] = { PIN(CARD_2, 0) }; 302 - static const unsigned int sd_cmd_b_pins[] = { PIN(CARD_3, 0) }; 303 - static const unsigned int sd_d3_b_pins[] = { PIN(CARD_4, 0) }; 304 - static const unsigned int sd_d2_b_pins[] = { PIN(CARD_5, 0) }; 296 + static const unsigned int sd_d1_b_pins[] = { CARD_0 }; 297 + static const unsigned int sd_d0_b_pins[] = { CARD_1 }; 298 + static const unsigned int sd_clk_b_pins[] = { CARD_2 }; 299 + static const unsigned int sd_cmd_b_pins[] = { CARD_3 }; 300 + static const unsigned int sd_d3_b_pins[] = { CARD_4 }; 301 + static const unsigned int sd_d2_b_pins[] = { CARD_5 }; 305 302 306 - static const unsigned int sdxc_d13_b_pins[] = { PIN(CARD_0, 0), PIN(CARD_4, 0), 307 - PIN(CARD_5, 0) }; 308 - static const unsigned int sdxc_d0_b_pins[] = { PIN(CARD_1, 0) }; 309 - static const unsigned int sdxc_clk_b_pins[] = { PIN(CARD_2, 0) }; 310 - static const unsigned int sdxc_cmd_b_pins[] = { PIN(CARD_3, 0) }; 303 + static const unsigned int sdxc_d13_b_pins[] = { CARD_0, CARD_4, 304 + CARD_5 }; 305 + static const unsigned int sdxc_d0_b_pins[] = { CARD_1 }; 306 + static const unsigned int sdxc_clk_b_pins[] = { CARD_2 }; 307 + static const unsigned int sdxc_cmd_b_pins[] = { CARD_3 }; 311 308 312 309 /* bank AO */ 313 - static const unsigned int uart_tx_ao_a_pins[] = { PIN(GPIOAO_0, AO_OFF) }; 314 - static const unsigned int uart_rx_ao_a_pins[] = { PIN(GPIOAO_1, AO_OFF) }; 315 - static const unsigned int uart_cts_ao_a_pins[] = { PIN(GPIOAO_2, AO_OFF) }; 316 - static const unsigned int uart_rts_ao_a_pins[] = { PIN(GPIOAO_3, AO_OFF) }; 317 - static const unsigned int i2c_mst_sck_ao_pins[] = { PIN(GPIOAO_4, AO_OFF) }; 318 - static const unsigned int i2c_mst_sda_ao_pins[] = { PIN(GPIOAO_5, AO_OFF) }; 319 - static const unsigned int clk_32k_in_out_pins[] = { PIN(GPIOAO_6, AO_OFF) }; 320 - static const unsigned int remote_input_pins[] = { PIN(GPIOAO_7, AO_OFF) }; 321 - static const unsigned int hdmi_cec_1_pins[] = { PIN(GPIOAO_12, AO_OFF) }; 322 - static const unsigned int ir_blaster_pins[] = { PIN(GPIOAO_13, AO_OFF) }; 310 + static const unsigned int uart_tx_ao_a_pins[] = { GPIOAO_0 }; 311 + static const unsigned int uart_rx_ao_a_pins[] = { GPIOAO_1 }; 312 + static const unsigned int uart_cts_ao_a_pins[] = { GPIOAO_2 }; 313 + static const unsigned int uart_rts_ao_a_pins[] = { GPIOAO_3 }; 314 + static const unsigned int i2c_mst_sck_ao_pins[] = { GPIOAO_4 }; 315 + static const unsigned int i2c_mst_sda_ao_pins[] = { GPIOAO_5 }; 316 + static const unsigned int clk_32k_in_out_pins[] = { GPIOAO_6 }; 317 + static const unsigned int remote_input_pins[] = { GPIOAO_7 }; 318 + static const unsigned int hdmi_cec_1_pins[] = { GPIOAO_12 }; 319 + static const unsigned int ir_blaster_pins[] = { GPIOAO_13 }; 323 320 324 - static const unsigned int pwm_c2_pins[] = { PIN(GPIOAO_3, AO_OFF) }; 325 - static const unsigned int i2c_sck_ao_pins[] = { PIN(GPIOAO_4, AO_OFF) }; 326 - static const unsigned int i2c_sda_ao_pins[] = { PIN(GPIOAO_5, AO_OFF) }; 327 - static const unsigned int ir_remote_out_pins[] = { PIN(GPIOAO_7, AO_OFF) }; 328 - static const unsigned int i2s_am_clk_out_pins[] = { PIN(GPIOAO_8, AO_OFF) }; 329 - static const unsigned int i2s_ao_clk_out_pins[] = { PIN(GPIOAO_9, AO_OFF) }; 330 - static const unsigned int i2s_lr_clk_out_pins[] = { PIN(GPIOAO_10, AO_OFF) }; 331 - static const unsigned int i2s_out_01_pins[] = { PIN(GPIOAO_11, AO_OFF) }; 321 + static const unsigned int pwm_c2_pins[] = { GPIOAO_3 }; 322 + static const unsigned int i2c_sck_ao_pins[] = { GPIOAO_4 }; 323 + static const unsigned int i2c_sda_ao_pins[] = { GPIOAO_5 }; 324 + static const unsigned int ir_remote_out_pins[] = { GPIOAO_7 }; 325 + static const unsigned int i2s_am_clk_out_pins[] = { GPIOAO_8 }; 326 + static const unsigned int i2s_ao_clk_out_pins[] = { GPIOAO_9 }; 327 + static const unsigned int i2s_lr_clk_out_pins[] = { GPIOAO_10 }; 328 + static const unsigned int i2s_out_01_pins[] = { GPIOAO_11 }; 332 329 333 - static const unsigned int uart_tx_ao_b0_pins[] = { PIN(GPIOAO_0, AO_OFF) }; 334 - static const unsigned int uart_rx_ao_b0_pins[] = { PIN(GPIOAO_1, AO_OFF) }; 335 - static const unsigned int uart_cts_ao_b_pins[] = { PIN(GPIOAO_2, AO_OFF) }; 336 - static const unsigned int uart_rts_ao_b_pins[] = { PIN(GPIOAO_3, AO_OFF) }; 337 - static const unsigned int uart_tx_ao_b1_pins[] = { PIN(GPIOAO_4, AO_OFF) }; 338 - static const unsigned int uart_rx_ao_b1_pins[] = { PIN(GPIOAO_5, AO_OFF) }; 339 - static const unsigned int spdif_out_1_pins[] = { PIN(GPIOAO_6, AO_OFF) }; 330 + static const unsigned int uart_tx_ao_b0_pins[] = { GPIOAO_0 }; 331 + static const unsigned int uart_rx_ao_b0_pins[] = { GPIOAO_1 }; 332 + static const unsigned int uart_cts_ao_b_pins[] = { GPIOAO_2 }; 333 + static const unsigned int uart_rts_ao_b_pins[] = { GPIOAO_3 }; 334 + static const unsigned int uart_tx_ao_b1_pins[] = { GPIOAO_4 }; 335 + static const unsigned int uart_rx_ao_b1_pins[] = { GPIOAO_5 }; 336 + static const unsigned int spdif_out_1_pins[] = { GPIOAO_6 }; 340 337 341 - static const unsigned int i2s_in_ch01_pins[] = { PIN(GPIOAO_6, AO_OFF) }; 342 - static const unsigned int i2s_ao_clk_in_pins[] = { PIN(GPIOAO_9, AO_OFF) }; 343 - static const unsigned int i2s_lr_clk_in_pins[] = { PIN(GPIOAO_10, AO_OFF) }; 338 + static const unsigned int i2s_in_ch01_pins[] = { GPIOAO_6 }; 339 + static const unsigned int i2s_ao_clk_in_pins[] = { GPIOAO_9 }; 340 + static const unsigned int i2s_lr_clk_in_pins[] = { GPIOAO_10 }; 344 341 345 342 /* bank DIF */ 346 - static const unsigned int eth_rxd1_pins[] = { PIN(DIF_0_P, 0) }; 347 - static const unsigned int eth_rxd0_pins[] = { PIN(DIF_0_N, 0) }; 348 - static const unsigned int eth_rx_dv_pins[] = { PIN(DIF_1_P, 0) }; 349 - static const unsigned int eth_rx_clk_pins[] = { PIN(DIF_1_N, 0) }; 350 - static const unsigned int eth_txd0_1_pins[] = { PIN(DIF_2_P, 0) }; 351 - static const unsigned int eth_txd1_1_pins[] = { PIN(DIF_2_N, 0) }; 352 - static const unsigned int eth_tx_en_pins[] = { PIN(DIF_3_P, 0) }; 353 - static const unsigned int eth_ref_clk_pins[] = { PIN(DIF_3_N, 0) }; 354 - static const unsigned int eth_mdc_pins[] = { PIN(DIF_4_P, 0) }; 355 - static const unsigned int eth_mdio_en_pins[] = { PIN(DIF_4_N, 0) }; 343 + static const unsigned int eth_rxd1_pins[] = { DIF_0_P }; 344 + static const unsigned int eth_rxd0_pins[] = { DIF_0_N }; 345 + static const unsigned int eth_rx_dv_pins[] = { DIF_1_P }; 346 + static const unsigned int eth_rx_clk_pins[] = { DIF_1_N }; 347 + static const unsigned int eth_txd0_1_pins[] = { DIF_2_P }; 348 + static const unsigned int eth_txd1_1_pins[] = { DIF_2_N }; 349 + static const unsigned int eth_tx_en_pins[] = { DIF_3_P }; 350 + static const unsigned int eth_ref_clk_pins[] = { DIF_3_N }; 351 + static const unsigned int eth_mdc_pins[] = { DIF_4_P }; 352 + static const unsigned int eth_mdio_en_pins[] = { DIF_4_N }; 356 353 357 354 static struct meson_pmx_group meson8b_cbus_groups[] = { 358 - GPIO_GROUP(GPIOX_0, 0), 359 - GPIO_GROUP(GPIOX_1, 0), 360 - GPIO_GROUP(GPIOX_2, 0), 361 - GPIO_GROUP(GPIOX_3, 0), 362 - GPIO_GROUP(GPIOX_4, 0), 363 - GPIO_GROUP(GPIOX_5, 0), 364 - GPIO_GROUP(GPIOX_6, 0), 365 - GPIO_GROUP(GPIOX_7, 0), 366 - GPIO_GROUP(GPIOX_8, 0), 367 - GPIO_GROUP(GPIOX_9, 0), 368 - GPIO_GROUP(GPIOX_10, 0), 369 - GPIO_GROUP(GPIOX_11, 0), 370 - GPIO_GROUP(GPIOX_16, 0), 371 - GPIO_GROUP(GPIOX_17, 0), 372 - GPIO_GROUP(GPIOX_18, 0), 373 - GPIO_GROUP(GPIOX_19, 0), 374 - GPIO_GROUP(GPIOX_20, 0), 375 - GPIO_GROUP(GPIOX_21, 0), 355 + GPIO_GROUP(GPIOX_0), 356 + GPIO_GROUP(GPIOX_1), 357 + GPIO_GROUP(GPIOX_2), 358 + GPIO_GROUP(GPIOX_3), 359 + GPIO_GROUP(GPIOX_4), 360 + GPIO_GROUP(GPIOX_5), 361 + GPIO_GROUP(GPIOX_6), 362 + GPIO_GROUP(GPIOX_7), 363 + GPIO_GROUP(GPIOX_8), 364 + GPIO_GROUP(GPIOX_9), 365 + GPIO_GROUP(GPIOX_10), 366 + GPIO_GROUP(GPIOX_11), 367 + GPIO_GROUP(GPIOX_16), 368 + GPIO_GROUP(GPIOX_17), 369 + GPIO_GROUP(GPIOX_18), 370 + GPIO_GROUP(GPIOX_19), 371 + GPIO_GROUP(GPIOX_20), 372 + GPIO_GROUP(GPIOX_21), 376 373 377 - GPIO_GROUP(GPIOY_0, 0), 378 - GPIO_GROUP(GPIOY_1, 0), 379 - GPIO_GROUP(GPIOY_3, 0), 380 - GPIO_GROUP(GPIOY_6, 0), 381 - GPIO_GROUP(GPIOY_7, 0), 382 - GPIO_GROUP(GPIOY_8, 0), 383 - GPIO_GROUP(GPIOY_9, 0), 384 - GPIO_GROUP(GPIOY_10, 0), 385 - GPIO_GROUP(GPIOY_11, 0), 386 - GPIO_GROUP(GPIOY_12, 0), 387 - GPIO_GROUP(GPIOY_13, 0), 388 - GPIO_GROUP(GPIOY_14, 0), 374 + GPIO_GROUP(GPIOY_0), 375 + GPIO_GROUP(GPIOY_1), 376 + GPIO_GROUP(GPIOY_3), 377 + GPIO_GROUP(GPIOY_6), 378 + GPIO_GROUP(GPIOY_7), 379 + GPIO_GROUP(GPIOY_8), 380 + GPIO_GROUP(GPIOY_9), 381 + GPIO_GROUP(GPIOY_10), 382 + GPIO_GROUP(GPIOY_11), 383 + GPIO_GROUP(GPIOY_12), 384 + GPIO_GROUP(GPIOY_13), 385 + GPIO_GROUP(GPIOY_14), 389 386 390 - GPIO_GROUP(GPIODV_9, 0), 391 - GPIO_GROUP(GPIODV_24, 0), 392 - GPIO_GROUP(GPIODV_25, 0), 393 - GPIO_GROUP(GPIODV_26, 0), 394 - GPIO_GROUP(GPIODV_27, 0), 395 - GPIO_GROUP(GPIODV_28, 0), 396 - GPIO_GROUP(GPIODV_29, 0), 387 + GPIO_GROUP(GPIODV_9), 388 + GPIO_GROUP(GPIODV_24), 389 + GPIO_GROUP(GPIODV_25), 390 + GPIO_GROUP(GPIODV_26), 391 + GPIO_GROUP(GPIODV_27), 392 + GPIO_GROUP(GPIODV_28), 393 + GPIO_GROUP(GPIODV_29), 397 394 398 - GPIO_GROUP(GPIOH_0, 0), 399 - GPIO_GROUP(GPIOH_1, 0), 400 - GPIO_GROUP(GPIOH_2, 0), 401 - GPIO_GROUP(GPIOH_3, 0), 402 - GPIO_GROUP(GPIOH_4, 0), 403 - GPIO_GROUP(GPIOH_5, 0), 404 - GPIO_GROUP(GPIOH_6, 0), 405 - GPIO_GROUP(GPIOH_7, 0), 406 - GPIO_GROUP(GPIOH_8, 0), 407 - GPIO_GROUP(GPIOH_9, 0), 395 + GPIO_GROUP(GPIOH_0), 396 + GPIO_GROUP(GPIOH_1), 397 + GPIO_GROUP(GPIOH_2), 398 + GPIO_GROUP(GPIOH_3), 399 + GPIO_GROUP(GPIOH_4), 400 + GPIO_GROUP(GPIOH_5), 401 + GPIO_GROUP(GPIOH_6), 402 + GPIO_GROUP(GPIOH_7), 403 + GPIO_GROUP(GPIOH_8), 404 + GPIO_GROUP(GPIOH_9), 408 405 409 - GPIO_GROUP(DIF_0_P, 0), 410 - GPIO_GROUP(DIF_0_N, 0), 411 - GPIO_GROUP(DIF_1_P, 0), 412 - GPIO_GROUP(DIF_1_N, 0), 413 - GPIO_GROUP(DIF_2_P, 0), 414 - GPIO_GROUP(DIF_2_N, 0), 415 - GPIO_GROUP(DIF_3_P, 0), 416 - GPIO_GROUP(DIF_3_N, 0), 417 - GPIO_GROUP(DIF_4_P, 0), 418 - GPIO_GROUP(DIF_4_N, 0), 406 + GPIO_GROUP(DIF_0_P), 407 + GPIO_GROUP(DIF_0_N), 408 + GPIO_GROUP(DIF_1_P), 409 + GPIO_GROUP(DIF_1_N), 410 + GPIO_GROUP(DIF_2_P), 411 + GPIO_GROUP(DIF_2_N), 412 + GPIO_GROUP(DIF_3_P), 413 + GPIO_GROUP(DIF_3_N), 414 + GPIO_GROUP(DIF_4_P), 415 + GPIO_GROUP(DIF_4_N), 419 416 420 417 /* bank X */ 421 418 GROUP(sd_d0_a, 8, 5), ··· 574 577 }; 575 578 576 579 static struct meson_pmx_group meson8b_aobus_groups[] = { 577 - GPIO_GROUP(GPIOAO_0, AO_OFF), 578 - GPIO_GROUP(GPIOAO_1, AO_OFF), 579 - GPIO_GROUP(GPIOAO_2, AO_OFF), 580 - GPIO_GROUP(GPIOAO_3, AO_OFF), 581 - GPIO_GROUP(GPIOAO_4, AO_OFF), 582 - GPIO_GROUP(GPIOAO_5, AO_OFF), 583 - GPIO_GROUP(GPIOAO_6, AO_OFF), 584 - GPIO_GROUP(GPIOAO_7, AO_OFF), 585 - GPIO_GROUP(GPIOAO_8, AO_OFF), 586 - GPIO_GROUP(GPIOAO_9, AO_OFF), 587 - GPIO_GROUP(GPIOAO_10, AO_OFF), 588 - GPIO_GROUP(GPIOAO_11, AO_OFF), 589 - GPIO_GROUP(GPIOAO_12, AO_OFF), 590 - GPIO_GROUP(GPIOAO_13, AO_OFF), 591 - GPIO_GROUP(GPIO_BSD_EN, AO_OFF), 592 - GPIO_GROUP(GPIO_TEST_N, AO_OFF), 580 + GPIO_GROUP(GPIOAO_0), 581 + GPIO_GROUP(GPIOAO_1), 582 + GPIO_GROUP(GPIOAO_2), 583 + GPIO_GROUP(GPIOAO_3), 584 + GPIO_GROUP(GPIOAO_4), 585 + GPIO_GROUP(GPIOAO_5), 586 + GPIO_GROUP(GPIOAO_6), 587 + GPIO_GROUP(GPIOAO_7), 588 + GPIO_GROUP(GPIOAO_8), 589 + GPIO_GROUP(GPIOAO_9), 590 + GPIO_GROUP(GPIOAO_10), 591 + GPIO_GROUP(GPIOAO_11), 592 + GPIO_GROUP(GPIOAO_12), 593 + GPIO_GROUP(GPIOAO_13), 594 + GPIO_GROUP(GPIO_BSD_EN), 595 + GPIO_GROUP(GPIO_TEST_N), 593 596 594 597 /* bank AO */ 595 598 GROUP(uart_tx_ao_a, 0, 12), ··· 884 887 }; 885 888 886 889 static struct meson_bank meson8b_cbus_banks[] = { 887 - /* name first last irq pullen pull dir out in */ 888 - BANK("X", PIN(GPIOX_0, 0), PIN(GPIOX_21, 0), 97, 118, 4, 0, 4, 0, 0, 0, 1, 0, 2, 0), 889 - BANK("Y", PIN(GPIOY_0, 0), PIN(GPIOY_14, 0), 80, 96, 3, 0, 3, 0, 3, 0, 4, 0, 5, 0), 890 - BANK("DV", PIN(GPIODV_9, 0), PIN(GPIODV_29, 0), 59, 79, 0, 0, 0, 0, 7, 0, 8, 0, 9, 0), 891 - BANK("H", PIN(GPIOH_0, 0), PIN(GPIOH_9, 0), 14, 23, 1, 16, 1, 16, 9, 19, 10, 19, 11, 19), 892 - BANK("CARD", PIN(CARD_0, 0), PIN(CARD_6, 0), 43, 49, 2, 20, 2, 20, 0, 22, 1, 22, 2, 22), 893 - BANK("BOOT", PIN(BOOT_0, 0), PIN(BOOT_18, 0), 24, 42, 2, 0, 2, 0, 9, 0, 10, 0, 11, 0), 890 + /* name first last irq pullen pull dir out in */ 891 + BANK("X", GPIOX_0, GPIOX_21, 97, 118, 4, 0, 4, 0, 0, 0, 1, 0, 2, 0), 892 + BANK("Y", GPIOY_0, GPIOY_14, 80, 96, 3, 0, 3, 0, 3, 0, 4, 0, 5, 0), 893 + BANK("DV", GPIODV_9, GPIODV_29, 59, 79, 0, 0, 0, 0, 7, 0, 8, 0, 9, 0), 894 + BANK("H", GPIOH_0, GPIOH_9, 14, 23, 1, 16, 1, 16, 9, 19, 10, 19, 11, 19), 895 + BANK("CARD", CARD_0, CARD_6, 43, 49, 2, 20, 2, 20, 0, 22, 1, 22, 2, 22), 896 + BANK("BOOT", BOOT_0, BOOT_18, 24, 42, 2, 0, 2, 0, 9, 0, 10, 0, 11, 0), 894 897 895 898 /* 896 899 * The following bank is not mentionned in the public datasheet 897 900 * There is no information whether it can be used with the gpio 898 901 * interrupt controller 899 902 */ 900 - BANK("DIF", PIN(DIF_0_P, 0), PIN(DIF_4_N, 0), -1, -1, 5, 8, 5, 8, 12, 12, 13, 12, 14, 12), 903 + BANK("DIF", DIF_0_P, DIF_4_N, -1, -1, 5, 8, 5, 8, 12, 12, 13, 12, 14, 12), 901 904 }; 902 905 903 906 static struct meson_bank meson8b_aobus_banks[] = { 904 - /* name first last irq pullen pull dir out in */ 905 - BANK("AO", PIN(GPIOAO_0, AO_OFF), PIN(GPIO_TEST_N, AO_OFF), 0, 13, 0, 0, 0, 16, 0, 0, 0, 16, 1, 0), 907 + /* name first lastc irq pullen pull dir out in */ 908 + BANK("AO", GPIOAO_0, GPIO_TEST_N, 0, 13, 0, 0, 0, 16, 0, 0, 0, 16, 1, 0), 906 909 }; 907 910 908 - struct meson_pinctrl_data meson8b_cbus_pinctrl_data = { 911 + static struct meson_pinctrl_data meson8b_cbus_pinctrl_data = { 909 912 .name = "cbus-banks", 910 - .pin_base = 0, 911 913 .pins = meson8b_cbus_pins, 912 914 .groups = meson8b_cbus_groups, 913 915 .funcs = meson8b_cbus_functions, ··· 915 919 .num_groups = ARRAY_SIZE(meson8b_cbus_groups), 916 920 .num_funcs = ARRAY_SIZE(meson8b_cbus_functions), 917 921 .num_banks = ARRAY_SIZE(meson8b_cbus_banks), 922 + .pmx_ops = &meson8_pmx_ops, 918 923 }; 919 924 920 - struct meson_pinctrl_data meson8b_aobus_pinctrl_data = { 925 + static struct meson_pinctrl_data meson8b_aobus_pinctrl_data = { 921 926 .name = "aobus-banks", 922 - .pin_base = 130, 923 927 .pins = meson8b_aobus_pins, 924 928 .groups = meson8b_aobus_groups, 925 929 .funcs = meson8b_aobus_functions, ··· 928 932 .num_groups = ARRAY_SIZE(meson8b_aobus_groups), 929 933 .num_funcs = ARRAY_SIZE(meson8b_aobus_functions), 930 934 .num_banks = ARRAY_SIZE(meson8b_aobus_banks), 935 + .pmx_ops = &meson8_pmx_ops, 931 936 }; 937 + 938 + static const struct of_device_id meson8b_pinctrl_dt_match[] = { 939 + { 940 + .compatible = "amlogic,meson8b-cbus-pinctrl", 941 + .data = &meson8b_cbus_pinctrl_data, 942 + }, 943 + { 944 + .compatible = "amlogic,meson8b-aobus-pinctrl", 945 + .data = &meson8b_aobus_pinctrl_data, 946 + }, 947 + { }, 948 + }; 949 + 950 + static struct platform_driver meson8b_pinctrl_driver = { 951 + .probe = meson_pinctrl_probe, 952 + .driver = { 953 + .name = "meson8b-pinctrl", 954 + .of_match_table = meson8b_pinctrl_dt_match, 955 + }, 956 + }; 957 + builtin_platform_driver(meson8b_pinctrl_driver);
+64
drivers/pinctrl/mvebu/pinctrl-armada-37xx.c
··· 576 576 case IRQ_TYPE_EDGE_FALLING: 577 577 val |= (BIT(d->hwirq % GPIO_PER_REG)); 578 578 break; 579 + case IRQ_TYPE_EDGE_BOTH: { 580 + u32 in_val, in_reg = INPUT_VAL; 581 + 582 + armada_37xx_irq_update_reg(&in_reg, d); 583 + regmap_read(info->regmap, in_reg, &in_val); 584 + 585 + /* Set initial polarity based on current input level. */ 586 + if (in_val & d->mask) 587 + val |= d->mask; /* falling */ 588 + else 589 + val &= ~d->mask; /* rising */ 590 + break; 591 + } 579 592 default: 580 593 spin_unlock_irqrestore(&info->irq_lock, flags); 581 594 return -EINVAL; ··· 599 586 return 0; 600 587 } 601 588 589 + static int armada_37xx_edge_both_irq_swap_pol(struct armada_37xx_pinctrl *info, 590 + u32 pin_idx) 591 + { 592 + u32 reg_idx = pin_idx / GPIO_PER_REG; 593 + u32 bit_num = pin_idx % GPIO_PER_REG; 594 + u32 p, l, ret; 595 + unsigned long flags; 596 + 597 + regmap_read(info->regmap, INPUT_VAL + 4*reg_idx, &l); 598 + 599 + spin_lock_irqsave(&info->irq_lock, flags); 600 + p = readl(info->base + IRQ_POL + 4 * reg_idx); 601 + if ((p ^ l) & (1 << bit_num)) { 602 + /* 603 + * For the gpios which are used for both-edge irqs, when their 604 + * interrupts happen, their input levels are changed, 605 + * yet their interrupt polarities are kept in old values, we 606 + * should synchronize their interrupt polarities; for example, 607 + * at first a gpio's input level is low and its interrupt 608 + * polarity control is "Detect rising edge", then the gpio has 609 + * a interrupt , its level turns to high, we should change its 610 + * polarity control to "Detect falling edge" correspondingly. 611 + */ 612 + p ^= 1 << bit_num; 613 + writel(p, info->base + IRQ_POL + 4 * reg_idx); 614 + ret = 0; 615 + } else { 616 + /* Spurious irq */ 617 + ret = -1; 618 + } 619 + 620 + spin_unlock_irqrestore(&info->irq_lock, flags); 621 + return ret; 622 + } 602 623 603 624 static void armada_37xx_irq_handler(struct irq_desc *desc) 604 625 { ··· 656 609 u32 hwirq = ffs(status) - 1; 657 610 u32 virq = irq_find_mapping(d, hwirq + 658 611 i * GPIO_PER_REG); 612 + u32 t = irq_get_trigger_type(virq); 613 + 614 + if ((t & IRQ_TYPE_SENSE_MASK) == IRQ_TYPE_EDGE_BOTH) { 615 + /* Swap polarity (race with GPIO line) */ 616 + if (armada_37xx_edge_both_irq_swap_pol(info, 617 + hwirq + i * GPIO_PER_REG)) { 618 + /* 619 + * For spurious irq, which gpio level 620 + * is not as expected after incoming 621 + * edge, just ack the gpio irq. 622 + */ 623 + writel(1 << hwirq, 624 + info->base + 625 + IRQ_STATUS + 4 * i); 626 + continue; 627 + } 628 + } 659 629 660 630 generic_handle_irq(virq); 661 631
+2
drivers/pinctrl/pinconf-generic.c
··· 49 49 PCONFDUMP(PIN_CONFIG_POWER_SOURCE, "pin power source", "selector", true), 50 50 PCONFDUMP(PIN_CONFIG_SLEEP_HARDWARE_STATE, "sleep hardware state", NULL, false), 51 51 PCONFDUMP(PIN_CONFIG_SLEW_RATE, "slew rate", NULL, true), 52 + PCONFDUMP(PIN_CONFIG_SKEW_DELAY, "skew delay", NULL, true), 52 53 }; 53 54 54 55 static void pinconf_generic_dump_one(struct pinctrl_dev *pctldev, ··· 182 181 { "power-source", PIN_CONFIG_POWER_SOURCE, 0 }, 183 182 { "sleep-hardware-state", PIN_CONFIG_SLEEP_HARDWARE_STATE, 0 }, 184 183 { "slew-rate", PIN_CONFIG_SLEW_RATE, 0 }, 184 + { "skew-delay", PIN_CONFIG_SKEW_DELAY, 0 }, 185 185 }; 186 186 187 187 /**
+2 -2
drivers/pinctrl/pinctrl-amd.c
··· 753 753 return false; 754 754 } 755 755 756 - int amd_gpio_suspend(struct device *dev) 756 + static int amd_gpio_suspend(struct device *dev) 757 757 { 758 758 struct platform_device *pdev = to_platform_device(dev); 759 759 struct amd_gpio *gpio_dev = platform_get_drvdata(pdev); ··· 772 772 return 0; 773 773 } 774 774 775 - int amd_gpio_resume(struct device *dev) 775 + static int amd_gpio_resume(struct device *dev) 776 776 { 777 777 struct platform_device *pdev = to_platform_device(dev); 778 778 struct amd_gpio *gpio_dev = platform_get_drvdata(pdev);
+243 -90
drivers/pinctrl/pinctrl-gemini.c
··· 13 13 #include <linux/pinctrl/machine.h> 14 14 #include <linux/pinctrl/pinctrl.h> 15 15 #include <linux/pinctrl/pinmux.h> 16 + #include <linux/pinctrl/pinconf.h> 17 + #include <linux/pinctrl/pinconf-generic.h> 16 18 #include <linux/platform_device.h> 17 19 #include <linux/slab.h> 18 20 #include <linux/regmap.h> ··· 24 22 #define DRIVER_NAME "pinctrl-gemini" 25 23 26 24 /** 25 + * struct gemini_pin_conf - information about configuring a pin 26 + * @pin: the pin number 27 + * @reg: config register 28 + * @mask: the bits affecting the configuration of the pin 29 + */ 30 + struct gemini_pin_conf { 31 + unsigned int pin; 32 + u32 reg; 33 + u32 mask; 34 + }; 35 + 36 + /** 37 + * struct gemini_pmx - state holder for the gemini pin controller 27 38 * @dev: a pointer back to containing device 28 39 * @virtbase: the offset to the controller in virtual memory 29 40 * @map: regmap to access registers ··· 44 29 * @is_3516: whether the SoC/package is the 3516 variant 45 30 * @flash_pin: whether the flash pin (extended pins for parallel 46 31 * flash) is set 32 + * @confs: pin config information 33 + * @nconfs: number of pin config information items 47 34 */ 48 35 struct gemini_pmx { 49 36 struct device *dev; ··· 54 37 bool is_3512; 55 38 bool is_3516; 56 39 bool flash_pin; 40 + const struct gemini_pin_conf *confs; 41 + unsigned int nconfs; 57 42 }; 58 43 59 44 /** ··· 76 57 u32 value; 77 58 }; 78 59 60 + /* Some straight-forward control registers */ 61 + #define GLOBAL_WORD_ID 0x00 62 + #define GLOBAL_STATUS 0x04 63 + #define GLOBAL_STATUS_FLPIN BIT(20) 64 + #define GLOBAL_GMAC_CTRL_SKEW 0x1c 65 + #define GLOBAL_GMAC0_DATA_SKEW 0x20 66 + #define GLOBAL_GMAC1_DATA_SKEW 0x24 79 67 /* 80 68 * Global Miscellaneous Control Register 81 69 * This register controls all Gemini pad/pin multiplexing ··· 95 69 * DISABLED again. So you select a flash configuration once, and then 96 70 * you are stuck with it. 97 71 */ 98 - #define GLOBAL_WORD_ID 0x00 99 - #define GLOBAL_STATUS 0x04 100 - #define GLOBAL_STATUS_FLPIN BIT(20) 101 72 #define GLOBAL_MISC_CTRL 0x30 73 + #define GEMINI_GMAC_IOSEL_MASK GENMASK(28, 27) 74 + /* Not really used */ 75 + #define GEMINI_GMAC_IOSEL_GMAC0_GMII BIT(28) 76 + /* Activated with GMAC1 */ 77 + #define GEMINI_GMAC_IOSEL_GMAC0_GMAC1_RGMII BIT(27) 78 + /* This will be the default */ 79 + #define GEMINI_GMAC_IOSEL_GMAC0_RGMII_GMAC1_GPIO2 0 102 80 #define TVC_CLK_PAD_ENABLE BIT(20) 103 81 #define PCI_CLK_PAD_ENABLE BIT(17) 104 82 #define LPC_CLK_PAD_ENABLE BIT(16) ··· 116 86 #define NAND_PADS_DISABLE BIT(2) 117 87 #define PFLASH_PADS_DISABLE BIT(1) 118 88 #define SFLASH_PADS_DISABLE BIT(0) 119 - #define PADS_MASK (GENMASK(9, 0) | BIT(16) | BIT(17) | BIT(20)) 120 - #define PADS_MAXBIT 20 89 + #define PADS_MASK (GENMASK(9, 0) | BIT(16) | BIT(17) | BIT(20) | BIT(27)) 90 + #define PADS_MAXBIT 27 121 91 122 92 /* Ordered by bit index */ 123 93 static const char * const gemini_padgroups[] = { ··· 136 106 "PCI CLK", 137 107 NULL, NULL, 138 108 "TVC CLK", 109 + NULL, NULL, NULL, NULL, NULL, 110 + "GMAC1", 139 111 }; 140 112 141 113 static const struct pinctrl_pin_desc gemini_3512_pins[] = { ··· 525 493 }; 526 494 527 495 /* GMII, ethernet pins */ 528 - static const unsigned int gmii_3512_pins[] = { 529 - 311, 240, 258, 276, 294, 312, 241, 259, 277, 295, 313, 242, 260, 278, 296, 530 - 315, 297, 279, 261, 243, 316, 298, 280, 262, 244, 317, 299, 281 496 + static const unsigned int gmii_gmac0_3512_pins[] = { 497 + 240, 241, 242, 258, 259, 260, 276, 277, 278, 294, 295, 311, 312, 313 498 + }; 499 + 500 + static const unsigned int gmii_gmac1_3512_pins[] = { 501 + 243, 244, 261, 262, 279, 280, 281, 296, 297, 298, 299, 315, 316, 317 531 502 }; 532 503 533 504 static const unsigned int pci_3512_pins[] = { ··· 680 645 /* The GPIO1D (28-31) pins overlap with LCD and TVC */ 681 646 static const unsigned int gpio1d_3512_pins[] = { 246, 319, 301, 283 }; 682 647 683 - /* The GPIO2A (0-3) pins overlap with GMII and extended parallel flash */ 648 + /* The GPIO2A (0-3) pins overlap with GMII GMAC1 and extended parallel flash */ 684 649 static const unsigned int gpio2a_3512_pins[] = { 315, 297, 279, 261 }; 685 650 686 - /* The GPIO2B (4-7) pins overlap with GMII, extended parallel flash and LCD */ 651 + /* The GPIO2B (4-7) pins overlap with GMII GMAC1, extended parallel flash and LCD */ 687 652 static const unsigned int gpio2b_3512_pins[] = { 262, 244, 317, 299 }; 688 653 689 654 /* The GPIO2C (8-31) pins overlap with PCI */ ··· 750 715 .num_pins = ARRAY_SIZE(usb_3512_pins), 751 716 }, 752 717 { 753 - .name = "gmiigrp", 754 - .pins = gmii_3512_pins, 755 - .num_pins = ARRAY_SIZE(gmii_3512_pins), 718 + .name = "gmii_gmac0_grp", 719 + .pins = gmii_gmac0_3512_pins, 720 + .num_pins = ARRAY_SIZE(gmii_gmac0_3512_pins), 721 + }, 722 + { 723 + .name = "gmii_gmac1_grp", 724 + .pins = gmii_gmac1_3512_pins, 725 + .num_pins = ARRAY_SIZE(gmii_gmac1_3512_pins), 726 + /* Bring out RGMII on the GMAC1 pins */ 727 + .value = GEMINI_GMAC_IOSEL_GMAC0_GMAC1_RGMII, 756 728 }, 757 729 { 758 730 .name = "pcigrp", ··· 973 931 .name = "gpio2agrp", 974 932 .pins = gpio2a_3512_pins, 975 933 .num_pins = ARRAY_SIZE(gpio2a_3512_pins), 976 - /* Conflict with GMII and extended parallel flash */ 934 + .mask = GEMINI_GMAC_IOSEL_GMAC0_GMAC1_RGMII, 935 + /* Conflict with GMII GMAC1 and extended parallel flash */ 977 936 }, 978 937 { 979 938 .name = "gpio2bgrp", 980 939 .pins = gpio2b_3512_pins, 981 940 .num_pins = ARRAY_SIZE(gpio2b_3512_pins), 982 - /* Conflict with GMII, extended parallel flash and LCD */ 983 - .mask = LCD_PADS_ENABLE, 941 + /* Conflict with GMII GMAC1, extended parallel flash and LCD */ 942 + .mask = LCD_PADS_ENABLE | GEMINI_GMAC_IOSEL_GMAC0_GMAC1_RGMII, 984 943 }, 985 944 { 986 945 .name = "gpio2cgrp", ··· 1461 1418 }; 1462 1419 1463 1420 /* GMII, ethernet pins */ 1464 - static const unsigned int gmii_3516_pins[] = { 1465 - 306, 307, 308, 309, 310, 325, 326, 327, 328, 329, 330, 345, 346, 347, 1466 - 348, 349, 350, 351, 367, 368, 369, 370, 371, 386, 387, 389, 390, 391 1421 + static const unsigned int gmii_gmac0_3516_pins[] = { 1422 + 306, 307, 325, 326, 327, 328, 345, 346, 347, 348, 367, 368, 386, 387 1423 + }; 1424 + 1425 + static const unsigned int gmii_gmac1_3516_pins[] = { 1426 + 308, 309, 310, 329, 330, 349, 350, 351, 369, 370, 371, 389, 390, 391 1467 1427 }; 1468 1428 1469 1429 static const unsigned int pci_3516_pins[] = { ··· 1608 1562 /* The GPIO1D (28-31) pins overlap with TVC */ 1609 1563 static const unsigned int gpio1d_3516_pins[] = { 353, 311, 394, 374 }; 1610 1564 1611 - /* The GPIO2A (0-3) pins overlap with GMII and extended parallel flash */ 1565 + /* The GPIO2A (0-3) pins overlap with GMII GMAC1 and extended parallel flash */ 1612 1566 static const unsigned int gpio2a_3516_pins[] = { 308, 369, 389, 329 }; 1613 1567 1614 - /* The GPIO2B (4-7) pins overlap with GMII, extended parallel flash and LCD */ 1568 + /* The GPIO2B (4-7) pins overlap with GMII GMAC1, extended parallel flash and LCD */ 1615 1569 static const unsigned int gpio2b_3516_pins[] = { 391, 351, 310, 371 }; 1616 1570 1617 1571 /* The GPIO2C (8-31) pins overlap with PCI */ ··· 1683 1637 .num_pins = ARRAY_SIZE(usb_3516_pins), 1684 1638 }, 1685 1639 { 1686 - .name = "gmiigrp", 1687 - .pins = gmii_3516_pins, 1688 - .num_pins = ARRAY_SIZE(gmii_3516_pins), 1640 + .name = "gmii_gmac0_grp", 1641 + .pins = gmii_gmac0_3516_pins, 1642 + .num_pins = ARRAY_SIZE(gmii_gmac0_3516_pins), 1643 + }, 1644 + { 1645 + .name = "gmii_gmac1_grp", 1646 + .pins = gmii_gmac1_3516_pins, 1647 + .num_pins = ARRAY_SIZE(gmii_gmac1_3516_pins), 1648 + /* Bring out RGMII on the GMAC1 pins */ 1649 + .value = GEMINI_GMAC_IOSEL_GMAC0_GMAC1_RGMII, 1689 1650 }, 1690 1651 { 1691 1652 .name = "pcigrp", ··· 1891 1838 .name = "gpio2agrp", 1892 1839 .pins = gpio2a_3516_pins, 1893 1840 .num_pins = ARRAY_SIZE(gpio2a_3516_pins), 1894 - /* Conflict with GMII and extended parallel flash */ 1841 + .mask = GEMINI_GMAC_IOSEL_GMAC0_GMAC1_RGMII, 1842 + /* Conflict with GMII GMAC1 and extended parallel flash */ 1895 1843 }, 1896 1844 { 1897 1845 .name = "gpio2bgrp", 1898 1846 .pins = gpio2b_3516_pins, 1899 1847 .num_pins = ARRAY_SIZE(gpio2b_3516_pins), 1900 - /* Conflict with GMII, extended parallel flash and LCD */ 1901 - .mask = LCD_PADS_ENABLE, 1848 + /* Conflict with GMII GMAC1, extended parallel flash and LCD */ 1849 + .mask = LCD_PADS_ENABLE | GEMINI_GMAC_IOSEL_GMAC0_GMAC1_RGMII, 1902 1850 }, 1903 1851 { 1904 1852 .name = "gpio2cgrp", ··· 1972 1918 seq_printf(s, " " DRIVER_NAME); 1973 1919 } 1974 1920 1975 - static int gemini_pinctrl_dt_subnode_to_map(struct pinctrl_dev *pctldev, 1976 - struct device_node *np, 1977 - struct pinctrl_map **map, 1978 - unsigned int *reserved_maps, 1979 - unsigned int *num_maps) 1980 - { 1981 - int ret; 1982 - const char *function = NULL; 1983 - const char *group; 1984 - struct property *prop; 1985 - 1986 - ret = of_property_read_string(np, "function", &function); 1987 - if (ret < 0) 1988 - return ret; 1989 - 1990 - ret = of_property_count_strings(np, "groups"); 1991 - if (ret < 0) 1992 - return ret; 1993 - 1994 - ret = pinctrl_utils_reserve_map(pctldev, map, reserved_maps, 1995 - num_maps, ret); 1996 - if (ret < 0) 1997 - return ret; 1998 - 1999 - of_property_for_each_string(np, "groups", prop, group) { 2000 - ret = pinctrl_utils_add_map_mux(pctldev, map, reserved_maps, 2001 - num_maps, group, function); 2002 - if (ret < 0) 2003 - return ret; 2004 - pr_debug("ADDED FUNCTION %s <-> GROUP %s\n", 2005 - function, group); 2006 - } 2007 - 2008 - return 0; 2009 - } 2010 - 2011 - static int gemini_pinctrl_dt_node_to_map(struct pinctrl_dev *pctldev, 2012 - struct device_node *np_config, 2013 - struct pinctrl_map **map, 2014 - unsigned int *num_maps) 2015 - { 2016 - unsigned int reserved_maps = 0; 2017 - struct device_node *np; 2018 - int ret; 2019 - 2020 - *map = NULL; 2021 - *num_maps = 0; 2022 - 2023 - for_each_child_of_node(np_config, np) { 2024 - ret = gemini_pinctrl_dt_subnode_to_map(pctldev, np, map, 2025 - &reserved_maps, num_maps); 2026 - if (ret < 0) { 2027 - pinctrl_utils_free_map(pctldev, *map, *num_maps); 2028 - return ret; 2029 - } 2030 - } 2031 - 2032 - return 0; 2033 - }; 2034 - 2035 1921 static const struct pinctrl_ops gemini_pctrl_ops = { 2036 1922 .get_groups_count = gemini_get_groups_count, 2037 1923 .get_group_name = gemini_get_group_name, 2038 1924 .get_group_pins = gemini_get_group_pins, 2039 1925 .pin_dbg_show = gemini_pin_dbg_show, 2040 - .dt_node_to_map = gemini_pinctrl_dt_node_to_map, 2041 - .dt_free_map = pinctrl_utils_free_map, 1926 + .dt_node_to_map = pinconf_generic_dt_node_to_map_all, 1927 + .dt_free_map = pinconf_generic_dt_free_map, 2042 1928 }; 2043 1929 2044 1930 /** ··· 2002 2008 static const char * const idegrps[] = { "idegrp" }; 2003 2009 static const char * const satagrps[] = { "satagrp" }; 2004 2010 static const char * const usbgrps[] = { "usbgrp" }; 2005 - static const char * const gmiigrps[] = { "gmiigrp" }; 2011 + static const char * const gmiigrps[] = { "gmii_gmac0_grp", "gmii_gmac1_grp" }; 2006 2012 static const char * const pcigrps[] = { "pcigrp" }; 2007 2013 static const char * const lpcgrps[] = { "lpcgrp" }; 2008 2014 static const char * const lcdgrps[] = { "lcdgrp" }; ··· 2066 2072 .name = "sata", 2067 2073 .groups = satagrps, 2068 2074 .num_groups = ARRAY_SIZE(satagrps), 2075 + }, 2076 + { 2077 + .name = "usb", 2078 + .groups = usbgrps, 2079 + .num_groups = ARRAY_SIZE(usbgrps), 2080 + }, 2081 + { 2082 + .name = "gmii", 2083 + .groups = gmiigrps, 2084 + .num_groups = ARRAY_SIZE(gmiigrps), 2069 2085 }, 2070 2086 { 2071 2087 .name = "pci", ··· 2255 2251 .set_mux = gemini_pmx_set_mux, 2256 2252 }; 2257 2253 2254 + #define GEMINI_CFGPIN(_n, _r, _lb, _hb) { \ 2255 + .pin = _n, \ 2256 + .reg = _r, \ 2257 + .mask = GENMASK(_hb, _lb) \ 2258 + } 2259 + 2260 + static const struct gemini_pin_conf gemini_confs_3512[] = { 2261 + GEMINI_CFGPIN(259, GLOBAL_GMAC_CTRL_SKEW, 0, 3), /* GMAC0 RXDV */ 2262 + GEMINI_CFGPIN(277, GLOBAL_GMAC_CTRL_SKEW, 4, 7), /* GMAC0 RXC */ 2263 + GEMINI_CFGPIN(241, GLOBAL_GMAC_CTRL_SKEW, 8, 11), /* GMAC0 TXEN */ 2264 + GEMINI_CFGPIN(312, GLOBAL_GMAC_CTRL_SKEW, 12, 15), /* GMAC0 TXC */ 2265 + GEMINI_CFGPIN(298, GLOBAL_GMAC_CTRL_SKEW, 16, 19), /* GMAC1 RXDV */ 2266 + GEMINI_CFGPIN(280, GLOBAL_GMAC_CTRL_SKEW, 20, 23), /* GMAC1 RXC */ 2267 + GEMINI_CFGPIN(316, GLOBAL_GMAC_CTRL_SKEW, 24, 27), /* GMAC1 TXEN */ 2268 + GEMINI_CFGPIN(243, GLOBAL_GMAC_CTRL_SKEW, 28, 31), /* GMAC1 TXC */ 2269 + GEMINI_CFGPIN(295, GLOBAL_GMAC0_DATA_SKEW, 0, 3), /* GMAC0 RXD0 */ 2270 + GEMINI_CFGPIN(313, GLOBAL_GMAC0_DATA_SKEW, 4, 7), /* GMAC0 RXD1 */ 2271 + GEMINI_CFGPIN(242, GLOBAL_GMAC0_DATA_SKEW, 8, 11), /* GMAC0 RXD2 */ 2272 + GEMINI_CFGPIN(260, GLOBAL_GMAC0_DATA_SKEW, 12, 15), /* GMAC0 RXD3 */ 2273 + GEMINI_CFGPIN(294, GLOBAL_GMAC0_DATA_SKEW, 16, 19), /* GMAC0 TXD0 */ 2274 + GEMINI_CFGPIN(276, GLOBAL_GMAC0_DATA_SKEW, 20, 23), /* GMAC0 TXD1 */ 2275 + GEMINI_CFGPIN(258, GLOBAL_GMAC0_DATA_SKEW, 24, 27), /* GMAC0 TXD2 */ 2276 + GEMINI_CFGPIN(240, GLOBAL_GMAC0_DATA_SKEW, 28, 31), /* GMAC0 TXD3 */ 2277 + GEMINI_CFGPIN(262, GLOBAL_GMAC1_DATA_SKEW, 0, 3), /* GMAC1 RXD0 */ 2278 + GEMINI_CFGPIN(244, GLOBAL_GMAC1_DATA_SKEW, 4, 7), /* GMAC1 RXD1 */ 2279 + GEMINI_CFGPIN(317, GLOBAL_GMAC1_DATA_SKEW, 8, 11), /* GMAC1 RXD2 */ 2280 + GEMINI_CFGPIN(299, GLOBAL_GMAC1_DATA_SKEW, 12, 15), /* GMAC1 RXD3 */ 2281 + GEMINI_CFGPIN(261, GLOBAL_GMAC1_DATA_SKEW, 16, 19), /* GMAC1 TXD0 */ 2282 + GEMINI_CFGPIN(279, GLOBAL_GMAC1_DATA_SKEW, 20, 23), /* GMAC1 TXD1 */ 2283 + GEMINI_CFGPIN(297, GLOBAL_GMAC1_DATA_SKEW, 24, 27), /* GMAC1 TXD2 */ 2284 + GEMINI_CFGPIN(315, GLOBAL_GMAC1_DATA_SKEW, 28, 31), /* GMAC1 TXD3 */ 2285 + }; 2286 + 2287 + static const struct gemini_pin_conf gemini_confs_3516[] = { 2288 + GEMINI_CFGPIN(347, GLOBAL_GMAC_CTRL_SKEW, 0, 3), /* GMAC0 RXDV */ 2289 + GEMINI_CFGPIN(386, GLOBAL_GMAC_CTRL_SKEW, 4, 7), /* GMAC0 RXC */ 2290 + GEMINI_CFGPIN(307, GLOBAL_GMAC_CTRL_SKEW, 8, 11), /* GMAC0 TXEN */ 2291 + GEMINI_CFGPIN(327, GLOBAL_GMAC_CTRL_SKEW, 12, 15), /* GMAC0 TXC */ 2292 + GEMINI_CFGPIN(309, GLOBAL_GMAC_CTRL_SKEW, 16, 19), /* GMAC1 RXDV */ 2293 + GEMINI_CFGPIN(390, GLOBAL_GMAC_CTRL_SKEW, 20, 23), /* GMAC1 RXC */ 2294 + GEMINI_CFGPIN(370, GLOBAL_GMAC_CTRL_SKEW, 24, 27), /* GMAC1 TXEN */ 2295 + GEMINI_CFGPIN(350, GLOBAL_GMAC_CTRL_SKEW, 28, 31), /* GMAC1 TXC */ 2296 + GEMINI_CFGPIN(367, GLOBAL_GMAC0_DATA_SKEW, 0, 3), /* GMAC0 RXD0 */ 2297 + GEMINI_CFGPIN(348, GLOBAL_GMAC0_DATA_SKEW, 4, 7), /* GMAC0 RXD1 */ 2298 + GEMINI_CFGPIN(387, GLOBAL_GMAC0_DATA_SKEW, 8, 11), /* GMAC0 RXD2 */ 2299 + GEMINI_CFGPIN(328, GLOBAL_GMAC0_DATA_SKEW, 12, 15), /* GMAC0 RXD3 */ 2300 + GEMINI_CFGPIN(306, GLOBAL_GMAC0_DATA_SKEW, 16, 19), /* GMAC0 TXD0 */ 2301 + GEMINI_CFGPIN(325, GLOBAL_GMAC0_DATA_SKEW, 20, 23), /* GMAC0 TXD1 */ 2302 + GEMINI_CFGPIN(346, GLOBAL_GMAC0_DATA_SKEW, 24, 27), /* GMAC0 TXD2 */ 2303 + GEMINI_CFGPIN(326, GLOBAL_GMAC0_DATA_SKEW, 28, 31), /* GMAC0 TXD3 */ 2304 + GEMINI_CFGPIN(391, GLOBAL_GMAC1_DATA_SKEW, 0, 3), /* GMAC1 RXD0 */ 2305 + GEMINI_CFGPIN(351, GLOBAL_GMAC1_DATA_SKEW, 4, 7), /* GMAC1 RXD1 */ 2306 + GEMINI_CFGPIN(310, GLOBAL_GMAC1_DATA_SKEW, 8, 11), /* GMAC1 RXD2 */ 2307 + GEMINI_CFGPIN(371, GLOBAL_GMAC1_DATA_SKEW, 12, 15), /* GMAC1 RXD3 */ 2308 + GEMINI_CFGPIN(329, GLOBAL_GMAC1_DATA_SKEW, 16, 19), /* GMAC1 TXD0 */ 2309 + GEMINI_CFGPIN(389, GLOBAL_GMAC1_DATA_SKEW, 20, 23), /* GMAC1 TXD1 */ 2310 + GEMINI_CFGPIN(369, GLOBAL_GMAC1_DATA_SKEW, 24, 27), /* GMAC1 TXD2 */ 2311 + GEMINI_CFGPIN(308, GLOBAL_GMAC1_DATA_SKEW, 28, 31), /* GMAC1 TXD3 */ 2312 + }; 2313 + 2314 + static const struct gemini_pin_conf *gemini_get_pin_conf(struct gemini_pmx *pmx, 2315 + unsigned int pin) 2316 + { 2317 + const struct gemini_pin_conf *retconf; 2318 + int i; 2319 + 2320 + for (i = 0; i < pmx->nconfs; i++) { 2321 + retconf = &gemini_confs_3516[i]; 2322 + if (retconf->pin == pin) 2323 + return retconf; 2324 + } 2325 + return NULL; 2326 + } 2327 + 2328 + static int gemini_pinconf_get(struct pinctrl_dev *pctldev, unsigned int pin, 2329 + unsigned long *config) 2330 + { 2331 + struct gemini_pmx *pmx = pinctrl_dev_get_drvdata(pctldev); 2332 + enum pin_config_param param = pinconf_to_config_param(*config); 2333 + const struct gemini_pin_conf *conf; 2334 + u32 val; 2335 + 2336 + switch (param) { 2337 + case PIN_CONFIG_SKEW_DELAY: 2338 + conf = gemini_get_pin_conf(pmx, pin); 2339 + if (!conf) 2340 + return -ENOTSUPP; 2341 + regmap_read(pmx->map, conf->reg, &val); 2342 + val &= conf->mask; 2343 + val >>= (ffs(conf->mask) - 1); 2344 + *config = pinconf_to_config_packed(PIN_CONFIG_SKEW_DELAY, val); 2345 + break; 2346 + default: 2347 + return -ENOTSUPP; 2348 + } 2349 + 2350 + return 0; 2351 + } 2352 + 2353 + static int gemini_pinconf_set(struct pinctrl_dev *pctldev, unsigned int pin, 2354 + unsigned long *configs, unsigned int num_configs) 2355 + { 2356 + struct gemini_pmx *pmx = pinctrl_dev_get_drvdata(pctldev); 2357 + const struct gemini_pin_conf *conf; 2358 + enum pin_config_param param; 2359 + u32 arg; 2360 + int ret = 0; 2361 + int i; 2362 + 2363 + for (i = 0; i < num_configs; i++) { 2364 + param = pinconf_to_config_param(configs[i]); 2365 + arg = pinconf_to_config_argument(configs[i]); 2366 + 2367 + switch (param) { 2368 + case PIN_CONFIG_SKEW_DELAY: 2369 + if (arg > 0xf) 2370 + return -EINVAL; 2371 + conf = gemini_get_pin_conf(pmx, pin); 2372 + if (!conf) { 2373 + dev_err(pmx->dev, 2374 + "invalid pin for skew delay %d\n", pin); 2375 + return -ENOTSUPP; 2376 + } 2377 + arg <<= (ffs(conf->mask) - 1); 2378 + dev_dbg(pmx->dev, 2379 + "set pin %d to skew delay mask %08x, val %08x\n", 2380 + pin, conf->mask, arg); 2381 + regmap_update_bits(pmx->map, conf->reg, conf->mask, arg); 2382 + break; 2383 + default: 2384 + dev_err(pmx->dev, "Invalid config param %04x\n", param); 2385 + return -ENOTSUPP; 2386 + } 2387 + } 2388 + 2389 + return ret; 2390 + } 2391 + 2392 + static const struct pinconf_ops gemini_pinconf_ops = { 2393 + .pin_config_get = gemini_pinconf_get, 2394 + .pin_config_set = gemini_pinconf_set, 2395 + .is_generic = true, 2396 + }; 2397 + 2258 2398 static struct pinctrl_desc gemini_pmx_desc = { 2259 2399 .name = DRIVER_NAME, 2260 2400 .pctlops = &gemini_pctrl_ops, 2261 2401 .pmxops = &gemini_pmx_ops, 2402 + .confops = &gemini_pinconf_ops, 2262 2403 .owner = THIS_MODULE, 2263 2404 }; 2264 2405 ··· 2446 2297 val &= 0xffff; 2447 2298 if (val == 0x3512) { 2448 2299 pmx->is_3512 = true; 2300 + pmx->confs = gemini_confs_3512; 2301 + pmx->nconfs = ARRAY_SIZE(gemini_confs_3512); 2449 2302 gemini_pmx_desc.pins = gemini_3512_pins; 2450 2303 gemini_pmx_desc.npins = ARRAY_SIZE(gemini_3512_pins); 2451 2304 dev_info(dev, "detected 3512 chip variant\n"); 2452 2305 } else if (val == 0x3516) { 2453 2306 pmx->is_3516 = true; 2307 + pmx->confs = gemini_confs_3516; 2308 + pmx->nconfs = ARRAY_SIZE(gemini_confs_3516); 2454 2309 gemini_pmx_desc.pins = gemini_3516_pins; 2455 2310 gemini_pmx_desc.npins = ARRAY_SIZE(gemini_3516_pins); 2456 2311 dev_info(dev, "detected 3516 chip variant\n");
+1 -1
drivers/pinctrl/pinctrl-ingenic.c
··· 717 717 {}, 718 718 }; 719 719 720 - int ingenic_pinctrl_probe(struct platform_device *pdev) 720 + static int ingenic_pinctrl_probe(struct platform_device *pdev) 721 721 { 722 722 struct device *dev = &pdev->dev; 723 723 struct ingenic_pinctrl *jzpc;
+11 -10
drivers/pinctrl/pinctrl-max77620.c
··· 420 420 MAX77620_REG_GPIO0 + pin, 421 421 MAX77620_CNFG_GPIO_DRV_MASK, 422 422 val); 423 - if (ret < 0) { 424 - dev_err(dev, "Reg 0x%02x update failed %d\n", 425 - MAX77620_REG_GPIO0 + pin, ret); 426 - return ret; 427 - } 423 + if (ret) 424 + goto report_update_failure; 425 + 428 426 mpci->pin_info[pin].drv_type = val ? 429 427 MAX77620_PIN_PP_DRV : MAX77620_PIN_OD_DRV; 430 428 break; ··· 433 435 MAX77620_REG_GPIO0 + pin, 434 436 MAX77620_CNFG_GPIO_DRV_MASK, 435 437 val); 436 - if (ret < 0) { 437 - dev_err(dev, "Reg 0x%02x update failed %d\n", 438 - MAX77620_REG_GPIO0 + pin, ret); 439 - return ret; 440 - } 438 + if (ret) 439 + goto report_update_failure; 440 + 441 441 mpci->pin_info[pin].drv_type = val ? 442 442 MAX77620_PIN_PP_DRV : MAX77620_PIN_OD_DRV; 443 443 break; ··· 532 536 } 533 537 534 538 return 0; 539 + 540 + report_update_failure: 541 + dev_err(dev, "Reg 0x%02x update failed %d\n", 542 + MAX77620_REG_GPIO0 + pin, ret); 543 + return ret; 535 544 } 536 545 537 546 static const struct pinconf_ops max77620_pinconf_ops = {
+15 -5
drivers/pinctrl/pinctrl-mcp23s08.c
··· 25 25 #define MCP_TYPE_008 2 26 26 #define MCP_TYPE_017 3 27 27 #define MCP_TYPE_S18 4 28 + #define MCP_TYPE_018 5 28 29 29 30 #define MCP_MAX_DEV_PER_CS 8 30 31 ··· 279 278 { 280 279 struct mcp23s08 *mcp = pinctrl_dev_get_drvdata(pctldev); 281 280 enum pin_config_param param; 282 - u32 arg, mask; 283 - u16 val; 281 + u32 arg; 284 282 int ret = 0; 285 283 int i; 286 284 ··· 289 289 290 290 switch (param) { 291 291 case PIN_CONFIG_BIAS_PULL_UP: 292 - val = arg ? 0xFFFF : 0x0000; 293 - mask = BIT(pin); 294 292 ret = mcp_set_bit(mcp, MCP_GPPU, pin, arg); 295 293 break; 296 294 default: ··· 835 837 mcp->chip.ngpio = 16; 836 838 mcp->chip.label = "mcp23017"; 837 839 break; 840 + 841 + case MCP_TYPE_018: 842 + mcp->regmap = devm_regmap_init_i2c(data, &mcp23x17_regmap); 843 + mcp->reg_shift = 1; 844 + mcp->chip.ngpio = 16; 845 + mcp->chip.label = "mcp23018"; 846 + break; 838 847 #endif /* CONFIG_I2C */ 839 848 840 849 default: ··· 888 883 if (mirror) 889 884 status |= IOCON_MIRROR | (IOCON_MIRROR << 8); 890 885 891 - if (type == MCP_TYPE_S18) 886 + if (type == MCP_TYPE_S18 || type == MCP_TYPE_018) 892 887 status |= IOCON_INTCC | (IOCON_INTCC << 8); 893 888 894 889 ret = mcp_write(mcp, MCP_IOCON, status); ··· 969 964 .compatible = "microchip,mcp23017", 970 965 .data = (void *) MCP_TYPE_017, 971 966 }, 967 + { 968 + .compatible = "microchip,mcp23018", 969 + .data = (void *) MCP_TYPE_018, 970 + }, 972 971 /* NOTE: The use of the mcp prefix is deprecated and will be removed. */ 973 972 { 974 973 .compatible = "mcp,mcp23008", ··· 1022 1013 static const struct i2c_device_id mcp230xx_id[] = { 1023 1014 { "mcp23008", MCP_TYPE_008 }, 1024 1015 { "mcp23017", MCP_TYPE_017 }, 1016 + { "mcp23018", MCP_TYPE_018 }, 1025 1017 { }, 1026 1018 }; 1027 1019 MODULE_DEVICE_TABLE(i2c, mcp230xx_id);
+35 -8
drivers/pinctrl/pinctrl-rockchip.c
··· 884 884 }, 885 885 }; 886 886 887 + static struct rockchip_mux_route_data rk3288_mux_route_data[] = { 888 + { 889 + /* edphdmi_cecinoutt1 */ 890 + .bank_num = 7, 891 + .pin = 16, 892 + .func = 2, 893 + .route_offset = 0x264, 894 + .route_val = BIT(16 + 12) | BIT(12), 895 + }, { 896 + /* edphdmi_cecinout */ 897 + .bank_num = 7, 898 + .pin = 23, 899 + .func = 4, 900 + .route_offset = 0x264, 901 + .route_val = BIT(16 + 12), 902 + }, 903 + }; 904 + 887 905 static struct rockchip_mux_route_data rk3328_mux_route_data[] = { 888 906 { 889 907 /* uart2dbg_rxm0 */ ··· 918 900 .route_offset = 0x50, 919 901 .route_val = BIT(16) | BIT(16 + 1) | BIT(0), 920 902 }, { 921 - /* gmac-m1-optimized_rxd0 */ 903 + /* gmac-m1_rxd0 */ 922 904 .bank_num = 1, 923 905 .pin = 11, 924 906 .func = 2, 925 907 .route_offset = 0x50, 926 - .route_val = BIT(16 + 2) | BIT(16 + 10) | BIT(2) | BIT(10), 908 + .route_val = BIT(16 + 2) | BIT(2), 909 + }, { 910 + /* gmac-m1-optimized_rxd3 */ 911 + .bank_num = 1, 912 + .pin = 14, 913 + .func = 2, 914 + .route_offset = 0x50, 915 + .route_val = BIT(16 + 10) | BIT(10), 927 916 }, { 928 917 /* pdm_sdi0m0 */ 929 918 .bank_num = 2, ··· 3416 3391 .type = RK3288, 3417 3392 .grf_mux_offset = 0x0, 3418 3393 .pmu_mux_offset = 0x84, 3394 + .iomux_routes = rk3288_mux_route_data, 3395 + .niomux_routes = ARRAY_SIZE(rk3288_mux_route_data), 3419 3396 .pull_calc_reg = rk3288_calc_pull_reg_and_bit, 3420 3397 .drv_calc_reg = rk3288_calc_drv_reg_and_bit, 3421 3398 }; ··· 3483 3456 DRV_TYPE_IO_1V8_ONLY, 3484 3457 DRV_TYPE_IO_DEFAULT, 3485 3458 DRV_TYPE_IO_DEFAULT, 3486 - 0x0, 3487 - 0x8, 3459 + 0x80, 3460 + 0x88, 3488 3461 -1, 3489 3462 -1, 3490 3463 PULL_TYPE_IO_1V8_ONLY, ··· 3500 3473 DRV_TYPE_IO_1V8_OR_3V0, 3501 3474 DRV_TYPE_IO_1V8_OR_3V0, 3502 3475 DRV_TYPE_IO_1V8_OR_3V0, 3503 - 0x20, 3504 - 0x28, 3505 - 0x30, 3506 - 0x38 3476 + 0xa0, 3477 + 0xa8, 3478 + 0xb0, 3479 + 0xb8 3507 3480 ), 3508 3481 PIN_BANK_DRV_FLAGS_PULL_FLAGS(2, 32, "gpio2", DRV_TYPE_IO_1V8_OR_3V0, 3509 3482 DRV_TYPE_IO_1V8_OR_3V0,
+134
drivers/pinctrl/pinctrl-rza1.c
··· 303 303 }; 304 304 305 305 /* ---------------------------------------------------------------------------- 306 + * RZ/A1L (r7s72102) pinmux flags 307 + */ 308 + 309 + static const struct rza1_bidir_pin rza1l_bidir_pins_p1[] = { 310 + { .pin = 0, .func = 1 }, 311 + { .pin = 1, .func = 1 }, 312 + { .pin = 2, .func = 1 }, 313 + { .pin = 3, .func = 1 }, 314 + { .pin = 4, .func = 1 }, 315 + { .pin = 5, .func = 1 }, 316 + { .pin = 6, .func = 1 }, 317 + { .pin = 7, .func = 1 }, 318 + }; 319 + 320 + static const struct rza1_bidir_pin rza1l_bidir_pins_p3[] = { 321 + { .pin = 0, .func = 2 }, 322 + { .pin = 1, .func = 2 }, 323 + { .pin = 2, .func = 2 }, 324 + { .pin = 4, .func = 2 }, 325 + { .pin = 5, .func = 2 }, 326 + { .pin = 10, .func = 2 }, 327 + { .pin = 11, .func = 2 }, 328 + { .pin = 12, .func = 2 }, 329 + { .pin = 13, .func = 2 }, 330 + }; 331 + 332 + static const struct rza1_bidir_pin rza1l_bidir_pins_p4[] = { 333 + { .pin = 1, .func = 4 }, 334 + { .pin = 2, .func = 2 }, 335 + { .pin = 3, .func = 2 }, 336 + { .pin = 6, .func = 2 }, 337 + { .pin = 7, .func = 2 }, 338 + }; 339 + 340 + static const struct rza1_bidir_pin rza1l_bidir_pins_p5[] = { 341 + { .pin = 0, .func = 1 }, 342 + { .pin = 1, .func = 1 }, 343 + { .pin = 2, .func = 1 }, 344 + { .pin = 3, .func = 1 }, 345 + { .pin = 4, .func = 1 }, 346 + { .pin = 5, .func = 1 }, 347 + { .pin = 6, .func = 1 }, 348 + { .pin = 7, .func = 1 }, 349 + { .pin = 8, .func = 1 }, 350 + { .pin = 9, .func = 1 }, 351 + { .pin = 10, .func = 1 }, 352 + { .pin = 11, .func = 1 }, 353 + { .pin = 12, .func = 1 }, 354 + { .pin = 13, .func = 1 }, 355 + { .pin = 14, .func = 1 }, 356 + { .pin = 15, .func = 1 }, 357 + { .pin = 0, .func = 2 }, 358 + { .pin = 1, .func = 2 }, 359 + { .pin = 2, .func = 2 }, 360 + { .pin = 3, .func = 2 }, 361 + }; 362 + 363 + static const struct rza1_bidir_pin rza1l_bidir_pins_p6[] = { 364 + { .pin = 0, .func = 1 }, 365 + { .pin = 1, .func = 1 }, 366 + { .pin = 2, .func = 1 }, 367 + { .pin = 3, .func = 1 }, 368 + { .pin = 4, .func = 1 }, 369 + { .pin = 5, .func = 1 }, 370 + { .pin = 6, .func = 1 }, 371 + { .pin = 7, .func = 1 }, 372 + { .pin = 8, .func = 1 }, 373 + { .pin = 9, .func = 1 }, 374 + { .pin = 10, .func = 1 }, 375 + { .pin = 11, .func = 1 }, 376 + { .pin = 12, .func = 1 }, 377 + { .pin = 13, .func = 1 }, 378 + { .pin = 14, .func = 1 }, 379 + { .pin = 15, .func = 1 }, 380 + }; 381 + 382 + static const struct rza1_bidir_pin rza1l_bidir_pins_p7[] = { 383 + { .pin = 2, .func = 2 }, 384 + { .pin = 3, .func = 2 }, 385 + { .pin = 5, .func = 2 }, 386 + { .pin = 6, .func = 2 }, 387 + { .pin = 7, .func = 2 }, 388 + { .pin = 2, .func = 3 }, 389 + { .pin = 3, .func = 3 }, 390 + { .pin = 5, .func = 3 }, 391 + { .pin = 6, .func = 3 }, 392 + { .pin = 7, .func = 3 }, 393 + }; 394 + 395 + static const struct rza1_bidir_pin rza1l_bidir_pins_p9[] = { 396 + { .pin = 1, .func = 2 }, 397 + { .pin = 0, .func = 3 }, 398 + { .pin = 1, .func = 3 }, 399 + { .pin = 3, .func = 3 }, 400 + { .pin = 4, .func = 3 }, 401 + { .pin = 5, .func = 3 }, 402 + }; 403 + 404 + static const struct rza1_swio_pin rza1l_swio_pins[] = { 405 + { .port = 2, .pin = 8, .func = 2, .input = 0 }, 406 + { .port = 5, .pin = 6, .func = 3, .input = 0 }, 407 + { .port = 6, .pin = 6, .func = 3, .input = 0 }, 408 + { .port = 6, .pin = 10, .func = 3, .input = 0 }, 409 + { .port = 7, .pin = 10, .func = 2, .input = 0 }, 410 + { .port = 8, .pin = 2, .func = 3, .input = 0 }, 411 + }; 412 + 413 + static const struct rza1_bidir_entry rza1l_bidir_entries[RZA1_NPORTS] = { 414 + [1] = { ARRAY_SIZE(rza1l_bidir_pins_p1), rza1l_bidir_pins_p1 }, 415 + [3] = { ARRAY_SIZE(rza1l_bidir_pins_p3), rza1l_bidir_pins_p3 }, 416 + [4] = { ARRAY_SIZE(rza1l_bidir_pins_p4), rza1l_bidir_pins_p4 }, 417 + [5] = { ARRAY_SIZE(rza1l_bidir_pins_p4), rza1l_bidir_pins_p5 }, 418 + [6] = { ARRAY_SIZE(rza1l_bidir_pins_p6), rza1l_bidir_pins_p6 }, 419 + [7] = { ARRAY_SIZE(rza1l_bidir_pins_p7), rza1l_bidir_pins_p7 }, 420 + [9] = { ARRAY_SIZE(rza1l_bidir_pins_p9), rza1l_bidir_pins_p9 }, 421 + }; 422 + 423 + static const struct rza1_swio_entry rza1l_swio_entries[] = { 424 + [0] = { ARRAY_SIZE(rza1h_swio_pins), rza1h_swio_pins }, 425 + }; 426 + 427 + /* RZ/A1L (r7s72102x) pinmux flags table */ 428 + static const struct rza1_pinmux_conf rza1l_pmx_conf = { 429 + .bidir_entries = rza1l_bidir_entries, 430 + .swio_entries = rza1l_swio_entries, 431 + }; 432 + 433 + /* ---------------------------------------------------------------------------- 306 434 * RZ/A1 types 307 435 */ 308 436 /** ··· 1411 1283 1412 1284 static const struct of_device_id rza1_pinctrl_of_match[] = { 1413 1285 { 1286 + /* RZ/A1H, RZ/A1M */ 1414 1287 .compatible = "renesas,r7s72100-ports", 1415 1288 .data = &rza1h_pmx_conf, 1289 + }, 1290 + { 1291 + /* RZ/A1L */ 1292 + .compatible = "renesas,r7s72102-ports", 1293 + .data = &rza1l_pmx_conf, 1416 1294 }, 1417 1295 { } 1418 1296 };
+2 -2
drivers/pinctrl/pinctrl-single.c
··· 873 873 int i = 0, nconfs = 0; 874 874 unsigned long *settings = NULL, *s = NULL; 875 875 struct pcs_conf_vals *conf = NULL; 876 - struct pcs_conf_type prop2[] = { 876 + static const struct pcs_conf_type prop2[] = { 877 877 { "pinctrl-single,drive-strength", PIN_CONFIG_DRIVE_STRENGTH, }, 878 878 { "pinctrl-single,slew-rate", PIN_CONFIG_SLEW_RATE, }, 879 879 { "pinctrl-single,input-schmitt", PIN_CONFIG_INPUT_SCHMITT, }, 880 880 { "pinctrl-single,low-power-mode", PIN_CONFIG_LOW_POWER_MODE, }, 881 881 }; 882 - struct pcs_conf_type prop4[] = { 882 + static const struct pcs_conf_type prop4[] = { 883 883 { "pinctrl-single,bias-pullup", PIN_CONFIG_BIAS_PULL_UP, }, 884 884 { "pinctrl-single,bias-pulldown", PIN_CONFIG_BIAS_PULL_DOWN, }, 885 885 { "pinctrl-single,input-schmitt-enable",
+1 -1
drivers/pinctrl/pinctrl-sx150x.c
··· 1087 1087 return reg == pctl->data->reg_irq_src || reg == pctl->data->reg_data; 1088 1088 } 1089 1089 1090 - const struct regmap_config sx150x_regmap_config = { 1090 + static const struct regmap_config sx150x_regmap_config = { 1091 1091 .reg_bits = 8, 1092 1092 .val_bits = 32, 1093 1093
+6
drivers/pinctrl/qcom/pinctrl-spmi-gpio.c
··· 453 453 454 454 pad = pctldev->desc->pins[pin].drv_data; 455 455 456 + pad->is_enabled = true; 456 457 for (i = 0; i < nconfs; i++) { 457 458 param = pinconf_to_config_param(configs[i]); 458 459 arg = pinconf_to_config_argument(configs[i]); ··· 600 599 if (ret < 0) 601 600 return ret; 602 601 } 602 + 603 + val = pad->is_enabled << PMIC_GPIO_REG_MASTER_EN_SHIFT; 604 + 605 + ret = pmic_gpio_write(state, pad, PMIC_GPIO_REG_EN_CTL, val); 603 606 604 607 return ret; 605 608 } ··· 1037 1032 { .compatible = "qcom,pm8916-gpio" }, /* 4 GPIO's */ 1038 1033 { .compatible = "qcom,pm8941-gpio" }, /* 36 GPIO's */ 1039 1034 { .compatible = "qcom,pm8994-gpio" }, /* 22 GPIO's */ 1035 + { .compatible = "qcom,pmi8994-gpio" }, /* 10 GPIO's */ 1040 1036 { .compatible = "qcom,pma8084-gpio" }, /* 22 GPIO's */ 1041 1037 { .compatible = "qcom,spmi-gpio" }, /* Generic */ 1042 1038 { },
+1 -1
drivers/pinctrl/samsung/Kconfig
··· 29 29 30 30 config PINCTRL_S3C24XX 31 31 bool "Samsung S3C24XX SoC pinctrl driver" 32 - depends on ARCH_S3C24XX 32 + depends on ARCH_S3C24XX && OF 33 33 select PINCTRL_SAMSUNG 34 34 35 35 config PINCTRL_S3C64XX
+114 -17
drivers/pinctrl/sh-pfc/core.c
··· 24 24 #include <linux/of_device.h> 25 25 #include <linux/pinctrl/machine.h> 26 26 #include <linux/platform_device.h> 27 + #include <linux/psci.h> 27 28 #include <linux/slab.h> 28 29 29 30 #include "core.h" ··· 176 175 BUG(); 177 176 } 178 177 179 - u32 sh_pfc_read_reg(struct sh_pfc *pfc, u32 reg, unsigned int width) 178 + u32 sh_pfc_read(struct sh_pfc *pfc, u32 reg) 180 179 { 181 - return sh_pfc_read_raw_reg(sh_pfc_phys_to_virt(pfc, reg), width); 180 + return sh_pfc_read_raw_reg(sh_pfc_phys_to_virt(pfc, reg), 32); 182 181 } 183 182 184 - void sh_pfc_write_reg(struct sh_pfc *pfc, u32 reg, unsigned int width, u32 data) 183 + void sh_pfc_write(struct sh_pfc *pfc, u32 reg, u32 data) 185 184 { 186 185 if (pfc->info->unlock_reg) 187 186 sh_pfc_write_raw_reg( 188 187 sh_pfc_phys_to_virt(pfc, pfc->info->unlock_reg), 32, 189 188 ~data); 190 189 191 - sh_pfc_write_raw_reg(sh_pfc_phys_to_virt(pfc, reg), width, data); 190 + sh_pfc_write_raw_reg(sh_pfc_phys_to_virt(pfc, reg), 32, data); 192 191 } 193 192 194 193 static void sh_pfc_config_reg_helper(struct sh_pfc *pfc, ··· 390 389 return 0; 391 390 } 392 391 393 - const struct sh_pfc_bias_info * 394 - sh_pfc_pin_to_bias_info(const struct sh_pfc_bias_info *info, 395 - unsigned int num, unsigned int pin) 392 + const struct pinmux_bias_reg * 393 + sh_pfc_pin_to_bias_reg(const struct sh_pfc *pfc, unsigned int pin, 394 + unsigned int *bit) 396 395 { 397 - unsigned int i; 396 + unsigned int i, j; 398 397 399 - for (i = 0; i < num; i++) 400 - if (info[i].pin == pin) 401 - return &info[i]; 398 + for (i = 0; pfc->info->bias_regs[i].puen; i++) { 399 + for (j = 0; j < ARRAY_SIZE(pfc->info->bias_regs[i].pins); j++) { 400 + if (pfc->info->bias_regs[i].pins[j] == pin) { 401 + *bit = j; 402 + return &pfc->info->bias_regs[i]; 403 + } 404 + } 405 + } 402 406 403 407 WARN_ONCE(1, "Pin %u is not in bias info list\n", pin); 404 408 ··· 573 567 }; 574 568 #endif 575 569 570 + #if defined(CONFIG_PM_SLEEP) && defined(CONFIG_ARM_PSCI_FW) 571 + static void sh_pfc_nop_reg(struct sh_pfc *pfc, u32 reg, unsigned int idx) 572 + { 573 + } 574 + 575 + static void sh_pfc_save_reg(struct sh_pfc *pfc, u32 reg, unsigned int idx) 576 + { 577 + pfc->saved_regs[idx] = sh_pfc_read(pfc, reg); 578 + } 579 + 580 + static void sh_pfc_restore_reg(struct sh_pfc *pfc, u32 reg, unsigned int idx) 581 + { 582 + sh_pfc_write(pfc, reg, pfc->saved_regs[idx]); 583 + } 584 + 585 + static unsigned int sh_pfc_walk_regs(struct sh_pfc *pfc, 586 + void (*do_reg)(struct sh_pfc *pfc, u32 reg, unsigned int idx)) 587 + { 588 + unsigned int i, n = 0; 589 + 590 + if (pfc->info->cfg_regs) 591 + for (i = 0; pfc->info->cfg_regs[i].reg; i++) 592 + do_reg(pfc, pfc->info->cfg_regs[i].reg, n++); 593 + 594 + if (pfc->info->drive_regs) 595 + for (i = 0; pfc->info->drive_regs[i].reg; i++) 596 + do_reg(pfc, pfc->info->drive_regs[i].reg, n++); 597 + 598 + if (pfc->info->bias_regs) 599 + for (i = 0; pfc->info->bias_regs[i].puen; i++) { 600 + do_reg(pfc, pfc->info->bias_regs[i].puen, n++); 601 + if (pfc->info->bias_regs[i].pud) 602 + do_reg(pfc, pfc->info->bias_regs[i].pud, n++); 603 + } 604 + 605 + if (pfc->info->ioctrl_regs) 606 + for (i = 0; pfc->info->ioctrl_regs[i].reg; i++) 607 + do_reg(pfc, pfc->info->ioctrl_regs[i].reg, n++); 608 + 609 + return n; 610 + } 611 + 612 + static int sh_pfc_suspend_init(struct sh_pfc *pfc) 613 + { 614 + unsigned int n; 615 + 616 + /* This is the best we can do to check for the presence of PSCI */ 617 + if (!psci_ops.cpu_suspend) 618 + return 0; 619 + 620 + n = sh_pfc_walk_regs(pfc, sh_pfc_nop_reg); 621 + if (!n) 622 + return 0; 623 + 624 + pfc->saved_regs = devm_kmalloc_array(pfc->dev, n, 625 + sizeof(*pfc->saved_regs), 626 + GFP_KERNEL); 627 + if (!pfc->saved_regs) 628 + return -ENOMEM; 629 + 630 + dev_dbg(pfc->dev, "Allocated space to save %u regs\n", n); 631 + return 0; 632 + } 633 + 634 + static int sh_pfc_suspend_noirq(struct device *dev) 635 + { 636 + struct sh_pfc *pfc = dev_get_drvdata(dev); 637 + 638 + if (pfc->saved_regs) 639 + sh_pfc_walk_regs(pfc, sh_pfc_save_reg); 640 + return 0; 641 + } 642 + 643 + static int sh_pfc_resume_noirq(struct device *dev) 644 + { 645 + struct sh_pfc *pfc = dev_get_drvdata(dev); 646 + 647 + if (pfc->saved_regs) 648 + sh_pfc_walk_regs(pfc, sh_pfc_restore_reg); 649 + return 0; 650 + } 651 + 652 + static const struct dev_pm_ops sh_pfc_pm = { 653 + SET_NOIRQ_SYSTEM_SLEEP_PM_OPS(sh_pfc_suspend_noirq, sh_pfc_resume_noirq) 654 + }; 655 + #define DEV_PM_OPS &sh_pfc_pm 656 + #else 657 + static int sh_pfc_suspend_init(struct sh_pfc *pfc) { return 0; } 658 + #define DEV_PM_OPS NULL 659 + #endif /* CONFIG_PM_SLEEP && CONFIG_ARM_PSCI_FW */ 660 + 576 661 static int sh_pfc_probe(struct platform_device *pdev) 577 662 { 578 - const struct platform_device_id *platid = platform_get_device_id(pdev); 579 663 #ifdef CONFIG_OF 580 664 struct device_node *np = pdev->dev.of_node; 581 665 #endif ··· 678 582 info = of_device_get_match_data(&pdev->dev); 679 583 else 680 584 #endif 681 - info = platid ? (const void *)platid->driver_data : NULL; 682 - 683 - if (info == NULL) 684 - return -ENODEV; 585 + info = (const void *)platform_get_device_id(pdev)->driver_data; 685 586 686 587 pfc = devm_kzalloc(&pdev->dev, sizeof(*pfc), GFP_KERNEL); 687 588 if (pfc == NULL) ··· 701 608 /* .init() may have overridden pfc->info */ 702 609 info = pfc->info; 703 610 } 611 + 612 + ret = sh_pfc_suspend_init(pfc); 613 + if (ret) 614 + return ret; 704 615 705 616 /* Enable dummy states for those platforms without pinctrl support */ 706 617 if (!of_have_populated_dt()) ··· 780 683 #ifdef CONFIG_PINCTRL_PFC_SHX3 781 684 { "pfc-shx3", (kernel_ulong_t)&shx3_pinmux_info }, 782 685 #endif 783 - { "sh-pfc", 0 }, 784 686 { }, 785 687 }; 786 688 ··· 789 693 .driver = { 790 694 .name = DRV_NAME, 791 695 .of_match_table = of_match_ptr(sh_pfc_of_table), 696 + .pm = DEV_PM_OPS, 792 697 }, 793 698 }; 794 699
+5 -6
drivers/pinctrl/sh-pfc/core.h
··· 26 26 u32 sh_pfc_read_raw_reg(void __iomem *mapped_reg, unsigned int reg_width); 27 27 void sh_pfc_write_raw_reg(void __iomem *mapped_reg, unsigned int reg_width, 28 28 u32 data); 29 - u32 sh_pfc_read_reg(struct sh_pfc *pfc, u32 reg, unsigned int width); 30 - void sh_pfc_write_reg(struct sh_pfc *pfc, u32 reg, unsigned int width, 31 - u32 data); 29 + u32 sh_pfc_read(struct sh_pfc *pfc, u32 reg); 30 + void sh_pfc_write(struct sh_pfc *pfc, u32 reg, u32 data); 32 31 33 32 int sh_pfc_get_pin_index(struct sh_pfc *pfc, unsigned int pin); 34 33 int sh_pfc_config_mux(struct sh_pfc *pfc, unsigned mark, int pinmux_type); 35 34 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); 35 + const struct pinmux_bias_reg * 36 + sh_pfc_pin_to_bias_reg(const struct sh_pfc *pfc, unsigned int pin, 37 + unsigned int *bit); 39 38 40 39 #endif /* __SH_PFC_CORE_H__ */
+2 -2
drivers/pinctrl/sh-pfc/gpio.c
··· 139 139 if (idx < 0 || pfc->info->pins[idx].enum_id == 0) 140 140 return -EINVAL; 141 141 142 - return pinctrl_request_gpio(offset); 142 + return pinctrl_gpio_request(offset); 143 143 } 144 144 145 145 static void gpio_pin_free(struct gpio_chip *gc, unsigned offset) 146 146 { 147 - return pinctrl_free_gpio(offset); 147 + return pinctrl_gpio_free(offset); 148 148 } 149 149 150 150 static void gpio_pin_set_value(struct sh_pfc_chip *chip, unsigned offset,
+221 -180
drivers/pinctrl/sh-pfc/pfc-r8a7778.c
··· 2912 2912 { }, 2913 2913 }; 2914 2914 2915 - #define PUPR0 0x100 2916 - #define PUPR1 0x104 2917 - #define PUPR2 0x108 2918 - #define PUPR3 0x10c 2919 - #define PUPR4 0x110 2920 - #define PUPR5 0x114 2915 + #define PIN_NONE U16_MAX 2921 2916 2922 - static const struct sh_pfc_bias_info bias_info[] = { 2923 - { RCAR_GP_PIN(0, 6), PUPR0, 0 }, /* A0 */ 2924 - { RCAR_GP_PIN(0, 7), PUPR0, 1 }, /* A1 */ 2925 - { RCAR_GP_PIN(0, 8), PUPR0, 2 }, /* A2 */ 2926 - { RCAR_GP_PIN(0, 9), PUPR0, 3 }, /* A3 */ 2927 - { RCAR_GP_PIN(0, 10), PUPR0, 4 }, /* A4 */ 2928 - { RCAR_GP_PIN(0, 11), PUPR0, 5 }, /* A5 */ 2929 - { RCAR_GP_PIN(0, 12), PUPR0, 6 }, /* A6 */ 2930 - { RCAR_GP_PIN(0, 13), PUPR0, 7 }, /* A7 */ 2931 - { RCAR_GP_PIN(0, 14), PUPR0, 8 }, /* A8 */ 2932 - { RCAR_GP_PIN(0, 15), PUPR0, 9 }, /* A9 */ 2933 - { RCAR_GP_PIN(0, 16), PUPR0, 10 }, /* A10 */ 2934 - { RCAR_GP_PIN(0, 17), PUPR0, 11 }, /* A11 */ 2935 - { RCAR_GP_PIN(0, 18), PUPR0, 12 }, /* A12 */ 2936 - { RCAR_GP_PIN(0, 19), PUPR0, 13 }, /* A13 */ 2937 - { RCAR_GP_PIN(0, 20), PUPR0, 14 }, /* A14 */ 2938 - { RCAR_GP_PIN(0, 21), PUPR0, 15 }, /* A15 */ 2939 - { RCAR_GP_PIN(0, 22), PUPR0, 16 }, /* A16 */ 2940 - { RCAR_GP_PIN(0, 23), PUPR0, 17 }, /* A17 */ 2941 - { RCAR_GP_PIN(0, 24), PUPR0, 18 }, /* A18 */ 2942 - { RCAR_GP_PIN(0, 25), PUPR0, 19 }, /* A19 */ 2943 - { RCAR_GP_PIN(0, 26), PUPR0, 20 }, /* A20 */ 2944 - { RCAR_GP_PIN(0, 27), PUPR0, 21 }, /* A21 */ 2945 - { RCAR_GP_PIN(0, 28), PUPR0, 22 }, /* A22 */ 2946 - { RCAR_GP_PIN(0, 29), PUPR0, 23 }, /* A23 */ 2947 - { RCAR_GP_PIN(0, 30), PUPR0, 24 }, /* A24 */ 2948 - { RCAR_GP_PIN(0, 31), PUPR0, 25 }, /* A25 */ 2949 - { RCAR_GP_PIN(1, 3), PUPR0, 26 }, /* /EX_CS0 */ 2950 - { RCAR_GP_PIN(1, 4), PUPR0, 27 }, /* /EX_CS1 */ 2951 - { RCAR_GP_PIN(1, 5), PUPR0, 28 }, /* /EX_CS2 */ 2952 - { RCAR_GP_PIN(1, 6), PUPR0, 29 }, /* /EX_CS3 */ 2953 - { RCAR_GP_PIN(1, 7), PUPR0, 30 }, /* /EX_CS4 */ 2954 - { RCAR_GP_PIN(1, 8), PUPR0, 31 }, /* /EX_CS5 */ 2955 - 2956 - { RCAR_GP_PIN(0, 0), PUPR1, 0 }, /* /PRESETOUT */ 2957 - { RCAR_GP_PIN(0, 5), PUPR1, 1 }, /* /BS */ 2958 - { RCAR_GP_PIN(1, 0), PUPR1, 2 }, /* RD//WR */ 2959 - { RCAR_GP_PIN(1, 1), PUPR1, 3 }, /* /WE0 */ 2960 - { RCAR_GP_PIN(1, 2), PUPR1, 4 }, /* /WE1 */ 2961 - { RCAR_GP_PIN(1, 11), PUPR1, 5 }, /* EX_WAIT0 */ 2962 - { RCAR_GP_PIN(1, 9), PUPR1, 6 }, /* DREQ0 */ 2963 - { RCAR_GP_PIN(1, 10), PUPR1, 7 }, /* DACK0 */ 2964 - { RCAR_GP_PIN(1, 12), PUPR1, 8 }, /* IRQ0 */ 2965 - { RCAR_GP_PIN(1, 13), PUPR1, 9 }, /* IRQ1 */ 2966 - 2967 - { RCAR_GP_PIN(1, 22), PUPR2, 0 }, /* DU0_DR0 */ 2968 - { RCAR_GP_PIN(1, 23), PUPR2, 1 }, /* DU0_DR1 */ 2969 - { RCAR_GP_PIN(1, 24), PUPR2, 2 }, /* DU0_DR2 */ 2970 - { RCAR_GP_PIN(1, 25), PUPR2, 3 }, /* DU0_DR3 */ 2971 - { RCAR_GP_PIN(1, 26), PUPR2, 4 }, /* DU0_DR4 */ 2972 - { RCAR_GP_PIN(1, 27), PUPR2, 5 }, /* DU0_DR5 */ 2973 - { RCAR_GP_PIN(1, 28), PUPR2, 6 }, /* DU0_DR6 */ 2974 - { RCAR_GP_PIN(1, 29), PUPR2, 7 }, /* DU0_DR7 */ 2975 - { RCAR_GP_PIN(1, 30), PUPR2, 8 }, /* DU0_DG0 */ 2976 - { RCAR_GP_PIN(1, 31), PUPR2, 9 }, /* DU0_DG1 */ 2977 - { RCAR_GP_PIN(2, 0), PUPR2, 10 }, /* DU0_DG2 */ 2978 - { RCAR_GP_PIN(2, 1), PUPR2, 11 }, /* DU0_DG3 */ 2979 - { RCAR_GP_PIN(2, 2), PUPR2, 12 }, /* DU0_DG4 */ 2980 - { RCAR_GP_PIN(2, 3), PUPR2, 13 }, /* DU0_DG5 */ 2981 - { RCAR_GP_PIN(2, 4), PUPR2, 14 }, /* DU0_DG6 */ 2982 - { RCAR_GP_PIN(2, 5), PUPR2, 15 }, /* DU0_DG7 */ 2983 - { RCAR_GP_PIN(2, 6), PUPR2, 16 }, /* DU0_DB0 */ 2984 - { RCAR_GP_PIN(2, 7), PUPR2, 17 }, /* DU0_DB1 */ 2985 - { RCAR_GP_PIN(2, 8), PUPR2, 18 }, /* DU0_DB2 */ 2986 - { RCAR_GP_PIN(2, 9), PUPR2, 19 }, /* DU0_DB3 */ 2987 - { RCAR_GP_PIN(2, 10), PUPR2, 20 }, /* DU0_DB4 */ 2988 - { RCAR_GP_PIN(2, 11), PUPR2, 21 }, /* DU0_DB5 */ 2989 - { RCAR_GP_PIN(2, 12), PUPR2, 22 }, /* DU0_DB6 */ 2990 - { RCAR_GP_PIN(2, 13), PUPR2, 23 }, /* DU0_DB7 */ 2991 - { RCAR_GP_PIN(2, 14), PUPR2, 24 }, /* DU0_DOTCLKIN */ 2992 - { RCAR_GP_PIN(2, 15), PUPR2, 25 }, /* DU0_DOTCLKOUT0 */ 2993 - { RCAR_GP_PIN(2, 17), PUPR2, 26 }, /* DU0_HSYNC */ 2994 - { RCAR_GP_PIN(2, 18), PUPR2, 27 }, /* DU0_VSYNC */ 2995 - { RCAR_GP_PIN(2, 19), PUPR2, 28 }, /* DU0_EXODDF */ 2996 - { RCAR_GP_PIN(2, 20), PUPR2, 29 }, /* DU0_DISP */ 2997 - { RCAR_GP_PIN(2, 21), PUPR2, 30 }, /* DU0_CDE */ 2998 - { RCAR_GP_PIN(2, 16), PUPR2, 31 }, /* DU0_DOTCLKOUT1 */ 2999 - 3000 - { RCAR_GP_PIN(3, 24), PUPR3, 0 }, /* VI0_CLK */ 3001 - { RCAR_GP_PIN(3, 25), PUPR3, 1 }, /* VI0_CLKENB */ 3002 - { RCAR_GP_PIN(3, 26), PUPR3, 2 }, /* VI0_FIELD */ 3003 - { RCAR_GP_PIN(3, 27), PUPR3, 3 }, /* /VI0_HSYNC */ 3004 - { RCAR_GP_PIN(3, 28), PUPR3, 4 }, /* /VI0_VSYNC */ 3005 - { RCAR_GP_PIN(3, 29), PUPR3, 5 }, /* VI0_DATA0 */ 3006 - { RCAR_GP_PIN(3, 30), PUPR3, 6 }, /* VI0_DATA1 */ 3007 - { RCAR_GP_PIN(3, 31), PUPR3, 7 }, /* VI0_DATA2 */ 3008 - { RCAR_GP_PIN(4, 0), PUPR3, 8 }, /* VI0_DATA3 */ 3009 - { RCAR_GP_PIN(4, 1), PUPR3, 9 }, /* VI0_DATA4 */ 3010 - { RCAR_GP_PIN(4, 2), PUPR3, 10 }, /* VI0_DATA5 */ 3011 - { RCAR_GP_PIN(4, 3), PUPR3, 11 }, /* VI0_DATA6 */ 3012 - { RCAR_GP_PIN(4, 4), PUPR3, 12 }, /* VI0_DATA7 */ 3013 - { RCAR_GP_PIN(4, 5), PUPR3, 13 }, /* VI0_G2 */ 3014 - { RCAR_GP_PIN(4, 6), PUPR3, 14 }, /* VI0_G3 */ 3015 - { RCAR_GP_PIN(4, 7), PUPR3, 15 }, /* VI0_G4 */ 3016 - { RCAR_GP_PIN(4, 8), PUPR3, 16 }, /* VI0_G5 */ 3017 - { RCAR_GP_PIN(4, 21), PUPR3, 17 }, /* VI1_DATA12 */ 3018 - { RCAR_GP_PIN(4, 22), PUPR3, 18 }, /* VI1_DATA13 */ 3019 - { RCAR_GP_PIN(4, 23), PUPR3, 19 }, /* VI1_DATA14 */ 3020 - { RCAR_GP_PIN(4, 24), PUPR3, 20 }, /* VI1_DATA15 */ 3021 - { RCAR_GP_PIN(4, 9), PUPR3, 21 }, /* ETH_REF_CLK */ 3022 - { RCAR_GP_PIN(4, 10), PUPR3, 22 }, /* ETH_TXD0 */ 3023 - { RCAR_GP_PIN(4, 11), PUPR3, 23 }, /* ETH_TXD1 */ 3024 - { RCAR_GP_PIN(4, 12), PUPR3, 24 }, /* ETH_CRS_DV */ 3025 - { RCAR_GP_PIN(4, 13), PUPR3, 25 }, /* ETH_TX_EN */ 3026 - { RCAR_GP_PIN(4, 14), PUPR3, 26 }, /* ETH_RX_ER */ 3027 - { RCAR_GP_PIN(4, 15), PUPR3, 27 }, /* ETH_RXD0 */ 3028 - { RCAR_GP_PIN(4, 16), PUPR3, 28 }, /* ETH_RXD1 */ 3029 - { RCAR_GP_PIN(4, 17), PUPR3, 29 }, /* ETH_MDC */ 3030 - { RCAR_GP_PIN(4, 18), PUPR3, 30 }, /* ETH_MDIO */ 3031 - { RCAR_GP_PIN(4, 19), PUPR3, 31 }, /* ETH_LINK */ 3032 - 3033 - { RCAR_GP_PIN(3, 6), PUPR4, 0 }, /* SSI_SCK012 */ 3034 - { RCAR_GP_PIN(3, 7), PUPR4, 1 }, /* SSI_WS012 */ 3035 - { RCAR_GP_PIN(3, 10), PUPR4, 2 }, /* SSI_SDATA0 */ 3036 - { RCAR_GP_PIN(3, 9), PUPR4, 3 }, /* SSI_SDATA1 */ 3037 - { RCAR_GP_PIN(3, 8), PUPR4, 4 }, /* SSI_SDATA2 */ 3038 - { RCAR_GP_PIN(3, 2), PUPR4, 5 }, /* SSI_SCK34 */ 3039 - { RCAR_GP_PIN(3, 3), PUPR4, 6 }, /* SSI_WS34 */ 3040 - { RCAR_GP_PIN(3, 5), PUPR4, 7 }, /* SSI_SDATA3 */ 3041 - { RCAR_GP_PIN(3, 4), PUPR4, 8 }, /* SSI_SDATA4 */ 3042 - { RCAR_GP_PIN(2, 31), PUPR4, 9 }, /* SSI_SCK5 */ 3043 - { RCAR_GP_PIN(3, 0), PUPR4, 10 }, /* SSI_WS5 */ 3044 - { RCAR_GP_PIN(3, 1), PUPR4, 11 }, /* SSI_SDATA5 */ 3045 - { RCAR_GP_PIN(2, 28), PUPR4, 12 }, /* SSI_SCK6 */ 3046 - { RCAR_GP_PIN(2, 29), PUPR4, 13 }, /* SSI_WS6 */ 3047 - { RCAR_GP_PIN(2, 30), PUPR4, 14 }, /* SSI_SDATA6 */ 3048 - { RCAR_GP_PIN(2, 24), PUPR4, 15 }, /* SSI_SCK78 */ 3049 - { RCAR_GP_PIN(2, 25), PUPR4, 16 }, /* SSI_WS78 */ 3050 - { RCAR_GP_PIN(2, 27), PUPR4, 17 }, /* SSI_SDATA7 */ 3051 - { RCAR_GP_PIN(2, 26), PUPR4, 18 }, /* SSI_SDATA8 */ 3052 - { RCAR_GP_PIN(3, 23), PUPR4, 19 }, /* TCLK0 */ 3053 - { RCAR_GP_PIN(3, 11), PUPR4, 20 }, /* SD0_CLK */ 3054 - { RCAR_GP_PIN(3, 12), PUPR4, 21 }, /* SD0_CMD */ 3055 - { RCAR_GP_PIN(3, 13), PUPR4, 22 }, /* SD0_DAT0 */ 3056 - { RCAR_GP_PIN(3, 14), PUPR4, 23 }, /* SD0_DAT1 */ 3057 - { RCAR_GP_PIN(3, 15), PUPR4, 24 }, /* SD0_DAT2 */ 3058 - { RCAR_GP_PIN(3, 16), PUPR4, 25 }, /* SD0_DAT3 */ 3059 - { RCAR_GP_PIN(3, 17), PUPR4, 26 }, /* SD0_CD */ 3060 - { RCAR_GP_PIN(3, 18), PUPR4, 27 }, /* SD0_WP */ 3061 - { RCAR_GP_PIN(2, 22), PUPR4, 28 }, /* AUDIO_CLKA */ 3062 - { RCAR_GP_PIN(2, 23), PUPR4, 29 }, /* AUDIO_CLKB */ 3063 - { RCAR_GP_PIN(1, 14), PUPR4, 30 }, /* IRQ2 */ 3064 - { RCAR_GP_PIN(1, 15), PUPR4, 31 }, /* IRQ3 */ 3065 - 3066 - { RCAR_GP_PIN(0, 1), PUPR5, 0 }, /* PENC0 */ 3067 - { RCAR_GP_PIN(0, 2), PUPR5, 1 }, /* PENC1 */ 3068 - { RCAR_GP_PIN(0, 3), PUPR5, 2 }, /* USB_OVC0 */ 3069 - { RCAR_GP_PIN(0, 4), PUPR5, 3 }, /* USB_OVC1 */ 3070 - { RCAR_GP_PIN(1, 16), PUPR5, 4 }, /* SCIF_CLK */ 3071 - { RCAR_GP_PIN(1, 17), PUPR5, 5 }, /* TX0 */ 3072 - { RCAR_GP_PIN(1, 18), PUPR5, 6 }, /* RX0 */ 3073 - { RCAR_GP_PIN(1, 19), PUPR5, 7 }, /* SCK0 */ 3074 - { RCAR_GP_PIN(1, 20), PUPR5, 8 }, /* /CTS0 */ 3075 - { RCAR_GP_PIN(1, 21), PUPR5, 9 }, /* /RTS0 */ 3076 - { RCAR_GP_PIN(3, 19), PUPR5, 10 }, /* HSPI_CLK0 */ 3077 - { RCAR_GP_PIN(3, 20), PUPR5, 11 }, /* /HSPI_CS0 */ 3078 - { RCAR_GP_PIN(3, 21), PUPR5, 12 }, /* HSPI_RX0 */ 3079 - { RCAR_GP_PIN(3, 22), PUPR5, 13 }, /* HSPI_TX0 */ 3080 - { RCAR_GP_PIN(4, 20), PUPR5, 14 }, /* ETH_MAGIC */ 3081 - { RCAR_GP_PIN(4, 25), PUPR5, 15 }, /* AVS1 */ 3082 - { RCAR_GP_PIN(4, 26), PUPR5, 16 }, /* AVS2 */ 2917 + static const struct pinmux_bias_reg pinmux_bias_regs[] = { 2918 + { PINMUX_BIAS_REG("PUPR0", 0x100, "N/A", 0) { 2919 + [ 0] = RCAR_GP_PIN(0, 6), /* A0 */ 2920 + [ 1] = RCAR_GP_PIN(0, 7), /* A1 */ 2921 + [ 2] = RCAR_GP_PIN(0, 8), /* A2 */ 2922 + [ 3] = RCAR_GP_PIN(0, 9), /* A3 */ 2923 + [ 4] = RCAR_GP_PIN(0, 10), /* A4 */ 2924 + [ 5] = RCAR_GP_PIN(0, 11), /* A5 */ 2925 + [ 6] = RCAR_GP_PIN(0, 12), /* A6 */ 2926 + [ 7] = RCAR_GP_PIN(0, 13), /* A7 */ 2927 + [ 8] = RCAR_GP_PIN(0, 14), /* A8 */ 2928 + [ 9] = RCAR_GP_PIN(0, 15), /* A9 */ 2929 + [10] = RCAR_GP_PIN(0, 16), /* A10 */ 2930 + [11] = RCAR_GP_PIN(0, 17), /* A11 */ 2931 + [12] = RCAR_GP_PIN(0, 18), /* A12 */ 2932 + [13] = RCAR_GP_PIN(0, 19), /* A13 */ 2933 + [14] = RCAR_GP_PIN(0, 20), /* A14 */ 2934 + [15] = RCAR_GP_PIN(0, 21), /* A15 */ 2935 + [16] = RCAR_GP_PIN(0, 22), /* A16 */ 2936 + [17] = RCAR_GP_PIN(0, 23), /* A17 */ 2937 + [18] = RCAR_GP_PIN(0, 24), /* A18 */ 2938 + [19] = RCAR_GP_PIN(0, 25), /* A19 */ 2939 + [20] = RCAR_GP_PIN(0, 26), /* A20 */ 2940 + [21] = RCAR_GP_PIN(0, 27), /* A21 */ 2941 + [22] = RCAR_GP_PIN(0, 28), /* A22 */ 2942 + [23] = RCAR_GP_PIN(0, 29), /* A23 */ 2943 + [24] = RCAR_GP_PIN(0, 30), /* A24 */ 2944 + [25] = RCAR_GP_PIN(0, 31), /* A25 */ 2945 + [26] = RCAR_GP_PIN(1, 3), /* /EX_CS0 */ 2946 + [27] = RCAR_GP_PIN(1, 4), /* /EX_CS1 */ 2947 + [28] = RCAR_GP_PIN(1, 5), /* /EX_CS2 */ 2948 + [29] = RCAR_GP_PIN(1, 6), /* /EX_CS3 */ 2949 + [30] = RCAR_GP_PIN(1, 7), /* /EX_CS4 */ 2950 + [31] = RCAR_GP_PIN(1, 8), /* /EX_CS5 */ 2951 + } }, 2952 + { PINMUX_BIAS_REG("PUPR1", 0x104, "N/A", 0) { 2953 + [ 0] = RCAR_GP_PIN(0, 0), /* /PRESETOUT */ 2954 + [ 1] = RCAR_GP_PIN(0, 5), /* /BS */ 2955 + [ 2] = RCAR_GP_PIN(1, 0), /* RD//WR */ 2956 + [ 3] = RCAR_GP_PIN(1, 1), /* /WE0 */ 2957 + [ 4] = RCAR_GP_PIN(1, 2), /* /WE1 */ 2958 + [ 5] = RCAR_GP_PIN(1, 11), /* EX_WAIT0 */ 2959 + [ 6] = RCAR_GP_PIN(1, 9), /* DREQ0 */ 2960 + [ 7] = RCAR_GP_PIN(1, 10), /* DACK0 */ 2961 + [ 8] = RCAR_GP_PIN(1, 12), /* IRQ0 */ 2962 + [ 9] = RCAR_GP_PIN(1, 13), /* IRQ1 */ 2963 + [10] = PIN_NONE, 2964 + [11] = PIN_NONE, 2965 + [12] = PIN_NONE, 2966 + [13] = PIN_NONE, 2967 + [14] = PIN_NONE, 2968 + [15] = PIN_NONE, 2969 + [16] = PIN_NONE, 2970 + [17] = PIN_NONE, 2971 + [18] = PIN_NONE, 2972 + [19] = PIN_NONE, 2973 + [20] = PIN_NONE, 2974 + [21] = PIN_NONE, 2975 + [22] = PIN_NONE, 2976 + [23] = PIN_NONE, 2977 + [24] = PIN_NONE, 2978 + [25] = PIN_NONE, 2979 + [26] = PIN_NONE, 2980 + [27] = PIN_NONE, 2981 + [28] = PIN_NONE, 2982 + [29] = PIN_NONE, 2983 + [30] = PIN_NONE, 2984 + [31] = PIN_NONE, 2985 + } }, 2986 + { PINMUX_BIAS_REG("PUPR2", 0x108, "N/A", 0) { 2987 + [ 0] = RCAR_GP_PIN(1, 22), /* DU0_DR0 */ 2988 + [ 1] = RCAR_GP_PIN(1, 23), /* DU0_DR1 */ 2989 + [ 2] = RCAR_GP_PIN(1, 24), /* DU0_DR2 */ 2990 + [ 3] = RCAR_GP_PIN(1, 25), /* DU0_DR3 */ 2991 + [ 4] = RCAR_GP_PIN(1, 26), /* DU0_DR4 */ 2992 + [ 5] = RCAR_GP_PIN(1, 27), /* DU0_DR5 */ 2993 + [ 6] = RCAR_GP_PIN(1, 28), /* DU0_DR6 */ 2994 + [ 7] = RCAR_GP_PIN(1, 29), /* DU0_DR7 */ 2995 + [ 8] = RCAR_GP_PIN(1, 30), /* DU0_DG0 */ 2996 + [ 9] = RCAR_GP_PIN(1, 31), /* DU0_DG1 */ 2997 + [10] = RCAR_GP_PIN(2, 0), /* DU0_DG2 */ 2998 + [11] = RCAR_GP_PIN(2, 1), /* DU0_DG3 */ 2999 + [12] = RCAR_GP_PIN(2, 2), /* DU0_DG4 */ 3000 + [13] = RCAR_GP_PIN(2, 3), /* DU0_DG5 */ 3001 + [14] = RCAR_GP_PIN(2, 4), /* DU0_DG6 */ 3002 + [15] = RCAR_GP_PIN(2, 5), /* DU0_DG7 */ 3003 + [16] = RCAR_GP_PIN(2, 6), /* DU0_DB0 */ 3004 + [17] = RCAR_GP_PIN(2, 7), /* DU0_DB1 */ 3005 + [18] = RCAR_GP_PIN(2, 8), /* DU0_DB2 */ 3006 + [19] = RCAR_GP_PIN(2, 9), /* DU0_DB3 */ 3007 + [20] = RCAR_GP_PIN(2, 10), /* DU0_DB4 */ 3008 + [21] = RCAR_GP_PIN(2, 11), /* DU0_DB5 */ 3009 + [22] = RCAR_GP_PIN(2, 12), /* DU0_DB6 */ 3010 + [23] = RCAR_GP_PIN(2, 13), /* DU0_DB7 */ 3011 + [24] = RCAR_GP_PIN(2, 14), /* DU0_DOTCLKIN */ 3012 + [25] = RCAR_GP_PIN(2, 15), /* DU0_DOTCLKOUT0 */ 3013 + [26] = RCAR_GP_PIN(2, 17), /* DU0_HSYNC */ 3014 + [27] = RCAR_GP_PIN(2, 18), /* DU0_VSYNC */ 3015 + [28] = RCAR_GP_PIN(2, 19), /* DU0_EXODDF */ 3016 + [29] = RCAR_GP_PIN(2, 20), /* DU0_DISP */ 3017 + [30] = RCAR_GP_PIN(2, 21), /* DU0_CDE */ 3018 + [31] = RCAR_GP_PIN(2, 16), /* DU0_DOTCLKOUT1 */ 3019 + } }, 3020 + { PINMUX_BIAS_REG("PUPR3", 0x10c, "N/A", 0) { 3021 + [ 0] = RCAR_GP_PIN(3, 24), /* VI0_CLK */ 3022 + [ 1] = RCAR_GP_PIN(3, 25), /* VI0_CLKENB */ 3023 + [ 2] = RCAR_GP_PIN(3, 26), /* VI0_FIELD */ 3024 + [ 3] = RCAR_GP_PIN(3, 27), /* /VI0_HSYNC */ 3025 + [ 4] = RCAR_GP_PIN(3, 28), /* /VI0_VSYNC */ 3026 + [ 5] = RCAR_GP_PIN(3, 29), /* VI0_DATA0 */ 3027 + [ 6] = RCAR_GP_PIN(3, 30), /* VI0_DATA1 */ 3028 + [ 7] = RCAR_GP_PIN(3, 31), /* VI0_DATA2 */ 3029 + [ 8] = RCAR_GP_PIN(4, 0), /* VI0_DATA3 */ 3030 + [ 9] = RCAR_GP_PIN(4, 1), /* VI0_DATA4 */ 3031 + [10] = RCAR_GP_PIN(4, 2), /* VI0_DATA5 */ 3032 + [11] = RCAR_GP_PIN(4, 3), /* VI0_DATA6 */ 3033 + [12] = RCAR_GP_PIN(4, 4), /* VI0_DATA7 */ 3034 + [13] = RCAR_GP_PIN(4, 5), /* VI0_G2 */ 3035 + [14] = RCAR_GP_PIN(4, 6), /* VI0_G3 */ 3036 + [15] = RCAR_GP_PIN(4, 7), /* VI0_G4 */ 3037 + [16] = RCAR_GP_PIN(4, 8), /* VI0_G5 */ 3038 + [17] = RCAR_GP_PIN(4, 21), /* VI1_DATA12 */ 3039 + [18] = RCAR_GP_PIN(4, 22), /* VI1_DATA13 */ 3040 + [19] = RCAR_GP_PIN(4, 23), /* VI1_DATA14 */ 3041 + [20] = RCAR_GP_PIN(4, 24), /* VI1_DATA15 */ 3042 + [21] = RCAR_GP_PIN(4, 9), /* ETH_REF_CLK */ 3043 + [22] = RCAR_GP_PIN(4, 10), /* ETH_TXD0 */ 3044 + [23] = RCAR_GP_PIN(4, 11), /* ETH_TXD1 */ 3045 + [24] = RCAR_GP_PIN(4, 12), /* ETH_CRS_DV */ 3046 + [25] = RCAR_GP_PIN(4, 13), /* ETH_TX_EN */ 3047 + [26] = RCAR_GP_PIN(4, 14), /* ETH_RX_ER */ 3048 + [27] = RCAR_GP_PIN(4, 15), /* ETH_RXD0 */ 3049 + [28] = RCAR_GP_PIN(4, 16), /* ETH_RXD1 */ 3050 + [29] = RCAR_GP_PIN(4, 17), /* ETH_MDC */ 3051 + [30] = RCAR_GP_PIN(4, 18), /* ETH_MDIO */ 3052 + [31] = RCAR_GP_PIN(4, 19), /* ETH_LINK */ 3053 + } }, 3054 + { PINMUX_BIAS_REG("PUPR4", 0x110, "N/A", 0) { 3055 + [ 0] = RCAR_GP_PIN(3, 6), /* SSI_SCK012 */ 3056 + [ 1] = RCAR_GP_PIN(3, 7), /* SSI_WS012 */ 3057 + [ 2] = RCAR_GP_PIN(3, 10), /* SSI_SDATA0 */ 3058 + [ 3] = RCAR_GP_PIN(3, 9), /* SSI_SDATA1 */ 3059 + [ 4] = RCAR_GP_PIN(3, 8), /* SSI_SDATA2 */ 3060 + [ 5] = RCAR_GP_PIN(3, 2), /* SSI_SCK34 */ 3061 + [ 6] = RCAR_GP_PIN(3, 3), /* SSI_WS34 */ 3062 + [ 7] = RCAR_GP_PIN(3, 5), /* SSI_SDATA3 */ 3063 + [ 8] = RCAR_GP_PIN(3, 4), /* SSI_SDATA4 */ 3064 + [ 9] = RCAR_GP_PIN(2, 31), /* SSI_SCK5 */ 3065 + [10] = RCAR_GP_PIN(3, 0), /* SSI_WS5 */ 3066 + [11] = RCAR_GP_PIN(3, 1), /* SSI_SDATA5 */ 3067 + [12] = RCAR_GP_PIN(2, 28), /* SSI_SCK6 */ 3068 + [13] = RCAR_GP_PIN(2, 29), /* SSI_WS6 */ 3069 + [14] = RCAR_GP_PIN(2, 30), /* SSI_SDATA6 */ 3070 + [15] = RCAR_GP_PIN(2, 24), /* SSI_SCK78 */ 3071 + [16] = RCAR_GP_PIN(2, 25), /* SSI_WS78 */ 3072 + [17] = RCAR_GP_PIN(2, 27), /* SSI_SDATA7 */ 3073 + [18] = RCAR_GP_PIN(2, 26), /* SSI_SDATA8 */ 3074 + [19] = RCAR_GP_PIN(3, 23), /* TCLK0 */ 3075 + [20] = RCAR_GP_PIN(3, 11), /* SD0_CLK */ 3076 + [21] = RCAR_GP_PIN(3, 12), /* SD0_CMD */ 3077 + [22] = RCAR_GP_PIN(3, 13), /* SD0_DAT0 */ 3078 + [23] = RCAR_GP_PIN(3, 14), /* SD0_DAT1 */ 3079 + [24] = RCAR_GP_PIN(3, 15), /* SD0_DAT2 */ 3080 + [25] = RCAR_GP_PIN(3, 16), /* SD0_DAT3 */ 3081 + [26] = RCAR_GP_PIN(3, 17), /* SD0_CD */ 3082 + [27] = RCAR_GP_PIN(3, 18), /* SD0_WP */ 3083 + [28] = RCAR_GP_PIN(2, 22), /* AUDIO_CLKA */ 3084 + [29] = RCAR_GP_PIN(2, 23), /* AUDIO_CLKB */ 3085 + [30] = RCAR_GP_PIN(1, 14), /* IRQ2 */ 3086 + [31] = RCAR_GP_PIN(1, 15), /* IRQ3 */ 3087 + } }, 3088 + { PINMUX_BIAS_REG("PUPR5", 0x114, "N/A", 0) { 3089 + [ 0] = RCAR_GP_PIN(0, 1), /* PENC0 */ 3090 + [ 1] = RCAR_GP_PIN(0, 2), /* PENC1 */ 3091 + [ 2] = RCAR_GP_PIN(0, 3), /* USB_OVC0 */ 3092 + [ 3] = RCAR_GP_PIN(0, 4), /* USB_OVC1 */ 3093 + [ 4] = RCAR_GP_PIN(1, 16), /* SCIF_CLK */ 3094 + [ 5] = RCAR_GP_PIN(1, 17), /* TX0 */ 3095 + [ 6] = RCAR_GP_PIN(1, 18), /* RX0 */ 3096 + [ 7] = RCAR_GP_PIN(1, 19), /* SCK0 */ 3097 + [ 8] = RCAR_GP_PIN(1, 20), /* /CTS0 */ 3098 + [ 9] = RCAR_GP_PIN(1, 21), /* /RTS0 */ 3099 + [10] = RCAR_GP_PIN(3, 19), /* HSPI_CLK0 */ 3100 + [11] = RCAR_GP_PIN(3, 20), /* /HSPI_CS0 */ 3101 + [12] = RCAR_GP_PIN(3, 21), /* HSPI_RX0 */ 3102 + [13] = RCAR_GP_PIN(3, 22), /* HSPI_TX0 */ 3103 + [14] = RCAR_GP_PIN(4, 20), /* ETH_MAGIC */ 3104 + [15] = RCAR_GP_PIN(4, 25), /* AVS1 */ 3105 + [16] = RCAR_GP_PIN(4, 26), /* AVS2 */ 3106 + [17] = PIN_NONE, 3107 + [18] = PIN_NONE, 3108 + [19] = PIN_NONE, 3109 + [20] = PIN_NONE, 3110 + [21] = PIN_NONE, 3111 + [22] = PIN_NONE, 3112 + [23] = PIN_NONE, 3113 + [24] = PIN_NONE, 3114 + [25] = PIN_NONE, 3115 + [26] = PIN_NONE, 3116 + [27] = PIN_NONE, 3117 + [28] = PIN_NONE, 3118 + [29] = PIN_NONE, 3119 + [30] = PIN_NONE, 3120 + [31] = PIN_NONE, 3121 + } }, 3122 + { /* sentinel */ }, 3083 3123 }; 3084 3124 3085 3125 static unsigned int r8a7778_pinmux_get_bias(struct sh_pfc *pfc, 3086 3126 unsigned int pin) 3087 3127 { 3088 - const struct sh_pfc_bias_info *info; 3128 + const struct pinmux_bias_reg *reg; 3089 3129 void __iomem *addr; 3130 + unsigned int bit; 3090 3131 3091 - info = sh_pfc_pin_to_bias_info(bias_info, ARRAY_SIZE(bias_info), pin); 3092 - if (!info) 3132 + reg = sh_pfc_pin_to_bias_reg(pfc, pin, &bit); 3133 + if (!reg) 3093 3134 return PIN_CONFIG_BIAS_DISABLE; 3094 3135 3095 - addr = pfc->windows->virt + info->reg; 3136 + addr = pfc->windows->virt + reg->puen; 3096 3137 3097 - if (ioread32(addr) & BIT(info->bit)) 3138 + if (ioread32(addr) & BIT(bit)) 3098 3139 return PIN_CONFIG_BIAS_PULL_UP; 3099 3140 else 3100 3141 return PIN_CONFIG_BIAS_DISABLE; ··· 3144 3103 static void r8a7778_pinmux_set_bias(struct sh_pfc *pfc, unsigned int pin, 3145 3104 unsigned int bias) 3146 3105 { 3147 - const struct sh_pfc_bias_info *info; 3106 + const struct pinmux_bias_reg *reg; 3148 3107 void __iomem *addr; 3108 + unsigned int bit; 3149 3109 u32 value; 3150 - u32 bit; 3151 3110 3152 - info = sh_pfc_pin_to_bias_info(bias_info, ARRAY_SIZE(bias_info), pin); 3153 - if (!info) 3111 + reg = sh_pfc_pin_to_bias_reg(pfc, pin, &bit); 3112 + if (!reg) 3154 3113 return; 3155 3114 3156 - addr = pfc->windows->virt + info->reg; 3157 - bit = BIT(info->bit); 3115 + addr = pfc->windows->virt + reg->puen; 3158 3116 3159 - value = ioread32(addr) & ~bit; 3117 + value = ioread32(addr) & ~BIT(bit); 3160 3118 if (bias == PIN_CONFIG_BIAS_PULL_UP) 3161 - value |= bit; 3119 + value |= BIT(bit); 3162 3120 iowrite32(value, addr); 3163 3121 } 3164 3122 ··· 3184 3144 .nr_functions = ARRAY_SIZE(pinmux_functions), 3185 3145 3186 3146 .cfg_regs = pinmux_config_regs, 3147 + .bias_regs = pinmux_bias_regs, 3187 3148 3188 3149 .pinmux_data = pinmux_data, 3189 3150 .pinmux_data_size = ARRAY_SIZE(pinmux_data),
+1
drivers/pinctrl/sh-pfc/pfc-r8a7794.c
··· 5097 5097 #ifdef CONFIG_PINCTRL_PFC_R8A7745 5098 5098 const struct sh_pfc_soc_info r8a7745_pinmux_info = { 5099 5099 .name = "r8a77450_pfc", 5100 + .ops = &r8a7794_pinmux_ops, 5100 5101 .unlock_reg = 0xe6060000, /* PMMR */ 5101 5102 5102 5103 .function = { PINMUX_FUNCTION_BEGIN, PINMUX_FUNCTION_END },
+299 -243
drivers/pinctrl/sh-pfc/pfc-r8a7795-es1.c
··· 1443 1443 }; 1444 1444 1445 1445 /* 1446 - * R8A7795 has 8 banks with 32 PGIOS in each => 256 GPIOs. 1446 + * R8A7795 has 8 banks with 32 GPIOs in each => 256 GPIOs. 1447 1447 * Physical layout rows: A - AW, cols: 1 - 39. 1448 1448 */ 1449 1449 #define ROW_GROUP_A(r) ('Z' - 'A' + 1 + (r)) 1450 1450 #define PIN_NUMBER(r, c) (((r) - 'A') * 39 + (c) + 300) 1451 1451 #define PIN_A_NUMBER(r, c) PIN_NUMBER(ROW_GROUP_A(r), c) 1452 + #define PIN_NONE U16_MAX 1452 1453 1453 1454 static const struct sh_pfc_pin pinmux_pins[] = { 1454 1455 PINMUX_GPIO_GP_ALL(), ··· 3775 3774 USB2_PWEN_MARK, USB2_OVC_MARK, 3776 3775 }; 3777 3776 3777 + /* - USB30 ------------------------------------------------------------------ */ 3778 + static const unsigned int usb30_pins[] = { 3779 + /* PWEN, OVC */ 3780 + RCAR_GP_PIN(6, 28), RCAR_GP_PIN(6, 29), 3781 + }; 3782 + static const unsigned int usb30_mux[] = { 3783 + USB30_PWEN_MARK, USB30_OVC_MARK, 3784 + }; 3785 + /* - USB31 ------------------------------------------------------------------ */ 3786 + static const unsigned int usb31_pins[] = { 3787 + /* PWEN, OVC */ 3788 + RCAR_GP_PIN(6, 30), RCAR_GP_PIN(6, 31), 3789 + }; 3790 + static const unsigned int usb31_mux[] = { 3791 + USB31_PWEN_MARK, USB31_OVC_MARK, 3792 + }; 3793 + 3778 3794 static const struct sh_pfc_pin_group pinmux_groups[] = { 3779 3795 SH_PFC_PIN_GROUP(audio_clk_a_a), 3780 3796 SH_PFC_PIN_GROUP(audio_clk_a_b), ··· 4098 4080 SH_PFC_PIN_GROUP(usb0), 4099 4081 SH_PFC_PIN_GROUP(usb1), 4100 4082 SH_PFC_PIN_GROUP(usb2), 4083 + SH_PFC_PIN_GROUP(usb30), 4084 + SH_PFC_PIN_GROUP(usb31), 4101 4085 }; 4102 4086 4103 4087 static const char * const audio_clk_groups[] = { ··· 4557 4537 "usb2", 4558 4538 }; 4559 4539 4540 + static const char * const usb30_groups[] = { 4541 + "usb30", 4542 + }; 4543 + 4544 + static const char * const usb31_groups[] = { 4545 + "usb31", 4546 + }; 4547 + 4560 4548 static const struct sh_pfc_function pinmux_functions[] = { 4561 4549 SH_PFC_FUNCTION(audio_clk), 4562 4550 SH_PFC_FUNCTION(avb), ··· 4616 4588 SH_PFC_FUNCTION(usb0), 4617 4589 SH_PFC_FUNCTION(usb1), 4618 4590 SH_PFC_FUNCTION(usb2), 4591 + SH_PFC_FUNCTION(usb30), 4592 + SH_PFC_FUNCTION(usb31), 4619 4593 }; 4620 4594 4621 4595 static const struct pinmux_cfg_reg pinmux_config_regs[] = { ··· 5423 5393 { }, 5424 5394 }; 5425 5395 5396 + enum ioctrl_regs { 5397 + POCCTRL, 5398 + }; 5399 + 5400 + static const struct pinmux_ioctrl_reg pinmux_ioctrl_regs[] = { 5401 + [POCCTRL] = { 0xe6060380, }, 5402 + { /* sentinel */ }, 5403 + }; 5404 + 5426 5405 static int r8a7795es1_pin_to_pocctrl(struct sh_pfc *pfc, unsigned int pin, 5427 5406 u32 *pocctrl) 5428 5407 { 5429 5408 int bit = -EINVAL; 5430 5409 5431 - *pocctrl = 0xe6060380; 5410 + *pocctrl = pinmux_ioctrl_regs[POCCTRL].reg; 5432 5411 5433 5412 if (pin >= RCAR_GP_PIN(3, 0) && pin <= RCAR_GP_PIN(3, 11)) 5434 5413 bit = pin & 0x1f; ··· 5448 5409 return bit; 5449 5410 } 5450 5411 5451 - #define PUEN 0xe6060400 5452 - #define PUD 0xe6060440 5453 - 5454 - #define PU0 0x00 5455 - #define PU1 0x04 5456 - #define PU2 0x08 5457 - #define PU3 0x0c 5458 - #define PU4 0x10 5459 - #define PU5 0x14 5460 - #define PU6 0x18 5461 - 5462 - static const struct sh_pfc_bias_info bias_info[] = { 5463 - { RCAR_GP_PIN(2, 11), PU0, 31 }, /* AVB_PHY_INT */ 5464 - { RCAR_GP_PIN(2, 10), PU0, 30 }, /* AVB_MAGIC */ 5465 - { RCAR_GP_PIN(2, 9), PU0, 29 }, /* AVB_MDC */ 5466 - { PIN_NUMBER('A', 9), PU0, 28 }, /* AVB_MDIO */ 5467 - { PIN_NUMBER('A', 12), PU0, 27 }, /* AVB_TXCREFCLK */ 5468 - { PIN_NUMBER('B', 17), PU0, 26 }, /* AVB_TD3 */ 5469 - { PIN_NUMBER('A', 17), PU0, 25 }, /* AVB_TD2 */ 5470 - { PIN_NUMBER('B', 18), PU0, 24 }, /* AVB_TD1 */ 5471 - { PIN_NUMBER('A', 18), PU0, 23 }, /* AVB_TD0 */ 5472 - { PIN_NUMBER('A', 19), PU0, 22 }, /* AVB_TXC */ 5473 - { PIN_NUMBER('A', 8), PU0, 21 }, /* AVB_TX_CTL */ 5474 - { PIN_NUMBER('B', 14), PU0, 20 }, /* AVB_RD3 */ 5475 - { PIN_NUMBER('A', 14), PU0, 19 }, /* AVB_RD2 */ 5476 - { PIN_NUMBER('B', 13), PU0, 18 }, /* AVB_RD1 */ 5477 - { PIN_NUMBER('A', 13), PU0, 17 }, /* AVB_RD0 */ 5478 - { PIN_NUMBER('B', 19), PU0, 16 }, /* AVB_RXC */ 5479 - { PIN_NUMBER('A', 16), PU0, 15 }, /* AVB_RX_CTL */ 5480 - { PIN_NUMBER('V', 7), PU0, 14 }, /* RPC_RESET# */ 5481 - { PIN_NUMBER('V', 6), PU0, 13 }, /* RPC_WP# */ 5482 - { PIN_NUMBER('Y', 7), PU0, 12 }, /* RPC_INT# */ 5483 - { PIN_NUMBER('V', 5), PU0, 11 }, /* QSPI1_SSL */ 5484 - { PIN_A_NUMBER('C', 3), PU0, 10 }, /* QSPI1_IO3 */ 5485 - { PIN_A_NUMBER('E', 4), PU0, 9 }, /* QSPI1_IO2 */ 5486 - { PIN_A_NUMBER('E', 5), PU0, 8 }, /* QSPI1_MISO_IO1 */ 5487 - { PIN_A_NUMBER('C', 7), PU0, 7 }, /* QSPI1_MOSI_IO0 */ 5488 - { PIN_NUMBER('V', 3), PU0, 6 }, /* QSPI1_SPCLK */ 5489 - { PIN_NUMBER('Y', 3), PU0, 5 }, /* QSPI0_SSL */ 5490 - { PIN_A_NUMBER('B', 6), PU0, 4 }, /* QSPI0_IO3 */ 5491 - { PIN_NUMBER('Y', 6), PU0, 3 }, /* QSPI0_IO2 */ 5492 - { PIN_A_NUMBER('B', 4), PU0, 2 }, /* QSPI0_MISO_IO1 */ 5493 - { PIN_A_NUMBER('C', 5), PU0, 1 }, /* QSPI0_MOSI_IO0 */ 5494 - { PIN_NUMBER('W', 3), PU0, 0 }, /* QSPI0_SPCLK */ 5495 - 5496 - { RCAR_GP_PIN(1, 19), PU1, 31 }, /* A19 */ 5497 - { RCAR_GP_PIN(1, 18), PU1, 30 }, /* A18 */ 5498 - { RCAR_GP_PIN(1, 17), PU1, 29 }, /* A17 */ 5499 - { RCAR_GP_PIN(1, 16), PU1, 28 }, /* A16 */ 5500 - { RCAR_GP_PIN(1, 15), PU1, 27 }, /* A15 */ 5501 - { RCAR_GP_PIN(1, 14), PU1, 26 }, /* A14 */ 5502 - { RCAR_GP_PIN(1, 13), PU1, 25 }, /* A13 */ 5503 - { RCAR_GP_PIN(1, 12), PU1, 24 }, /* A12 */ 5504 - { RCAR_GP_PIN(1, 11), PU1, 23 }, /* A11 */ 5505 - { RCAR_GP_PIN(1, 10), PU1, 22 }, /* A10 */ 5506 - { RCAR_GP_PIN(1, 9), PU1, 21 }, /* A9 */ 5507 - { RCAR_GP_PIN(1, 8), PU1, 20 }, /* A8 */ 5508 - { RCAR_GP_PIN(1, 7), PU1, 19 }, /* A7 */ 5509 - { RCAR_GP_PIN(1, 6), PU1, 18 }, /* A6 */ 5510 - { RCAR_GP_PIN(1, 5), PU1, 17 }, /* A5 */ 5511 - { RCAR_GP_PIN(1, 4), PU1, 16 }, /* A4 */ 5512 - { RCAR_GP_PIN(1, 3), PU1, 15 }, /* A3 */ 5513 - { RCAR_GP_PIN(1, 2), PU1, 14 }, /* A2 */ 5514 - { RCAR_GP_PIN(1, 1), PU1, 13 }, /* A1 */ 5515 - { RCAR_GP_PIN(1, 0), PU1, 12 }, /* A0 */ 5516 - { RCAR_GP_PIN(2, 8), PU1, 11 }, /* PWM2_A */ 5517 - { RCAR_GP_PIN(2, 7), PU1, 10 }, /* PWM1_A */ 5518 - { RCAR_GP_PIN(2, 6), PU1, 9 }, /* PWM0 */ 5519 - { RCAR_GP_PIN(2, 5), PU1, 8 }, /* IRQ5 */ 5520 - { RCAR_GP_PIN(2, 4), PU1, 7 }, /* IRQ4 */ 5521 - { RCAR_GP_PIN(2, 3), PU1, 6 }, /* IRQ3 */ 5522 - { RCAR_GP_PIN(2, 2), PU1, 5 }, /* IRQ2 */ 5523 - { RCAR_GP_PIN(2, 1), PU1, 4 }, /* IRQ1 */ 5524 - { RCAR_GP_PIN(2, 0), PU1, 3 }, /* IRQ0 */ 5525 - { RCAR_GP_PIN(2, 14), PU1, 2 }, /* AVB_AVTP_CAPTURE_A */ 5526 - { RCAR_GP_PIN(2, 13), PU1, 1 }, /* AVB_AVTP_MATCH_A */ 5527 - { RCAR_GP_PIN(2, 12), PU1, 0 }, /* AVB_LINK */ 5528 - 5529 - { PIN_A_NUMBER('P', 8), PU2, 31 }, /* DU_DOTCLKIN1 */ 5530 - { PIN_A_NUMBER('P', 7), PU2, 30 }, /* DU_DOTCLKIN0 */ 5531 - { RCAR_GP_PIN(7, 3), PU2, 29 }, /* HDMI1_CEC */ 5532 - { RCAR_GP_PIN(7, 2), PU2, 28 }, /* HDMI0_CEC */ 5533 - { RCAR_GP_PIN(7, 1), PU2, 27 }, /* AVS2 */ 5534 - { RCAR_GP_PIN(7, 0), PU2, 26 }, /* AVS1 */ 5535 - { RCAR_GP_PIN(0, 15), PU2, 25 }, /* D15 */ 5536 - { RCAR_GP_PIN(0, 14), PU2, 24 }, /* D14 */ 5537 - { RCAR_GP_PIN(0, 13), PU2, 23 }, /* D13 */ 5538 - { RCAR_GP_PIN(0, 12), PU2, 22 }, /* D12 */ 5539 - { RCAR_GP_PIN(0, 11), PU2, 21 }, /* D11 */ 5540 - { RCAR_GP_PIN(0, 10), PU2, 20 }, /* D10 */ 5541 - { RCAR_GP_PIN(0, 9), PU2, 19 }, /* D9 */ 5542 - { RCAR_GP_PIN(0, 8), PU2, 18 }, /* D8 */ 5543 - { RCAR_GP_PIN(0, 7), PU2, 17 }, /* D7 */ 5544 - { RCAR_GP_PIN(0, 6), PU2, 16 }, /* D6 */ 5545 - { RCAR_GP_PIN(0, 5), PU2, 15 }, /* D5 */ 5546 - { RCAR_GP_PIN(0, 4), PU2, 14 }, /* D4 */ 5547 - { RCAR_GP_PIN(0, 3), PU2, 13 }, /* D3 */ 5548 - { RCAR_GP_PIN(0, 2), PU2, 12 }, /* D2 */ 5549 - { RCAR_GP_PIN(0, 1), PU2, 11 }, /* D1 */ 5550 - { RCAR_GP_PIN(0, 0), PU2, 10 }, /* D0 */ 5551 - { PIN_NUMBER('C', 1), PU2, 9 }, /* PRESETOUT# */ 5552 - { RCAR_GP_PIN(1, 27), PU2, 8 }, /* EX_WAIT0_A */ 5553 - { RCAR_GP_PIN(1, 26), PU2, 7 }, /* WE1_N */ 5554 - { RCAR_GP_PIN(1, 25), PU2, 6 }, /* WE0_N */ 5555 - { RCAR_GP_PIN(1, 24), PU2, 5 }, /* RD_WR_N */ 5556 - { RCAR_GP_PIN(1, 23), PU2, 4 }, /* RD_N */ 5557 - { RCAR_GP_PIN(1, 22), PU2, 3 }, /* BS_N */ 5558 - { RCAR_GP_PIN(1, 21), PU2, 2 }, /* CS1_N_A26 */ 5559 - { RCAR_GP_PIN(1, 20), PU2, 1 }, /* CS0_N */ 5560 - { PIN_NUMBER('F', 1), PU2, 0 }, /* CLKOUT */ 5561 - 5562 - { RCAR_GP_PIN(4, 9), PU3, 31 }, /* SD3_DAT0 */ 5563 - { RCAR_GP_PIN(4, 8), PU3, 30 }, /* SD3_CMD */ 5564 - { RCAR_GP_PIN(4, 7), PU3, 29 }, /* SD3_CLK */ 5565 - { RCAR_GP_PIN(4, 6), PU3, 28 }, /* SD2_DS */ 5566 - { RCAR_GP_PIN(4, 5), PU3, 27 }, /* SD2_DAT3 */ 5567 - { RCAR_GP_PIN(4, 4), PU3, 26 }, /* SD2_DAT2 */ 5568 - { RCAR_GP_PIN(4, 3), PU3, 25 }, /* SD2_DAT1 */ 5569 - { RCAR_GP_PIN(4, 2), PU3, 24 }, /* SD2_DAT0 */ 5570 - { RCAR_GP_PIN(4, 1), PU3, 23 }, /* SD2_CMD */ 5571 - { RCAR_GP_PIN(4, 0), PU3, 22 }, /* SD2_CLK */ 5572 - { RCAR_GP_PIN(3, 11), PU3, 21 }, /* SD1_DAT3 */ 5573 - { RCAR_GP_PIN(3, 10), PU3, 20 }, /* SD1_DAT2 */ 5574 - { RCAR_GP_PIN(3, 9), PU3, 19 }, /* SD1_DAT1 */ 5575 - { RCAR_GP_PIN(3, 8), PU3, 18 }, /* SD1_DAT0 */ 5576 - { RCAR_GP_PIN(3, 7), PU3, 17 }, /* SD1_CMD */ 5577 - { RCAR_GP_PIN(3, 6), PU3, 16 }, /* SD1_CLK */ 5578 - { RCAR_GP_PIN(3, 5), PU3, 15 }, /* SD0_DAT3 */ 5579 - { RCAR_GP_PIN(3, 4), PU3, 14 }, /* SD0_DAT2 */ 5580 - { RCAR_GP_PIN(3, 3), PU3, 13 }, /* SD0_DAT1 */ 5581 - { RCAR_GP_PIN(3, 2), PU3, 12 }, /* SD0_DAT0 */ 5582 - { RCAR_GP_PIN(3, 1), PU3, 11 }, /* SD0_CMD */ 5583 - { RCAR_GP_PIN(3, 0), PU3, 10 }, /* SD0_CLK */ 5584 - { PIN_A_NUMBER('T', 30), PU3, 9 }, /* ASEBRK */ 5585 - /* bit 8 n/a */ 5586 - { PIN_A_NUMBER('R', 29), PU3, 7 }, /* TDI */ 5587 - { PIN_A_NUMBER('R', 30), PU3, 6 }, /* TMS */ 5588 - { PIN_A_NUMBER('T', 27), PU3, 5 }, /* TCK */ 5589 - { PIN_A_NUMBER('R', 26), PU3, 4 }, /* TRST# */ 5590 - { PIN_A_NUMBER('D', 39), PU3, 3 }, /* EXTALR*/ 5591 - { PIN_A_NUMBER('D', 38), PU3, 2 }, /* FSCLKST# */ 5592 - { PIN_A_NUMBER('R', 8), PU3, 1 }, /* DU_DOTCLKIN3 */ 5593 - { PIN_A_NUMBER('R', 7), PU3, 0 }, /* DU_DOTCLKIN2 */ 5594 - 5595 - { RCAR_GP_PIN(5, 19), PU4, 31 }, /* MSIOF0_SS1 */ 5596 - { RCAR_GP_PIN(5, 18), PU4, 30 }, /* MSIOF0_SYNC */ 5597 - { RCAR_GP_PIN(5, 17), PU4, 29 }, /* MSIOF0_SCK */ 5598 - { RCAR_GP_PIN(5, 16), PU4, 28 }, /* HRTS0_N */ 5599 - { RCAR_GP_PIN(5, 15), PU4, 27 }, /* HCTS0_N */ 5600 - { RCAR_GP_PIN(5, 14), PU4, 26 }, /* HTX0 */ 5601 - { RCAR_GP_PIN(5, 13), PU4, 25 }, /* HRX0 */ 5602 - { RCAR_GP_PIN(5, 12), PU4, 24 }, /* HSCK0 */ 5603 - { RCAR_GP_PIN(5, 11), PU4, 23 }, /* RX2_A */ 5604 - { RCAR_GP_PIN(5, 10), PU4, 22 }, /* TX2_A */ 5605 - { RCAR_GP_PIN(5, 9), PU4, 21 }, /* SCK2 */ 5606 - { RCAR_GP_PIN(5, 8), PU4, 20 }, /* RTS1_N_TANS */ 5607 - { RCAR_GP_PIN(5, 7), PU4, 19 }, /* CTS1_N */ 5608 - { RCAR_GP_PIN(5, 6), PU4, 18 }, /* TX1_A */ 5609 - { RCAR_GP_PIN(5, 5), PU4, 17 }, /* RX1_A */ 5610 - { RCAR_GP_PIN(5, 4), PU4, 16 }, /* RTS0_N_TANS */ 5611 - { RCAR_GP_PIN(5, 3), PU4, 15 }, /* CTS0_N */ 5612 - { RCAR_GP_PIN(5, 2), PU4, 14 }, /* TX0 */ 5613 - { RCAR_GP_PIN(5, 1), PU4, 13 }, /* RX0 */ 5614 - { RCAR_GP_PIN(5, 0), PU4, 12 }, /* SCK0 */ 5615 - { RCAR_GP_PIN(3, 15), PU4, 11 }, /* SD1_WP */ 5616 - { RCAR_GP_PIN(3, 14), PU4, 10 }, /* SD1_CD */ 5617 - { RCAR_GP_PIN(3, 13), PU4, 9 }, /* SD0_WP */ 5618 - { RCAR_GP_PIN(3, 12), PU4, 8 }, /* SD0_CD */ 5619 - { RCAR_GP_PIN(4, 17), PU4, 7 }, /* SD3_DS */ 5620 - { RCAR_GP_PIN(4, 16), PU4, 6 }, /* SD3_DAT7 */ 5621 - { RCAR_GP_PIN(4, 15), PU4, 5 }, /* SD3_DAT6 */ 5622 - { RCAR_GP_PIN(4, 14), PU4, 4 }, /* SD3_DAT5 */ 5623 - { RCAR_GP_PIN(4, 13), PU4, 3 }, /* SD3_DAT4 */ 5624 - { RCAR_GP_PIN(4, 12), PU4, 2 }, /* SD3_DAT3 */ 5625 - { RCAR_GP_PIN(4, 11), PU4, 1 }, /* SD3_DAT2 */ 5626 - { RCAR_GP_PIN(4, 10), PU4, 0 }, /* SD3_DAT1 */ 5627 - 5628 - { RCAR_GP_PIN(6, 24), PU5, 31 }, /* USB0_PWEN */ 5629 - { RCAR_GP_PIN(6, 23), PU5, 30 }, /* AUDIO_CLKB_B */ 5630 - { RCAR_GP_PIN(6, 22), PU5, 29 }, /* AUDIO_CLKA_A */ 5631 - { RCAR_GP_PIN(6, 21), PU5, 28 }, /* SSI_SDATA9_A */ 5632 - { RCAR_GP_PIN(6, 20), PU5, 27 }, /* SSI_SDATA8 */ 5633 - { RCAR_GP_PIN(6, 19), PU5, 26 }, /* SSI_SDATA7 */ 5634 - { RCAR_GP_PIN(6, 18), PU5, 25 }, /* SSI_WS78 */ 5635 - { RCAR_GP_PIN(6, 17), PU5, 24 }, /* SSI_SCK78 */ 5636 - { RCAR_GP_PIN(6, 16), PU5, 23 }, /* SSI_SDATA6 */ 5637 - { RCAR_GP_PIN(6, 15), PU5, 22 }, /* SSI_WS6 */ 5638 - { RCAR_GP_PIN(6, 14), PU5, 21 }, /* SSI_SCK6 */ 5639 - { RCAR_GP_PIN(6, 13), PU5, 20 }, /* SSI_SDATA5 */ 5640 - { RCAR_GP_PIN(6, 12), PU5, 19 }, /* SSI_WS5 */ 5641 - { RCAR_GP_PIN(6, 11), PU5, 18 }, /* SSI_SCK5 */ 5642 - { RCAR_GP_PIN(6, 10), PU5, 17 }, /* SSI_SDATA4 */ 5643 - { RCAR_GP_PIN(6, 9), PU5, 16 }, /* SSI_WS4 */ 5644 - { RCAR_GP_PIN(6, 8), PU5, 15 }, /* SSI_SCK4 */ 5645 - { RCAR_GP_PIN(6, 7), PU5, 14 }, /* SSI_SDATA3 */ 5646 - { RCAR_GP_PIN(6, 6), PU5, 13 }, /* SSI_WS349 */ 5647 - { RCAR_GP_PIN(6, 5), PU5, 12 }, /* SSI_SCK349 */ 5648 - { RCAR_GP_PIN(6, 4), PU5, 11 }, /* SSI_SDATA2_A */ 5649 - { RCAR_GP_PIN(6, 3), PU5, 10 }, /* SSI_SDATA1_A */ 5650 - { RCAR_GP_PIN(6, 2), PU5, 9 }, /* SSI_SDATA0 */ 5651 - { RCAR_GP_PIN(6, 1), PU5, 8 }, /* SSI_WS01239 */ 5652 - { RCAR_GP_PIN(6, 0), PU5, 7 }, /* SSI_SCK01239 */ 5653 - { PIN_NUMBER('H', 37), PU5, 6 }, /* MLB_REF */ 5654 - { RCAR_GP_PIN(5, 25), PU5, 5 }, /* MLB_DAT */ 5655 - { RCAR_GP_PIN(5, 24), PU5, 4 }, /* MLB_SIG */ 5656 - { RCAR_GP_PIN(5, 23), PU5, 3 }, /* MLB_CLK */ 5657 - { RCAR_GP_PIN(5, 22), PU5, 2 }, /* MSIOF0_RXD */ 5658 - { RCAR_GP_PIN(5, 21), PU5, 1 }, /* MSIOF0_SS2 */ 5659 - { RCAR_GP_PIN(5, 20), PU5, 0 }, /* MSIOF0_TXD */ 5660 - 5661 - { RCAR_GP_PIN(6, 31), PU6, 6 }, /* USB31_OVC */ 5662 - { RCAR_GP_PIN(6, 30), PU6, 5 }, /* USB31_PWEN */ 5663 - { RCAR_GP_PIN(6, 29), PU6, 4 }, /* USB30_OVC */ 5664 - { RCAR_GP_PIN(6, 28), PU6, 3 }, /* USB30_PWEN */ 5665 - { RCAR_GP_PIN(6, 27), PU6, 2 }, /* USB1_OVC */ 5666 - { RCAR_GP_PIN(6, 26), PU6, 1 }, /* USB1_PWEN */ 5667 - { RCAR_GP_PIN(6, 25), PU6, 0 }, /* USB0_OVC */ 5412 + static const struct pinmux_bias_reg pinmux_bias_regs[] = { 5413 + { PINMUX_BIAS_REG("PUEN0", 0xe6060400, "PUD0", 0xe6060440) { 5414 + [ 0] = PIN_NUMBER('W', 3), /* QSPI0_SPCLK */ 5415 + [ 1] = PIN_A_NUMBER('C', 5), /* QSPI0_MOSI_IO0 */ 5416 + [ 2] = PIN_A_NUMBER('B', 4), /* QSPI0_MISO_IO1 */ 5417 + [ 3] = PIN_NUMBER('Y', 6), /* QSPI0_IO2 */ 5418 + [ 4] = PIN_A_NUMBER('B', 6), /* QSPI0_IO3 */ 5419 + [ 5] = PIN_NUMBER('Y', 3), /* QSPI0_SSL */ 5420 + [ 6] = PIN_NUMBER('V', 3), /* QSPI1_SPCLK */ 5421 + [ 7] = PIN_A_NUMBER('C', 7), /* QSPI1_MOSI_IO0 */ 5422 + [ 8] = PIN_A_NUMBER('E', 5), /* QSPI1_MISO_IO1 */ 5423 + [ 9] = PIN_A_NUMBER('E', 4), /* QSPI1_IO2 */ 5424 + [10] = PIN_A_NUMBER('C', 3), /* QSPI1_IO3 */ 5425 + [11] = PIN_NUMBER('V', 5), /* QSPI1_SSL */ 5426 + [12] = PIN_NUMBER('Y', 7), /* RPC_INT# */ 5427 + [13] = PIN_NUMBER('V', 6), /* RPC_WP# */ 5428 + [14] = PIN_NUMBER('V', 7), /* RPC_RESET# */ 5429 + [15] = PIN_NUMBER('A', 16), /* AVB_RX_CTL */ 5430 + [16] = PIN_NUMBER('B', 19), /* AVB_RXC */ 5431 + [17] = PIN_NUMBER('A', 13), /* AVB_RD0 */ 5432 + [18] = PIN_NUMBER('B', 13), /* AVB_RD1 */ 5433 + [19] = PIN_NUMBER('A', 14), /* AVB_RD2 */ 5434 + [20] = PIN_NUMBER('B', 14), /* AVB_RD3 */ 5435 + [21] = PIN_NUMBER('A', 8), /* AVB_TX_CTL */ 5436 + [22] = PIN_NUMBER('A', 19), /* AVB_TXC */ 5437 + [23] = PIN_NUMBER('A', 18), /* AVB_TD0 */ 5438 + [24] = PIN_NUMBER('B', 18), /* AVB_TD1 */ 5439 + [25] = PIN_NUMBER('A', 17), /* AVB_TD2 */ 5440 + [26] = PIN_NUMBER('B', 17), /* AVB_TD3 */ 5441 + [27] = PIN_NUMBER('A', 12), /* AVB_TXCREFCLK */ 5442 + [28] = PIN_NUMBER('A', 9), /* AVB_MDIO */ 5443 + [29] = RCAR_GP_PIN(2, 9), /* AVB_MDC */ 5444 + [30] = RCAR_GP_PIN(2, 10), /* AVB_MAGIC */ 5445 + [31] = RCAR_GP_PIN(2, 11), /* AVB_PHY_INT */ 5446 + } }, 5447 + { PINMUX_BIAS_REG("PUEN1", 0xe6060404, "PUD1", 0xe6060444) { 5448 + [ 0] = RCAR_GP_PIN(2, 12), /* AVB_LINK */ 5449 + [ 1] = RCAR_GP_PIN(2, 13), /* AVB_AVTP_MATCH_A */ 5450 + [ 2] = RCAR_GP_PIN(2, 14), /* AVB_AVTP_CAPTURE_A */ 5451 + [ 3] = RCAR_GP_PIN(2, 0), /* IRQ0 */ 5452 + [ 4] = RCAR_GP_PIN(2, 1), /* IRQ1 */ 5453 + [ 5] = RCAR_GP_PIN(2, 2), /* IRQ2 */ 5454 + [ 6] = RCAR_GP_PIN(2, 3), /* IRQ3 */ 5455 + [ 7] = RCAR_GP_PIN(2, 4), /* IRQ4 */ 5456 + [ 8] = RCAR_GP_PIN(2, 5), /* IRQ5 */ 5457 + [ 9] = RCAR_GP_PIN(2, 6), /* PWM0 */ 5458 + [10] = RCAR_GP_PIN(2, 7), /* PWM1_A */ 5459 + [11] = RCAR_GP_PIN(2, 8), /* PWM2_A */ 5460 + [12] = RCAR_GP_PIN(1, 0), /* A0 */ 5461 + [13] = RCAR_GP_PIN(1, 1), /* A1 */ 5462 + [14] = RCAR_GP_PIN(1, 2), /* A2 */ 5463 + [15] = RCAR_GP_PIN(1, 3), /* A3 */ 5464 + [16] = RCAR_GP_PIN(1, 4), /* A4 */ 5465 + [17] = RCAR_GP_PIN(1, 5), /* A5 */ 5466 + [18] = RCAR_GP_PIN(1, 6), /* A6 */ 5467 + [19] = RCAR_GP_PIN(1, 7), /* A7 */ 5468 + [20] = RCAR_GP_PIN(1, 8), /* A8 */ 5469 + [21] = RCAR_GP_PIN(1, 9), /* A9 */ 5470 + [22] = RCAR_GP_PIN(1, 10), /* A10 */ 5471 + [23] = RCAR_GP_PIN(1, 11), /* A11 */ 5472 + [24] = RCAR_GP_PIN(1, 12), /* A12 */ 5473 + [25] = RCAR_GP_PIN(1, 13), /* A13 */ 5474 + [26] = RCAR_GP_PIN(1, 14), /* A14 */ 5475 + [27] = RCAR_GP_PIN(1, 15), /* A15 */ 5476 + [28] = RCAR_GP_PIN(1, 16), /* A16 */ 5477 + [29] = RCAR_GP_PIN(1, 17), /* A17 */ 5478 + [30] = RCAR_GP_PIN(1, 18), /* A18 */ 5479 + [31] = RCAR_GP_PIN(1, 19), /* A19 */ 5480 + } }, 5481 + { PINMUX_BIAS_REG("PUEN2", 0xe6060408, "PUD2", 0xe6060448) { 5482 + [ 0] = PIN_NUMBER('F', 1), /* CLKOUT */ 5483 + [ 1] = RCAR_GP_PIN(1, 20), /* CS0_N */ 5484 + [ 2] = RCAR_GP_PIN(1, 21), /* CS1_N_A26 */ 5485 + [ 3] = RCAR_GP_PIN(1, 22), /* BS_N */ 5486 + [ 4] = RCAR_GP_PIN(1, 23), /* RD_N */ 5487 + [ 5] = RCAR_GP_PIN(1, 24), /* RD_WR_N */ 5488 + [ 6] = RCAR_GP_PIN(1, 25), /* WE0_N */ 5489 + [ 7] = RCAR_GP_PIN(1, 26), /* WE1_N */ 5490 + [ 8] = RCAR_GP_PIN(1, 27), /* EX_WAIT0_A */ 5491 + [ 9] = PIN_NUMBER('C', 1), /* PRESETOUT# */ 5492 + [10] = RCAR_GP_PIN(0, 0), /* D0 */ 5493 + [11] = RCAR_GP_PIN(0, 1), /* D1 */ 5494 + [12] = RCAR_GP_PIN(0, 2), /* D2 */ 5495 + [13] = RCAR_GP_PIN(0, 3), /* D3 */ 5496 + [14] = RCAR_GP_PIN(0, 4), /* D4 */ 5497 + [15] = RCAR_GP_PIN(0, 5), /* D5 */ 5498 + [16] = RCAR_GP_PIN(0, 6), /* D6 */ 5499 + [17] = RCAR_GP_PIN(0, 7), /* D7 */ 5500 + [18] = RCAR_GP_PIN(0, 8), /* D8 */ 5501 + [19] = RCAR_GP_PIN(0, 9), /* D9 */ 5502 + [20] = RCAR_GP_PIN(0, 10), /* D10 */ 5503 + [21] = RCAR_GP_PIN(0, 11), /* D11 */ 5504 + [22] = RCAR_GP_PIN(0, 12), /* D12 */ 5505 + [23] = RCAR_GP_PIN(0, 13), /* D13 */ 5506 + [24] = RCAR_GP_PIN(0, 14), /* D14 */ 5507 + [25] = RCAR_GP_PIN(0, 15), /* D15 */ 5508 + [26] = RCAR_GP_PIN(7, 0), /* AVS1 */ 5509 + [27] = RCAR_GP_PIN(7, 1), /* AVS2 */ 5510 + [28] = RCAR_GP_PIN(7, 2), /* HDMI0_CEC */ 5511 + [29] = RCAR_GP_PIN(7, 3), /* HDMI1_CEC */ 5512 + [30] = PIN_A_NUMBER('P', 7), /* DU_DOTCLKIN0 */ 5513 + [31] = PIN_A_NUMBER('P', 8), /* DU_DOTCLKIN1 */ 5514 + } }, 5515 + { PINMUX_BIAS_REG("PUEN3", 0xe606040c, "PUD3", 0xe606044c) { 5516 + [ 0] = PIN_A_NUMBER('R', 7), /* DU_DOTCLKIN2 */ 5517 + [ 1] = PIN_A_NUMBER('R', 8), /* DU_DOTCLKIN3 */ 5518 + [ 2] = PIN_A_NUMBER('D', 38), /* FSCLKST# */ 5519 + [ 3] = PIN_A_NUMBER('D', 39), /* EXTALR*/ 5520 + [ 4] = PIN_A_NUMBER('R', 26), /* TRST# */ 5521 + [ 5] = PIN_A_NUMBER('T', 27), /* TCK */ 5522 + [ 6] = PIN_A_NUMBER('R', 30), /* TMS */ 5523 + [ 7] = PIN_A_NUMBER('R', 29), /* TDI */ 5524 + [ 8] = PIN_NONE, 5525 + [ 9] = PIN_A_NUMBER('T', 30), /* ASEBRK */ 5526 + [10] = RCAR_GP_PIN(3, 0), /* SD0_CLK */ 5527 + [11] = RCAR_GP_PIN(3, 1), /* SD0_CMD */ 5528 + [12] = RCAR_GP_PIN(3, 2), /* SD0_DAT0 */ 5529 + [13] = RCAR_GP_PIN(3, 3), /* SD0_DAT1 */ 5530 + [14] = RCAR_GP_PIN(3, 4), /* SD0_DAT2 */ 5531 + [15] = RCAR_GP_PIN(3, 5), /* SD0_DAT3 */ 5532 + [16] = RCAR_GP_PIN(3, 6), /* SD1_CLK */ 5533 + [17] = RCAR_GP_PIN(3, 7), /* SD1_CMD */ 5534 + [18] = RCAR_GP_PIN(3, 8), /* SD1_DAT0 */ 5535 + [19] = RCAR_GP_PIN(3, 9), /* SD1_DAT1 */ 5536 + [20] = RCAR_GP_PIN(3, 10), /* SD1_DAT2 */ 5537 + [21] = RCAR_GP_PIN(3, 11), /* SD1_DAT3 */ 5538 + [22] = RCAR_GP_PIN(4, 0), /* SD2_CLK */ 5539 + [23] = RCAR_GP_PIN(4, 1), /* SD2_CMD */ 5540 + [24] = RCAR_GP_PIN(4, 2), /* SD2_DAT0 */ 5541 + [25] = RCAR_GP_PIN(4, 3), /* SD2_DAT1 */ 5542 + [26] = RCAR_GP_PIN(4, 4), /* SD2_DAT2 */ 5543 + [27] = RCAR_GP_PIN(4, 5), /* SD2_DAT3 */ 5544 + [28] = RCAR_GP_PIN(4, 6), /* SD2_DS */ 5545 + [29] = RCAR_GP_PIN(4, 7), /* SD3_CLK */ 5546 + [30] = RCAR_GP_PIN(4, 8), /* SD3_CMD */ 5547 + [31] = RCAR_GP_PIN(4, 9), /* SD3_DAT0 */ 5548 + } }, 5549 + { PINMUX_BIAS_REG("PUEN4", 0xe6060410, "PUD4", 0xe6060450) { 5550 + [ 0] = RCAR_GP_PIN(4, 10), /* SD3_DAT1 */ 5551 + [ 1] = RCAR_GP_PIN(4, 11), /* SD3_DAT2 */ 5552 + [ 2] = RCAR_GP_PIN(4, 12), /* SD3_DAT3 */ 5553 + [ 3] = RCAR_GP_PIN(4, 13), /* SD3_DAT4 */ 5554 + [ 4] = RCAR_GP_PIN(4, 14), /* SD3_DAT5 */ 5555 + [ 5] = RCAR_GP_PIN(4, 15), /* SD3_DAT6 */ 5556 + [ 6] = RCAR_GP_PIN(4, 16), /* SD3_DAT7 */ 5557 + [ 7] = RCAR_GP_PIN(4, 17), /* SD3_DS */ 5558 + [ 8] = RCAR_GP_PIN(3, 12), /* SD0_CD */ 5559 + [ 9] = RCAR_GP_PIN(3, 13), /* SD0_WP */ 5560 + [10] = RCAR_GP_PIN(3, 14), /* SD1_CD */ 5561 + [11] = RCAR_GP_PIN(3, 15), /* SD1_WP */ 5562 + [12] = RCAR_GP_PIN(5, 0), /* SCK0 */ 5563 + [13] = RCAR_GP_PIN(5, 1), /* RX0 */ 5564 + [14] = RCAR_GP_PIN(5, 2), /* TX0 */ 5565 + [15] = RCAR_GP_PIN(5, 3), /* CTS0_N */ 5566 + [16] = RCAR_GP_PIN(5, 4), /* RTS0_N_TANS */ 5567 + [17] = RCAR_GP_PIN(5, 5), /* RX1_A */ 5568 + [18] = RCAR_GP_PIN(5, 6), /* TX1_A */ 5569 + [19] = RCAR_GP_PIN(5, 7), /* CTS1_N */ 5570 + [20] = RCAR_GP_PIN(5, 8), /* RTS1_N_TANS */ 5571 + [21] = RCAR_GP_PIN(5, 9), /* SCK2 */ 5572 + [22] = RCAR_GP_PIN(5, 10), /* TX2_A */ 5573 + [23] = RCAR_GP_PIN(5, 11), /* RX2_A */ 5574 + [24] = RCAR_GP_PIN(5, 12), /* HSCK0 */ 5575 + [25] = RCAR_GP_PIN(5, 13), /* HRX0 */ 5576 + [26] = RCAR_GP_PIN(5, 14), /* HTX0 */ 5577 + [27] = RCAR_GP_PIN(5, 15), /* HCTS0_N */ 5578 + [28] = RCAR_GP_PIN(5, 16), /* HRTS0_N */ 5579 + [29] = RCAR_GP_PIN(5, 17), /* MSIOF0_SCK */ 5580 + [30] = RCAR_GP_PIN(5, 18), /* MSIOF0_SYNC */ 5581 + [31] = RCAR_GP_PIN(5, 19), /* MSIOF0_SS1 */ 5582 + } }, 5583 + { PINMUX_BIAS_REG("PUEN5", 0xe6060414, "PUD5", 0xe6060454) { 5584 + [ 0] = RCAR_GP_PIN(5, 20), /* MSIOF0_TXD */ 5585 + [ 1] = RCAR_GP_PIN(5, 21), /* MSIOF0_SS2 */ 5586 + [ 2] = RCAR_GP_PIN(5, 22), /* MSIOF0_RXD */ 5587 + [ 3] = RCAR_GP_PIN(5, 23), /* MLB_CLK */ 5588 + [ 4] = RCAR_GP_PIN(5, 24), /* MLB_SIG */ 5589 + [ 5] = RCAR_GP_PIN(5, 25), /* MLB_DAT */ 5590 + [ 6] = PIN_NUMBER('H', 37), /* MLB_REF */ 5591 + [ 7] = RCAR_GP_PIN(6, 0), /* SSI_SCK01239 */ 5592 + [ 8] = RCAR_GP_PIN(6, 1), /* SSI_WS01239 */ 5593 + [ 9] = RCAR_GP_PIN(6, 2), /* SSI_SDATA0 */ 5594 + [10] = RCAR_GP_PIN(6, 3), /* SSI_SDATA1_A */ 5595 + [11] = RCAR_GP_PIN(6, 4), /* SSI_SDATA2_A */ 5596 + [12] = RCAR_GP_PIN(6, 5), /* SSI_SCK349 */ 5597 + [13] = RCAR_GP_PIN(6, 6), /* SSI_WS349 */ 5598 + [14] = RCAR_GP_PIN(6, 7), /* SSI_SDATA3 */ 5599 + [15] = RCAR_GP_PIN(6, 8), /* SSI_SCK4 */ 5600 + [16] = RCAR_GP_PIN(6, 9), /* SSI_WS4 */ 5601 + [17] = RCAR_GP_PIN(6, 10), /* SSI_SDATA4 */ 5602 + [18] = RCAR_GP_PIN(6, 11), /* SSI_SCK5 */ 5603 + [19] = RCAR_GP_PIN(6, 12), /* SSI_WS5 */ 5604 + [20] = RCAR_GP_PIN(6, 13), /* SSI_SDATA5 */ 5605 + [21] = RCAR_GP_PIN(6, 14), /* SSI_SCK6 */ 5606 + [22] = RCAR_GP_PIN(6, 15), /* SSI_WS6 */ 5607 + [23] = RCAR_GP_PIN(6, 16), /* SSI_SDATA6 */ 5608 + [24] = RCAR_GP_PIN(6, 17), /* SSI_SCK78 */ 5609 + [25] = RCAR_GP_PIN(6, 18), /* SSI_WS78 */ 5610 + [26] = RCAR_GP_PIN(6, 19), /* SSI_SDATA7 */ 5611 + [27] = RCAR_GP_PIN(6, 20), /* SSI_SDATA8 */ 5612 + [28] = RCAR_GP_PIN(6, 21), /* SSI_SDATA9_A */ 5613 + [29] = RCAR_GP_PIN(6, 22), /* AUDIO_CLKA_A */ 5614 + [30] = RCAR_GP_PIN(6, 23), /* AUDIO_CLKB_B */ 5615 + [31] = RCAR_GP_PIN(6, 24), /* USB0_PWEN */ 5616 + } }, 5617 + { PINMUX_BIAS_REG("PUEN6", 0xe6060418, "PUD6", 0xe6060458) { 5618 + [ 0] = RCAR_GP_PIN(6, 25), /* USB0_OVC */ 5619 + [ 1] = RCAR_GP_PIN(6, 26), /* USB1_PWEN */ 5620 + [ 2] = RCAR_GP_PIN(6, 27), /* USB1_OVC */ 5621 + [ 3] = RCAR_GP_PIN(6, 28), /* USB30_PWEN */ 5622 + [ 4] = RCAR_GP_PIN(6, 29), /* USB30_OVC */ 5623 + [ 5] = RCAR_GP_PIN(6, 30), /* USB31_PWEN */ 5624 + [ 6] = RCAR_GP_PIN(6, 31), /* USB31_OVC */ 5625 + [ 7] = PIN_NONE, 5626 + [ 8] = PIN_NONE, 5627 + [ 9] = PIN_NONE, 5628 + [10] = PIN_NONE, 5629 + [11] = PIN_NONE, 5630 + [12] = PIN_NONE, 5631 + [13] = PIN_NONE, 5632 + [14] = PIN_NONE, 5633 + [15] = PIN_NONE, 5634 + [16] = PIN_NONE, 5635 + [17] = PIN_NONE, 5636 + [18] = PIN_NONE, 5637 + [19] = PIN_NONE, 5638 + [20] = PIN_NONE, 5639 + [21] = PIN_NONE, 5640 + [22] = PIN_NONE, 5641 + [23] = PIN_NONE, 5642 + [24] = PIN_NONE, 5643 + [25] = PIN_NONE, 5644 + [26] = PIN_NONE, 5645 + [27] = PIN_NONE, 5646 + [28] = PIN_NONE, 5647 + [29] = PIN_NONE, 5648 + [30] = PIN_NONE, 5649 + [31] = PIN_NONE, 5650 + } }, 5651 + { /* sentinel */ }, 5668 5652 }; 5669 5653 5670 5654 static unsigned int r8a7795es1_pinmux_get_bias(struct sh_pfc *pfc, 5671 5655 unsigned int pin) 5672 5656 { 5673 - const struct sh_pfc_bias_info *info; 5674 - u32 reg; 5675 - u32 bit; 5657 + const struct pinmux_bias_reg *reg; 5658 + unsigned int bit; 5676 5659 5677 - info = sh_pfc_pin_to_bias_info(bias_info, ARRAY_SIZE(bias_info), pin); 5678 - if (!info) 5660 + reg = sh_pfc_pin_to_bias_reg(pfc, pin, &bit); 5661 + if (!reg) 5679 5662 return PIN_CONFIG_BIAS_DISABLE; 5680 5663 5681 - reg = info->reg; 5682 - bit = BIT(info->bit); 5683 - 5684 - if (!(sh_pfc_read_reg(pfc, PUEN + reg, 32) & bit)) 5664 + if (!(sh_pfc_read(pfc, reg->puen) & BIT(bit))) 5685 5665 return PIN_CONFIG_BIAS_DISABLE; 5686 - else if (sh_pfc_read_reg(pfc, PUD + reg, 32) & bit) 5666 + else if (sh_pfc_read(pfc, reg->pud) & BIT(bit)) 5687 5667 return PIN_CONFIG_BIAS_PULL_UP; 5688 5668 else 5689 5669 return PIN_CONFIG_BIAS_PULL_DOWN; ··· 5711 5653 static void r8a7795es1_pinmux_set_bias(struct sh_pfc *pfc, unsigned int pin, 5712 5654 unsigned int bias) 5713 5655 { 5714 - const struct sh_pfc_bias_info *info; 5656 + const struct pinmux_bias_reg *reg; 5715 5657 u32 enable, updown; 5716 - u32 reg; 5717 - u32 bit; 5658 + unsigned int bit; 5718 5659 5719 - info = sh_pfc_pin_to_bias_info(bias_info, ARRAY_SIZE(bias_info), pin); 5720 - if (!info) 5660 + reg = sh_pfc_pin_to_bias_reg(pfc, pin, &bit); 5661 + if (!reg) 5721 5662 return; 5722 5663 5723 - reg = info->reg; 5724 - bit = BIT(info->bit); 5725 - 5726 - enable = sh_pfc_read_reg(pfc, PUEN + reg, 32) & ~bit; 5664 + enable = sh_pfc_read(pfc, reg->puen) & ~BIT(bit); 5727 5665 if (bias != PIN_CONFIG_BIAS_DISABLE) 5728 - enable |= bit; 5666 + enable |= BIT(bit); 5729 5667 5730 - updown = sh_pfc_read_reg(pfc, PUD + reg, 32) & ~bit; 5668 + updown = sh_pfc_read(pfc, reg->pud) & ~BIT(bit); 5731 5669 if (bias == PIN_CONFIG_BIAS_PULL_UP) 5732 - updown |= bit; 5670 + updown |= BIT(bit); 5733 5671 5734 - sh_pfc_write_reg(pfc, PUD + reg, 32, updown); 5735 - sh_pfc_write_reg(pfc, PUEN + reg, 32, enable); 5672 + sh_pfc_write(pfc, reg->pud, updown); 5673 + sh_pfc_write(pfc, reg->puen, enable); 5736 5674 } 5737 5675 5738 5676 static const struct sh_pfc_soc_operations r8a7795es1_pinmux_ops = { ··· 5753 5699 5754 5700 .cfg_regs = pinmux_config_regs, 5755 5701 .drive_regs = pinmux_drive_regs, 5702 + .bias_regs = pinmux_bias_regs, 5703 + .ioctrl_regs = pinmux_ioctrl_regs, 5756 5704 5757 5705 .pinmux_data = pinmux_data, 5758 5706 .pinmux_data_size = ARRAY_SIZE(pinmux_data),
+1661 -243
drivers/pinctrl/sh-pfc/pfc-r8a7795.c
··· 1508 1508 }; 1509 1509 1510 1510 /* 1511 - * R8A7795 has 8 banks with 32 PGIOS in each => 256 GPIOs. 1511 + * R8A7795 has 8 banks with 32 GPIOs in each => 256 GPIOs. 1512 1512 * Physical layout rows: A - AW, cols: 1 - 39. 1513 1513 */ 1514 1514 #define ROW_GROUP_A(r) ('Z' - 'A' + 1 + (r)) 1515 1515 #define PIN_NUMBER(r, c) (((r) - 'A') * 39 + (c) + 300) 1516 1516 #define PIN_A_NUMBER(r, c) PIN_NUMBER(ROW_GROUP_A(r), c) 1517 + #define PIN_NONE U16_MAX 1517 1518 1518 1519 static const struct sh_pfc_pin pinmux_pins[] = { 1519 1520 PINMUX_GPIO_GP_ALL(), ··· 1571 1570 SH_PFC_PIN_NAMED_CFG(ROW_GROUP_A('T'), 27, TCK, SH_PFC_PIN_CFG_PULL_UP | SH_PFC_PIN_CFG_PULL_DOWN), 1572 1571 SH_PFC_PIN_NAMED_CFG(ROW_GROUP_A('T'), 28, TDO, SH_PFC_PIN_CFG_DRIVE_STRENGTH), 1573 1572 SH_PFC_PIN_NAMED_CFG(ROW_GROUP_A('T'), 30, ASEBRK, CFG_FLAGS), 1573 + }; 1574 + 1575 + /* - AUDIO CLOCK ------------------------------------------------------------ */ 1576 + static const unsigned int audio_clk_a_a_pins[] = { 1577 + /* CLK A */ 1578 + RCAR_GP_PIN(6, 22), 1579 + }; 1580 + static const unsigned int audio_clk_a_a_mux[] = { 1581 + AUDIO_CLKA_A_MARK, 1582 + }; 1583 + static const unsigned int audio_clk_a_b_pins[] = { 1584 + /* CLK A */ 1585 + RCAR_GP_PIN(5, 4), 1586 + }; 1587 + static const unsigned int audio_clk_a_b_mux[] = { 1588 + AUDIO_CLKA_B_MARK, 1589 + }; 1590 + static const unsigned int audio_clk_a_c_pins[] = { 1591 + /* CLK A */ 1592 + RCAR_GP_PIN(5, 19), 1593 + }; 1594 + static const unsigned int audio_clk_a_c_mux[] = { 1595 + AUDIO_CLKA_C_MARK, 1596 + }; 1597 + static const unsigned int audio_clk_b_a_pins[] = { 1598 + /* CLK B */ 1599 + RCAR_GP_PIN(5, 12), 1600 + }; 1601 + static const unsigned int audio_clk_b_a_mux[] = { 1602 + AUDIO_CLKB_A_MARK, 1603 + }; 1604 + static const unsigned int audio_clk_b_b_pins[] = { 1605 + /* CLK B */ 1606 + RCAR_GP_PIN(6, 23), 1607 + }; 1608 + static const unsigned int audio_clk_b_b_mux[] = { 1609 + AUDIO_CLKB_B_MARK, 1610 + }; 1611 + static const unsigned int audio_clk_c_a_pins[] = { 1612 + /* CLK C */ 1613 + RCAR_GP_PIN(5, 21), 1614 + }; 1615 + static const unsigned int audio_clk_c_a_mux[] = { 1616 + AUDIO_CLKC_A_MARK, 1617 + }; 1618 + static const unsigned int audio_clk_c_b_pins[] = { 1619 + /* CLK C */ 1620 + RCAR_GP_PIN(5, 0), 1621 + }; 1622 + static const unsigned int audio_clk_c_b_mux[] = { 1623 + AUDIO_CLKC_B_MARK, 1624 + }; 1625 + static const unsigned int audio_clkout_a_pins[] = { 1626 + /* CLKOUT */ 1627 + RCAR_GP_PIN(5, 18), 1628 + }; 1629 + static const unsigned int audio_clkout_a_mux[] = { 1630 + AUDIO_CLKOUT_A_MARK, 1631 + }; 1632 + static const unsigned int audio_clkout_b_pins[] = { 1633 + /* CLKOUT */ 1634 + RCAR_GP_PIN(6, 28), 1635 + }; 1636 + static const unsigned int audio_clkout_b_mux[] = { 1637 + AUDIO_CLKOUT_B_MARK, 1638 + }; 1639 + static const unsigned int audio_clkout_c_pins[] = { 1640 + /* CLKOUT */ 1641 + RCAR_GP_PIN(5, 3), 1642 + }; 1643 + static const unsigned int audio_clkout_c_mux[] = { 1644 + AUDIO_CLKOUT_C_MARK, 1645 + }; 1646 + static const unsigned int audio_clkout_d_pins[] = { 1647 + /* CLKOUT */ 1648 + RCAR_GP_PIN(5, 21), 1649 + }; 1650 + static const unsigned int audio_clkout_d_mux[] = { 1651 + AUDIO_CLKOUT_D_MARK, 1652 + }; 1653 + static const unsigned int audio_clkout1_a_pins[] = { 1654 + /* CLKOUT1 */ 1655 + RCAR_GP_PIN(5, 15), 1656 + }; 1657 + static const unsigned int audio_clkout1_a_mux[] = { 1658 + AUDIO_CLKOUT1_A_MARK, 1659 + }; 1660 + static const unsigned int audio_clkout1_b_pins[] = { 1661 + /* CLKOUT1 */ 1662 + RCAR_GP_PIN(6, 29), 1663 + }; 1664 + static const unsigned int audio_clkout1_b_mux[] = { 1665 + AUDIO_CLKOUT1_B_MARK, 1666 + }; 1667 + static const unsigned int audio_clkout2_a_pins[] = { 1668 + /* CLKOUT2 */ 1669 + RCAR_GP_PIN(5, 16), 1670 + }; 1671 + static const unsigned int audio_clkout2_a_mux[] = { 1672 + AUDIO_CLKOUT2_A_MARK, 1673 + }; 1674 + static const unsigned int audio_clkout2_b_pins[] = { 1675 + /* CLKOUT2 */ 1676 + RCAR_GP_PIN(6, 30), 1677 + }; 1678 + static const unsigned int audio_clkout2_b_mux[] = { 1679 + AUDIO_CLKOUT2_B_MARK, 1680 + }; 1681 + static const unsigned int audio_clkout3_a_pins[] = { 1682 + /* CLKOUT3 */ 1683 + RCAR_GP_PIN(5, 19), 1684 + }; 1685 + static const unsigned int audio_clkout3_a_mux[] = { 1686 + AUDIO_CLKOUT3_A_MARK, 1687 + }; 1688 + static const unsigned int audio_clkout3_b_pins[] = { 1689 + /* CLKOUT3 */ 1690 + RCAR_GP_PIN(6, 31), 1691 + }; 1692 + static const unsigned int audio_clkout3_b_mux[] = { 1693 + AUDIO_CLKOUT3_B_MARK, 1574 1694 }; 1575 1695 1576 1696 /* - EtherAVB --------------------------------------------------------------- */ ··· 1781 1659 AVB_AVTP_CAPTURE_B_MARK, 1782 1660 }; 1783 1661 1662 + /* - DRIF0 --------------------------------------------------------------- */ 1663 + static const unsigned int drif0_ctrl_a_pins[] = { 1664 + /* CLK, SYNC */ 1665 + RCAR_GP_PIN(6, 8), RCAR_GP_PIN(6, 9), 1666 + }; 1667 + static const unsigned int drif0_ctrl_a_mux[] = { 1668 + RIF0_CLK_A_MARK, RIF0_SYNC_A_MARK, 1669 + }; 1670 + static const unsigned int drif0_data0_a_pins[] = { 1671 + /* D0 */ 1672 + RCAR_GP_PIN(6, 10), 1673 + }; 1674 + static const unsigned int drif0_data0_a_mux[] = { 1675 + RIF0_D0_A_MARK, 1676 + }; 1677 + static const unsigned int drif0_data1_a_pins[] = { 1678 + /* D1 */ 1679 + RCAR_GP_PIN(6, 7), 1680 + }; 1681 + static const unsigned int drif0_data1_a_mux[] = { 1682 + RIF0_D1_A_MARK, 1683 + }; 1684 + static const unsigned int drif0_ctrl_b_pins[] = { 1685 + /* CLK, SYNC */ 1686 + RCAR_GP_PIN(5, 0), RCAR_GP_PIN(5, 4), 1687 + }; 1688 + static const unsigned int drif0_ctrl_b_mux[] = { 1689 + RIF0_CLK_B_MARK, RIF0_SYNC_B_MARK, 1690 + }; 1691 + static const unsigned int drif0_data0_b_pins[] = { 1692 + /* D0 */ 1693 + RCAR_GP_PIN(5, 1), 1694 + }; 1695 + static const unsigned int drif0_data0_b_mux[] = { 1696 + RIF0_D0_B_MARK, 1697 + }; 1698 + static const unsigned int drif0_data1_b_pins[] = { 1699 + /* D1 */ 1700 + RCAR_GP_PIN(5, 2), 1701 + }; 1702 + static const unsigned int drif0_data1_b_mux[] = { 1703 + RIF0_D1_B_MARK, 1704 + }; 1705 + static const unsigned int drif0_ctrl_c_pins[] = { 1706 + /* CLK, SYNC */ 1707 + RCAR_GP_PIN(5, 12), RCAR_GP_PIN(5, 15), 1708 + }; 1709 + static const unsigned int drif0_ctrl_c_mux[] = { 1710 + RIF0_CLK_C_MARK, RIF0_SYNC_C_MARK, 1711 + }; 1712 + static const unsigned int drif0_data0_c_pins[] = { 1713 + /* D0 */ 1714 + RCAR_GP_PIN(5, 13), 1715 + }; 1716 + static const unsigned int drif0_data0_c_mux[] = { 1717 + RIF0_D0_C_MARK, 1718 + }; 1719 + static const unsigned int drif0_data1_c_pins[] = { 1720 + /* D1 */ 1721 + RCAR_GP_PIN(5, 14), 1722 + }; 1723 + static const unsigned int drif0_data1_c_mux[] = { 1724 + RIF0_D1_C_MARK, 1725 + }; 1726 + /* - DRIF1 --------------------------------------------------------------- */ 1727 + static const unsigned int drif1_ctrl_a_pins[] = { 1728 + /* CLK, SYNC */ 1729 + RCAR_GP_PIN(6, 17), RCAR_GP_PIN(6, 18), 1730 + }; 1731 + static const unsigned int drif1_ctrl_a_mux[] = { 1732 + RIF1_CLK_A_MARK, RIF1_SYNC_A_MARK, 1733 + }; 1734 + static const unsigned int drif1_data0_a_pins[] = { 1735 + /* D0 */ 1736 + RCAR_GP_PIN(6, 19), 1737 + }; 1738 + static const unsigned int drif1_data0_a_mux[] = { 1739 + RIF1_D0_A_MARK, 1740 + }; 1741 + static const unsigned int drif1_data1_a_pins[] = { 1742 + /* D1 */ 1743 + RCAR_GP_PIN(6, 20), 1744 + }; 1745 + static const unsigned int drif1_data1_a_mux[] = { 1746 + RIF1_D1_A_MARK, 1747 + }; 1748 + static const unsigned int drif1_ctrl_b_pins[] = { 1749 + /* CLK, SYNC */ 1750 + RCAR_GP_PIN(5, 9), RCAR_GP_PIN(5, 3), 1751 + }; 1752 + static const unsigned int drif1_ctrl_b_mux[] = { 1753 + RIF1_CLK_B_MARK, RIF1_SYNC_B_MARK, 1754 + }; 1755 + static const unsigned int drif1_data0_b_pins[] = { 1756 + /* D0 */ 1757 + RCAR_GP_PIN(5, 7), 1758 + }; 1759 + static const unsigned int drif1_data0_b_mux[] = { 1760 + RIF1_D0_B_MARK, 1761 + }; 1762 + static const unsigned int drif1_data1_b_pins[] = { 1763 + /* D1 */ 1764 + RCAR_GP_PIN(5, 8), 1765 + }; 1766 + static const unsigned int drif1_data1_b_mux[] = { 1767 + RIF1_D1_B_MARK, 1768 + }; 1769 + static const unsigned int drif1_ctrl_c_pins[] = { 1770 + /* CLK, SYNC */ 1771 + RCAR_GP_PIN(5, 5), RCAR_GP_PIN(5, 11), 1772 + }; 1773 + static const unsigned int drif1_ctrl_c_mux[] = { 1774 + RIF1_CLK_C_MARK, RIF1_SYNC_C_MARK, 1775 + }; 1776 + static const unsigned int drif1_data0_c_pins[] = { 1777 + /* D0 */ 1778 + RCAR_GP_PIN(5, 6), 1779 + }; 1780 + static const unsigned int drif1_data0_c_mux[] = { 1781 + RIF1_D0_C_MARK, 1782 + }; 1783 + static const unsigned int drif1_data1_c_pins[] = { 1784 + /* D1 */ 1785 + RCAR_GP_PIN(5, 10), 1786 + }; 1787 + static const unsigned int drif1_data1_c_mux[] = { 1788 + RIF1_D1_C_MARK, 1789 + }; 1790 + /* - DRIF2 --------------------------------------------------------------- */ 1791 + static const unsigned int drif2_ctrl_a_pins[] = { 1792 + /* CLK, SYNC */ 1793 + RCAR_GP_PIN(6, 8), RCAR_GP_PIN(6, 9), 1794 + }; 1795 + static const unsigned int drif2_ctrl_a_mux[] = { 1796 + RIF2_CLK_A_MARK, RIF2_SYNC_A_MARK, 1797 + }; 1798 + static const unsigned int drif2_data0_a_pins[] = { 1799 + /* D0 */ 1800 + RCAR_GP_PIN(6, 7), 1801 + }; 1802 + static const unsigned int drif2_data0_a_mux[] = { 1803 + RIF2_D0_A_MARK, 1804 + }; 1805 + static const unsigned int drif2_data1_a_pins[] = { 1806 + /* D1 */ 1807 + RCAR_GP_PIN(6, 10), 1808 + }; 1809 + static const unsigned int drif2_data1_a_mux[] = { 1810 + RIF2_D1_A_MARK, 1811 + }; 1812 + static const unsigned int drif2_ctrl_b_pins[] = { 1813 + /* CLK, SYNC */ 1814 + RCAR_GP_PIN(6, 26), RCAR_GP_PIN(6, 27), 1815 + }; 1816 + static const unsigned int drif2_ctrl_b_mux[] = { 1817 + RIF2_CLK_B_MARK, RIF2_SYNC_B_MARK, 1818 + }; 1819 + static const unsigned int drif2_data0_b_pins[] = { 1820 + /* D0 */ 1821 + RCAR_GP_PIN(6, 30), 1822 + }; 1823 + static const unsigned int drif2_data0_b_mux[] = { 1824 + RIF2_D0_B_MARK, 1825 + }; 1826 + static const unsigned int drif2_data1_b_pins[] = { 1827 + /* D1 */ 1828 + RCAR_GP_PIN(6, 31), 1829 + }; 1830 + static const unsigned int drif2_data1_b_mux[] = { 1831 + RIF2_D1_B_MARK, 1832 + }; 1833 + /* - DRIF3 --------------------------------------------------------------- */ 1834 + static const unsigned int drif3_ctrl_a_pins[] = { 1835 + /* CLK, SYNC */ 1836 + RCAR_GP_PIN(6, 17), RCAR_GP_PIN(6, 18), 1837 + }; 1838 + static const unsigned int drif3_ctrl_a_mux[] = { 1839 + RIF3_CLK_A_MARK, RIF3_SYNC_A_MARK, 1840 + }; 1841 + static const unsigned int drif3_data0_a_pins[] = { 1842 + /* D0 */ 1843 + RCAR_GP_PIN(6, 19), 1844 + }; 1845 + static const unsigned int drif3_data0_a_mux[] = { 1846 + RIF3_D0_A_MARK, 1847 + }; 1848 + static const unsigned int drif3_data1_a_pins[] = { 1849 + /* D1 */ 1850 + RCAR_GP_PIN(6, 20), 1851 + }; 1852 + static const unsigned int drif3_data1_a_mux[] = { 1853 + RIF3_D1_A_MARK, 1854 + }; 1855 + static const unsigned int drif3_ctrl_b_pins[] = { 1856 + /* CLK, SYNC */ 1857 + RCAR_GP_PIN(6, 24), RCAR_GP_PIN(6, 25), 1858 + }; 1859 + static const unsigned int drif3_ctrl_b_mux[] = { 1860 + RIF3_CLK_B_MARK, RIF3_SYNC_B_MARK, 1861 + }; 1862 + static const unsigned int drif3_data0_b_pins[] = { 1863 + /* D0 */ 1864 + RCAR_GP_PIN(6, 28), 1865 + }; 1866 + static const unsigned int drif3_data0_b_mux[] = { 1867 + RIF3_D0_B_MARK, 1868 + }; 1869 + static const unsigned int drif3_data1_b_pins[] = { 1870 + /* D1 */ 1871 + RCAR_GP_PIN(6, 29), 1872 + }; 1873 + static const unsigned int drif3_data1_b_mux[] = { 1874 + RIF3_D1_B_MARK, 1875 + }; 1876 + 1784 1877 /* - DU --------------------------------------------------------------------- */ 1785 1878 static const unsigned int du_rgb666_pins[] = { 1786 1879 /* R[7:2], G[7:2], B[7:2] */ ··· 2075 1738 }; 2076 1739 static const unsigned int du_disp_mux[] = { 2077 1740 DU_DISP_MARK, 1741 + }; 1742 + 1743 + /* - HSCIF0 ----------------------------------------------------------------- */ 1744 + static const unsigned int hscif0_data_pins[] = { 1745 + /* RX, TX */ 1746 + RCAR_GP_PIN(5, 13), RCAR_GP_PIN(5, 14), 1747 + }; 1748 + static const unsigned int hscif0_data_mux[] = { 1749 + HRX0_MARK, HTX0_MARK, 1750 + }; 1751 + static const unsigned int hscif0_clk_pins[] = { 1752 + /* SCK */ 1753 + RCAR_GP_PIN(5, 12), 1754 + }; 1755 + static const unsigned int hscif0_clk_mux[] = { 1756 + HSCK0_MARK, 1757 + }; 1758 + static const unsigned int hscif0_ctrl_pins[] = { 1759 + /* RTS, CTS */ 1760 + RCAR_GP_PIN(5, 16), RCAR_GP_PIN(5, 15), 1761 + }; 1762 + static const unsigned int hscif0_ctrl_mux[] = { 1763 + HRTS0_N_MARK, HCTS0_N_MARK, 1764 + }; 1765 + /* - HSCIF1 ----------------------------------------------------------------- */ 1766 + static const unsigned int hscif1_data_a_pins[] = { 1767 + /* RX, TX */ 1768 + RCAR_GP_PIN(5, 5), RCAR_GP_PIN(5, 6), 1769 + }; 1770 + static const unsigned int hscif1_data_a_mux[] = { 1771 + HRX1_A_MARK, HTX1_A_MARK, 1772 + }; 1773 + static const unsigned int hscif1_clk_a_pins[] = { 1774 + /* SCK */ 1775 + RCAR_GP_PIN(6, 21), 1776 + }; 1777 + static const unsigned int hscif1_clk_a_mux[] = { 1778 + HSCK1_A_MARK, 1779 + }; 1780 + static const unsigned int hscif1_ctrl_a_pins[] = { 1781 + /* RTS, CTS */ 1782 + RCAR_GP_PIN(5, 8), RCAR_GP_PIN(5, 7), 1783 + }; 1784 + static const unsigned int hscif1_ctrl_a_mux[] = { 1785 + HRTS1_N_A_MARK, HCTS1_N_A_MARK, 1786 + }; 1787 + 1788 + static const unsigned int hscif1_data_b_pins[] = { 1789 + /* RX, TX */ 1790 + RCAR_GP_PIN(5, 1), RCAR_GP_PIN(5, 2), 1791 + }; 1792 + static const unsigned int hscif1_data_b_mux[] = { 1793 + HRX1_B_MARK, HTX1_B_MARK, 1794 + }; 1795 + static const unsigned int hscif1_clk_b_pins[] = { 1796 + /* SCK */ 1797 + RCAR_GP_PIN(5, 0), 1798 + }; 1799 + static const unsigned int hscif1_clk_b_mux[] = { 1800 + HSCK1_B_MARK, 1801 + }; 1802 + static const unsigned int hscif1_ctrl_b_pins[] = { 1803 + /* RTS, CTS */ 1804 + RCAR_GP_PIN(5, 4), RCAR_GP_PIN(5, 3), 1805 + }; 1806 + static const unsigned int hscif1_ctrl_b_mux[] = { 1807 + HRTS1_N_B_MARK, HCTS1_N_B_MARK, 1808 + }; 1809 + /* - HSCIF2 ----------------------------------------------------------------- */ 1810 + static const unsigned int hscif2_data_a_pins[] = { 1811 + /* RX, TX */ 1812 + RCAR_GP_PIN(6, 8), RCAR_GP_PIN(6, 9), 1813 + }; 1814 + static const unsigned int hscif2_data_a_mux[] = { 1815 + HRX2_A_MARK, HTX2_A_MARK, 1816 + }; 1817 + static const unsigned int hscif2_clk_a_pins[] = { 1818 + /* SCK */ 1819 + RCAR_GP_PIN(6, 10), 1820 + }; 1821 + static const unsigned int hscif2_clk_a_mux[] = { 1822 + HSCK2_A_MARK, 1823 + }; 1824 + static const unsigned int hscif2_ctrl_a_pins[] = { 1825 + /* RTS, CTS */ 1826 + RCAR_GP_PIN(6, 7), RCAR_GP_PIN(6, 6), 1827 + }; 1828 + static const unsigned int hscif2_ctrl_a_mux[] = { 1829 + HRTS2_N_A_MARK, HCTS2_N_A_MARK, 1830 + }; 1831 + 1832 + static const unsigned int hscif2_data_b_pins[] = { 1833 + /* RX, TX */ 1834 + RCAR_GP_PIN(6, 17), RCAR_GP_PIN(6, 18), 1835 + }; 1836 + static const unsigned int hscif2_data_b_mux[] = { 1837 + HRX2_B_MARK, HTX2_B_MARK, 1838 + }; 1839 + static const unsigned int hscif2_clk_b_pins[] = { 1840 + /* SCK */ 1841 + RCAR_GP_PIN(6, 21), 1842 + }; 1843 + static const unsigned int hscif2_clk_b_mux[] = { 1844 + HSCK2_B_MARK, 1845 + }; 1846 + static const unsigned int hscif2_ctrl_b_pins[] = { 1847 + /* RTS, CTS */ 1848 + RCAR_GP_PIN(6, 20), RCAR_GP_PIN(6, 19), 1849 + }; 1850 + static const unsigned int hscif2_ctrl_b_mux[] = { 1851 + HRTS2_N_B_MARK, HCTS2_N_B_MARK, 1852 + }; 1853 + 1854 + static const unsigned int hscif2_data_c_pins[] = { 1855 + /* RX, TX */ 1856 + RCAR_GP_PIN(6, 25), RCAR_GP_PIN(6, 26), 1857 + }; 1858 + static const unsigned int hscif2_data_c_mux[] = { 1859 + HRX2_C_MARK, HTX2_C_MARK, 1860 + }; 1861 + static const unsigned int hscif2_clk_c_pins[] = { 1862 + /* SCK */ 1863 + RCAR_GP_PIN(6, 24), 1864 + }; 1865 + static const unsigned int hscif2_clk_c_mux[] = { 1866 + HSCK2_C_MARK, 1867 + }; 1868 + static const unsigned int hscif2_ctrl_c_pins[] = { 1869 + /* RTS, CTS */ 1870 + RCAR_GP_PIN(6, 28), RCAR_GP_PIN(6, 27), 1871 + }; 1872 + static const unsigned int hscif2_ctrl_c_mux[] = { 1873 + HRTS2_N_C_MARK, HCTS2_N_C_MARK, 1874 + }; 1875 + /* - HSCIF3 ----------------------------------------------------------------- */ 1876 + static const unsigned int hscif3_data_a_pins[] = { 1877 + /* RX, TX */ 1878 + RCAR_GP_PIN(1, 23), RCAR_GP_PIN(1, 24), 1879 + }; 1880 + static const unsigned int hscif3_data_a_mux[] = { 1881 + HRX3_A_MARK, HTX3_A_MARK, 1882 + }; 1883 + static const unsigned int hscif3_clk_pins[] = { 1884 + /* SCK */ 1885 + RCAR_GP_PIN(1, 22), 1886 + }; 1887 + static const unsigned int hscif3_clk_mux[] = { 1888 + HSCK3_MARK, 1889 + }; 1890 + static const unsigned int hscif3_ctrl_pins[] = { 1891 + /* RTS, CTS */ 1892 + RCAR_GP_PIN(1, 26), RCAR_GP_PIN(1, 25), 1893 + }; 1894 + static const unsigned int hscif3_ctrl_mux[] = { 1895 + HRTS3_N_MARK, HCTS3_N_MARK, 1896 + }; 1897 + 1898 + static const unsigned int hscif3_data_b_pins[] = { 1899 + /* RX, TX */ 1900 + RCAR_GP_PIN(0, 10), RCAR_GP_PIN(0, 11), 1901 + }; 1902 + static const unsigned int hscif3_data_b_mux[] = { 1903 + HRX3_B_MARK, HTX3_B_MARK, 1904 + }; 1905 + static const unsigned int hscif3_data_c_pins[] = { 1906 + /* RX, TX */ 1907 + RCAR_GP_PIN(0, 14), RCAR_GP_PIN(0, 15), 1908 + }; 1909 + static const unsigned int hscif3_data_c_mux[] = { 1910 + HRX3_C_MARK, HTX3_C_MARK, 1911 + }; 1912 + static const unsigned int hscif3_data_d_pins[] = { 1913 + /* RX, TX */ 1914 + RCAR_GP_PIN(2, 7), RCAR_GP_PIN(2, 8), 1915 + }; 1916 + static const unsigned int hscif3_data_d_mux[] = { 1917 + HRX3_D_MARK, HTX3_D_MARK, 1918 + }; 1919 + /* - HSCIF4 ----------------------------------------------------------------- */ 1920 + static const unsigned int hscif4_data_a_pins[] = { 1921 + /* RX, TX */ 1922 + RCAR_GP_PIN(1, 12), RCAR_GP_PIN(1, 13), 1923 + }; 1924 + static const unsigned int hscif4_data_a_mux[] = { 1925 + HRX4_A_MARK, HTX4_A_MARK, 1926 + }; 1927 + static const unsigned int hscif4_clk_pins[] = { 1928 + /* SCK */ 1929 + RCAR_GP_PIN(1, 11), 1930 + }; 1931 + static const unsigned int hscif4_clk_mux[] = { 1932 + HSCK4_MARK, 1933 + }; 1934 + static const unsigned int hscif4_ctrl_pins[] = { 1935 + /* RTS, CTS */ 1936 + RCAR_GP_PIN(1, 15), RCAR_GP_PIN(1, 14), 1937 + }; 1938 + static const unsigned int hscif4_ctrl_mux[] = { 1939 + HRTS4_N_MARK, HCTS4_N_MARK, 1940 + }; 1941 + 1942 + static const unsigned int hscif4_data_b_pins[] = { 1943 + /* RX, TX */ 1944 + RCAR_GP_PIN(1, 8), RCAR_GP_PIN(1, 11), 1945 + }; 1946 + static const unsigned int hscif4_data_b_mux[] = { 1947 + HRX4_B_MARK, HTX4_B_MARK, 1948 + }; 1949 + 1950 + /* - I2C -------------------------------------------------------------------- */ 1951 + static const unsigned int i2c1_a_pins[] = { 1952 + /* SDA, SCL */ 1953 + RCAR_GP_PIN(5, 11), RCAR_GP_PIN(5, 10), 1954 + }; 1955 + static const unsigned int i2c1_a_mux[] = { 1956 + SDA1_A_MARK, SCL1_A_MARK, 1957 + }; 1958 + static const unsigned int i2c1_b_pins[] = { 1959 + /* SDA, SCL */ 1960 + RCAR_GP_PIN(5, 24), RCAR_GP_PIN(5, 23), 1961 + }; 1962 + static const unsigned int i2c1_b_mux[] = { 1963 + SDA1_B_MARK, SCL1_B_MARK, 1964 + }; 1965 + static const unsigned int i2c2_a_pins[] = { 1966 + /* SDA, SCL */ 1967 + RCAR_GP_PIN(5, 0), RCAR_GP_PIN(5, 4), 1968 + }; 1969 + static const unsigned int i2c2_a_mux[] = { 1970 + SDA2_A_MARK, SCL2_A_MARK, 1971 + }; 1972 + static const unsigned int i2c2_b_pins[] = { 1973 + /* SDA, SCL */ 1974 + RCAR_GP_PIN(3, 13), RCAR_GP_PIN(3, 12), 1975 + }; 1976 + static const unsigned int i2c2_b_mux[] = { 1977 + SDA2_B_MARK, SCL2_B_MARK, 1978 + }; 1979 + static const unsigned int i2c6_a_pins[] = { 1980 + /* SDA, SCL */ 1981 + RCAR_GP_PIN(1, 8), RCAR_GP_PIN(1, 11), 1982 + }; 1983 + static const unsigned int i2c6_a_mux[] = { 1984 + SDA6_A_MARK, SCL6_A_MARK, 1985 + }; 1986 + static const unsigned int i2c6_b_pins[] = { 1987 + /* SDA, SCL */ 1988 + RCAR_GP_PIN(1, 26), RCAR_GP_PIN(1, 25), 1989 + }; 1990 + static const unsigned int i2c6_b_mux[] = { 1991 + SDA6_B_MARK, SCL6_B_MARK, 1992 + }; 1993 + static const unsigned int i2c6_c_pins[] = { 1994 + /* SDA, SCL */ 1995 + RCAR_GP_PIN(0, 15), RCAR_GP_PIN(0, 14), 1996 + }; 1997 + static const unsigned int i2c6_c_mux[] = { 1998 + SDA6_C_MARK, SCL6_C_MARK, 1999 + }; 2000 + 2001 + /* - INTC-EX ---------------------------------------------------------------- */ 2002 + static const unsigned int intc_ex_irq0_pins[] = { 2003 + /* IRQ0 */ 2004 + RCAR_GP_PIN(2, 0), 2005 + }; 2006 + static const unsigned int intc_ex_irq0_mux[] = { 2007 + IRQ0_MARK, 2008 + }; 2009 + static const unsigned int intc_ex_irq1_pins[] = { 2010 + /* IRQ1 */ 2011 + RCAR_GP_PIN(2, 1), 2012 + }; 2013 + static const unsigned int intc_ex_irq1_mux[] = { 2014 + IRQ1_MARK, 2015 + }; 2016 + static const unsigned int intc_ex_irq2_pins[] = { 2017 + /* IRQ2 */ 2018 + RCAR_GP_PIN(2, 2), 2019 + }; 2020 + static const unsigned int intc_ex_irq2_mux[] = { 2021 + IRQ2_MARK, 2022 + }; 2023 + static const unsigned int intc_ex_irq3_pins[] = { 2024 + /* IRQ3 */ 2025 + RCAR_GP_PIN(2, 3), 2026 + }; 2027 + static const unsigned int intc_ex_irq3_mux[] = { 2028 + IRQ3_MARK, 2029 + }; 2030 + static const unsigned int intc_ex_irq4_pins[] = { 2031 + /* IRQ4 */ 2032 + RCAR_GP_PIN(2, 4), 2033 + }; 2034 + static const unsigned int intc_ex_irq4_mux[] = { 2035 + IRQ4_MARK, 2036 + }; 2037 + static const unsigned int intc_ex_irq5_pins[] = { 2038 + /* IRQ5 */ 2039 + RCAR_GP_PIN(2, 5), 2040 + }; 2041 + static const unsigned int intc_ex_irq5_mux[] = { 2042 + IRQ5_MARK, 2078 2043 }; 2079 2044 2080 2045 /* - MSIOF0 ----------------------------------------------------------------- */ ··· 3389 2750 SCIF_CLK_B_MARK, 3390 2751 }; 3391 2752 2753 + /* - SDHI0 ------------------------------------------------------------------ */ 2754 + static const unsigned int sdhi0_data1_pins[] = { 2755 + /* D0 */ 2756 + RCAR_GP_PIN(3, 2), 2757 + }; 2758 + static const unsigned int sdhi0_data1_mux[] = { 2759 + SD0_DAT0_MARK, 2760 + }; 2761 + static const unsigned int sdhi0_data4_pins[] = { 2762 + /* D[0:3] */ 2763 + RCAR_GP_PIN(3, 2), RCAR_GP_PIN(3, 3), 2764 + RCAR_GP_PIN(3, 4), RCAR_GP_PIN(3, 5), 2765 + }; 2766 + static const unsigned int sdhi0_data4_mux[] = { 2767 + SD0_DAT0_MARK, SD0_DAT1_MARK, 2768 + SD0_DAT2_MARK, SD0_DAT3_MARK, 2769 + }; 2770 + static const unsigned int sdhi0_ctrl_pins[] = { 2771 + /* CLK, CMD */ 2772 + RCAR_GP_PIN(3, 0), RCAR_GP_PIN(3, 1), 2773 + }; 2774 + static const unsigned int sdhi0_ctrl_mux[] = { 2775 + SD0_CLK_MARK, SD0_CMD_MARK, 2776 + }; 2777 + static const unsigned int sdhi0_cd_pins[] = { 2778 + /* CD */ 2779 + RCAR_GP_PIN(3, 12), 2780 + }; 2781 + static const unsigned int sdhi0_cd_mux[] = { 2782 + SD0_CD_MARK, 2783 + }; 2784 + static const unsigned int sdhi0_wp_pins[] = { 2785 + /* WP */ 2786 + RCAR_GP_PIN(3, 13), 2787 + }; 2788 + static const unsigned int sdhi0_wp_mux[] = { 2789 + SD0_WP_MARK, 2790 + }; 2791 + /* - SDHI1 ------------------------------------------------------------------ */ 2792 + static const unsigned int sdhi1_data1_pins[] = { 2793 + /* D0 */ 2794 + RCAR_GP_PIN(3, 8), 2795 + }; 2796 + static const unsigned int sdhi1_data1_mux[] = { 2797 + SD1_DAT0_MARK, 2798 + }; 2799 + static const unsigned int sdhi1_data4_pins[] = { 2800 + /* D[0:3] */ 2801 + RCAR_GP_PIN(3, 8), RCAR_GP_PIN(3, 9), 2802 + RCAR_GP_PIN(3, 10), RCAR_GP_PIN(3, 11), 2803 + }; 2804 + static const unsigned int sdhi1_data4_mux[] = { 2805 + SD1_DAT0_MARK, SD1_DAT1_MARK, 2806 + SD1_DAT2_MARK, SD1_DAT3_MARK, 2807 + }; 2808 + static const unsigned int sdhi1_ctrl_pins[] = { 2809 + /* CLK, CMD */ 2810 + RCAR_GP_PIN(3, 6), RCAR_GP_PIN(3, 7), 2811 + }; 2812 + static const unsigned int sdhi1_ctrl_mux[] = { 2813 + SD1_CLK_MARK, SD1_CMD_MARK, 2814 + }; 2815 + static const unsigned int sdhi1_cd_pins[] = { 2816 + /* CD */ 2817 + RCAR_GP_PIN(3, 14), 2818 + }; 2819 + static const unsigned int sdhi1_cd_mux[] = { 2820 + SD1_CD_MARK, 2821 + }; 2822 + static const unsigned int sdhi1_wp_pins[] = { 2823 + /* WP */ 2824 + RCAR_GP_PIN(3, 15), 2825 + }; 2826 + static const unsigned int sdhi1_wp_mux[] = { 2827 + SD1_WP_MARK, 2828 + }; 2829 + /* - SDHI2 ------------------------------------------------------------------ */ 2830 + static const unsigned int sdhi2_data1_pins[] = { 2831 + /* D0 */ 2832 + RCAR_GP_PIN(4, 2), 2833 + }; 2834 + static const unsigned int sdhi2_data1_mux[] = { 2835 + SD2_DAT0_MARK, 2836 + }; 2837 + static const unsigned int sdhi2_data4_pins[] = { 2838 + /* D[0:3] */ 2839 + RCAR_GP_PIN(4, 2), RCAR_GP_PIN(4, 3), 2840 + RCAR_GP_PIN(4, 4), RCAR_GP_PIN(4, 5), 2841 + }; 2842 + static const unsigned int sdhi2_data4_mux[] = { 2843 + SD2_DAT0_MARK, SD2_DAT1_MARK, 2844 + SD2_DAT2_MARK, SD2_DAT3_MARK, 2845 + }; 2846 + static const unsigned int sdhi2_data8_pins[] = { 2847 + /* D[0:7] */ 2848 + RCAR_GP_PIN(4, 2), RCAR_GP_PIN(4, 3), 2849 + RCAR_GP_PIN(4, 4), RCAR_GP_PIN(4, 5), 2850 + RCAR_GP_PIN(3, 8), RCAR_GP_PIN(3, 9), 2851 + RCAR_GP_PIN(3, 10), RCAR_GP_PIN(3, 11), 2852 + }; 2853 + static const unsigned int sdhi2_data8_mux[] = { 2854 + SD2_DAT0_MARK, SD2_DAT1_MARK, 2855 + SD2_DAT2_MARK, SD2_DAT3_MARK, 2856 + SD2_DAT4_MARK, SD2_DAT5_MARK, 2857 + SD2_DAT6_MARK, SD2_DAT7_MARK, 2858 + }; 2859 + static const unsigned int sdhi2_ctrl_pins[] = { 2860 + /* CLK, CMD */ 2861 + RCAR_GP_PIN(4, 0), RCAR_GP_PIN(4, 1), 2862 + }; 2863 + static const unsigned int sdhi2_ctrl_mux[] = { 2864 + SD2_CLK_MARK, SD2_CMD_MARK, 2865 + }; 2866 + static const unsigned int sdhi2_cd_a_pins[] = { 2867 + /* CD */ 2868 + RCAR_GP_PIN(4, 13), 2869 + }; 2870 + static const unsigned int sdhi2_cd_a_mux[] = { 2871 + SD2_CD_A_MARK, 2872 + }; 2873 + static const unsigned int sdhi2_cd_b_pins[] = { 2874 + /* CD */ 2875 + RCAR_GP_PIN(5, 10), 2876 + }; 2877 + static const unsigned int sdhi2_cd_b_mux[] = { 2878 + SD2_CD_B_MARK, 2879 + }; 2880 + static const unsigned int sdhi2_wp_a_pins[] = { 2881 + /* WP */ 2882 + RCAR_GP_PIN(4, 14), 2883 + }; 2884 + static const unsigned int sdhi2_wp_a_mux[] = { 2885 + SD2_WP_A_MARK, 2886 + }; 2887 + static const unsigned int sdhi2_wp_b_pins[] = { 2888 + /* WP */ 2889 + RCAR_GP_PIN(5, 11), 2890 + }; 2891 + static const unsigned int sdhi2_wp_b_mux[] = { 2892 + SD2_WP_B_MARK, 2893 + }; 2894 + static const unsigned int sdhi2_ds_pins[] = { 2895 + /* DS */ 2896 + RCAR_GP_PIN(4, 6), 2897 + }; 2898 + static const unsigned int sdhi2_ds_mux[] = { 2899 + SD2_DS_MARK, 2900 + }; 2901 + /* - SDHI3 ------------------------------------------------------------------ */ 2902 + static const unsigned int sdhi3_data1_pins[] = { 2903 + /* D0 */ 2904 + RCAR_GP_PIN(4, 9), 2905 + }; 2906 + static const unsigned int sdhi3_data1_mux[] = { 2907 + SD3_DAT0_MARK, 2908 + }; 2909 + static const unsigned int sdhi3_data4_pins[] = { 2910 + /* D[0:3] */ 2911 + RCAR_GP_PIN(4, 9), RCAR_GP_PIN(4, 10), 2912 + RCAR_GP_PIN(4, 11), RCAR_GP_PIN(4, 12), 2913 + }; 2914 + static const unsigned int sdhi3_data4_mux[] = { 2915 + SD3_DAT0_MARK, SD3_DAT1_MARK, 2916 + SD3_DAT2_MARK, SD3_DAT3_MARK, 2917 + }; 2918 + static const unsigned int sdhi3_data8_pins[] = { 2919 + /* D[0:7] */ 2920 + RCAR_GP_PIN(4, 9), RCAR_GP_PIN(4, 10), 2921 + RCAR_GP_PIN(4, 11), RCAR_GP_PIN(4, 12), 2922 + RCAR_GP_PIN(4, 13), RCAR_GP_PIN(4, 14), 2923 + RCAR_GP_PIN(4, 15), RCAR_GP_PIN(4, 16), 2924 + }; 2925 + static const unsigned int sdhi3_data8_mux[] = { 2926 + SD3_DAT0_MARK, SD3_DAT1_MARK, 2927 + SD3_DAT2_MARK, SD3_DAT3_MARK, 2928 + SD3_DAT4_MARK, SD3_DAT5_MARK, 2929 + SD3_DAT6_MARK, SD3_DAT7_MARK, 2930 + }; 2931 + static const unsigned int sdhi3_ctrl_pins[] = { 2932 + /* CLK, CMD */ 2933 + RCAR_GP_PIN(4, 7), RCAR_GP_PIN(4, 8), 2934 + }; 2935 + static const unsigned int sdhi3_ctrl_mux[] = { 2936 + SD3_CLK_MARK, SD3_CMD_MARK, 2937 + }; 2938 + static const unsigned int sdhi3_cd_pins[] = { 2939 + /* CD */ 2940 + RCAR_GP_PIN(4, 15), 2941 + }; 2942 + static const unsigned int sdhi3_cd_mux[] = { 2943 + SD3_CD_MARK, 2944 + }; 2945 + static const unsigned int sdhi3_wp_pins[] = { 2946 + /* WP */ 2947 + RCAR_GP_PIN(4, 16), 2948 + }; 2949 + static const unsigned int sdhi3_wp_mux[] = { 2950 + SD3_WP_MARK, 2951 + }; 2952 + static const unsigned int sdhi3_ds_pins[] = { 2953 + /* DS */ 2954 + RCAR_GP_PIN(4, 17), 2955 + }; 2956 + static const unsigned int sdhi3_ds_mux[] = { 2957 + SD3_DS_MARK, 2958 + }; 2959 + 2960 + /* - SSI -------------------------------------------------------------------- */ 2961 + static const unsigned int ssi0_data_pins[] = { 2962 + /* SDATA */ 2963 + RCAR_GP_PIN(6, 2), 2964 + }; 2965 + static const unsigned int ssi0_data_mux[] = { 2966 + SSI_SDATA0_MARK, 2967 + }; 2968 + static const unsigned int ssi01239_ctrl_pins[] = { 2969 + /* SCK, WS */ 2970 + RCAR_GP_PIN(6, 0), RCAR_GP_PIN(6, 1), 2971 + }; 2972 + static const unsigned int ssi01239_ctrl_mux[] = { 2973 + SSI_SCK01239_MARK, SSI_WS01239_MARK, 2974 + }; 2975 + static const unsigned int ssi1_data_a_pins[] = { 2976 + /* SDATA */ 2977 + RCAR_GP_PIN(6, 3), 2978 + }; 2979 + static const unsigned int ssi1_data_a_mux[] = { 2980 + SSI_SDATA1_A_MARK, 2981 + }; 2982 + static const unsigned int ssi1_data_b_pins[] = { 2983 + /* SDATA */ 2984 + RCAR_GP_PIN(5, 12), 2985 + }; 2986 + static const unsigned int ssi1_data_b_mux[] = { 2987 + SSI_SDATA1_B_MARK, 2988 + }; 2989 + static const unsigned int ssi1_ctrl_a_pins[] = { 2990 + /* SCK, WS */ 2991 + RCAR_GP_PIN(6, 26), RCAR_GP_PIN(6, 27), 2992 + }; 2993 + static const unsigned int ssi1_ctrl_a_mux[] = { 2994 + SSI_SCK1_A_MARK, SSI_WS1_A_MARK, 2995 + }; 2996 + static const unsigned int ssi1_ctrl_b_pins[] = { 2997 + /* SCK, WS */ 2998 + RCAR_GP_PIN(6, 4), RCAR_GP_PIN(6, 21), 2999 + }; 3000 + static const unsigned int ssi1_ctrl_b_mux[] = { 3001 + SSI_SCK1_B_MARK, SSI_WS1_B_MARK, 3002 + }; 3003 + static const unsigned int ssi2_data_a_pins[] = { 3004 + /* SDATA */ 3005 + RCAR_GP_PIN(6, 4), 3006 + }; 3007 + static const unsigned int ssi2_data_a_mux[] = { 3008 + SSI_SDATA2_A_MARK, 3009 + }; 3010 + static const unsigned int ssi2_data_b_pins[] = { 3011 + /* SDATA */ 3012 + RCAR_GP_PIN(5, 13), 3013 + }; 3014 + static const unsigned int ssi2_data_b_mux[] = { 3015 + SSI_SDATA2_B_MARK, 3016 + }; 3017 + static const unsigned int ssi2_ctrl_a_pins[] = { 3018 + /* SCK, WS */ 3019 + RCAR_GP_PIN(5, 19), RCAR_GP_PIN(5, 21), 3020 + }; 3021 + static const unsigned int ssi2_ctrl_a_mux[] = { 3022 + SSI_SCK2_A_MARK, SSI_WS2_A_MARK, 3023 + }; 3024 + static const unsigned int ssi2_ctrl_b_pins[] = { 3025 + /* SCK, WS */ 3026 + RCAR_GP_PIN(6, 28), RCAR_GP_PIN(6, 29), 3027 + }; 3028 + static const unsigned int ssi2_ctrl_b_mux[] = { 3029 + SSI_SCK2_B_MARK, SSI_WS2_B_MARK, 3030 + }; 3031 + static const unsigned int ssi3_data_pins[] = { 3032 + /* SDATA */ 3033 + RCAR_GP_PIN(6, 7), 3034 + }; 3035 + static const unsigned int ssi3_data_mux[] = { 3036 + SSI_SDATA3_MARK, 3037 + }; 3038 + static const unsigned int ssi349_ctrl_pins[] = { 3039 + /* SCK, WS */ 3040 + RCAR_GP_PIN(6, 5), RCAR_GP_PIN(6, 6), 3041 + }; 3042 + static const unsigned int ssi349_ctrl_mux[] = { 3043 + SSI_SCK349_MARK, SSI_WS349_MARK, 3044 + }; 3045 + static const unsigned int ssi4_data_pins[] = { 3046 + /* SDATA */ 3047 + RCAR_GP_PIN(6, 10), 3048 + }; 3049 + static const unsigned int ssi4_data_mux[] = { 3050 + SSI_SDATA4_MARK, 3051 + }; 3052 + static const unsigned int ssi4_ctrl_pins[] = { 3053 + /* SCK, WS */ 3054 + RCAR_GP_PIN(6, 8), RCAR_GP_PIN(6, 9), 3055 + }; 3056 + static const unsigned int ssi4_ctrl_mux[] = { 3057 + SSI_SCK4_MARK, SSI_WS4_MARK, 3058 + }; 3059 + static const unsigned int ssi5_data_pins[] = { 3060 + /* SDATA */ 3061 + RCAR_GP_PIN(6, 13), 3062 + }; 3063 + static const unsigned int ssi5_data_mux[] = { 3064 + SSI_SDATA5_MARK, 3065 + }; 3066 + static const unsigned int ssi5_ctrl_pins[] = { 3067 + /* SCK, WS */ 3068 + RCAR_GP_PIN(6, 11), RCAR_GP_PIN(6, 12), 3069 + }; 3070 + static const unsigned int ssi5_ctrl_mux[] = { 3071 + SSI_SCK5_MARK, SSI_WS5_MARK, 3072 + }; 3073 + static const unsigned int ssi6_data_pins[] = { 3074 + /* SDATA */ 3075 + RCAR_GP_PIN(6, 16), 3076 + }; 3077 + static const unsigned int ssi6_data_mux[] = { 3078 + SSI_SDATA6_MARK, 3079 + }; 3080 + static const unsigned int ssi6_ctrl_pins[] = { 3081 + /* SCK, WS */ 3082 + RCAR_GP_PIN(6, 14), RCAR_GP_PIN(6, 15), 3083 + }; 3084 + static const unsigned int ssi6_ctrl_mux[] = { 3085 + SSI_SCK6_MARK, SSI_WS6_MARK, 3086 + }; 3087 + static const unsigned int ssi7_data_pins[] = { 3088 + /* SDATA */ 3089 + RCAR_GP_PIN(6, 19), 3090 + }; 3091 + static const unsigned int ssi7_data_mux[] = { 3092 + SSI_SDATA7_MARK, 3093 + }; 3094 + static const unsigned int ssi78_ctrl_pins[] = { 3095 + /* SCK, WS */ 3096 + RCAR_GP_PIN(6, 17), RCAR_GP_PIN(6, 18), 3097 + }; 3098 + static const unsigned int ssi78_ctrl_mux[] = { 3099 + SSI_SCK78_MARK, SSI_WS78_MARK, 3100 + }; 3101 + static const unsigned int ssi8_data_pins[] = { 3102 + /* SDATA */ 3103 + RCAR_GP_PIN(6, 20), 3104 + }; 3105 + static const unsigned int ssi8_data_mux[] = { 3106 + SSI_SDATA8_MARK, 3107 + }; 3108 + static const unsigned int ssi9_data_a_pins[] = { 3109 + /* SDATA */ 3110 + RCAR_GP_PIN(6, 21), 3111 + }; 3112 + static const unsigned int ssi9_data_a_mux[] = { 3113 + SSI_SDATA9_A_MARK, 3114 + }; 3115 + static const unsigned int ssi9_data_b_pins[] = { 3116 + /* SDATA */ 3117 + RCAR_GP_PIN(5, 14), 3118 + }; 3119 + static const unsigned int ssi9_data_b_mux[] = { 3120 + SSI_SDATA9_B_MARK, 3121 + }; 3122 + static const unsigned int ssi9_ctrl_a_pins[] = { 3123 + /* SCK, WS */ 3124 + RCAR_GP_PIN(5, 15), RCAR_GP_PIN(5, 16), 3125 + }; 3126 + static const unsigned int ssi9_ctrl_a_mux[] = { 3127 + SSI_SCK9_A_MARK, SSI_WS9_A_MARK, 3128 + }; 3129 + static const unsigned int ssi9_ctrl_b_pins[] = { 3130 + /* SCK, WS */ 3131 + RCAR_GP_PIN(6, 30), RCAR_GP_PIN(6, 31), 3132 + }; 3133 + static const unsigned int ssi9_ctrl_b_mux[] = { 3134 + SSI_SCK9_B_MARK, SSI_WS9_B_MARK, 3135 + }; 3136 + 3392 3137 /* - USB0 ------------------------------------------------------------------- */ 3393 3138 static const unsigned int usb0_pins[] = { 3394 3139 /* PWEN, OVC */ ··· 3806 2783 USB2_CH3_PWEN_MARK, USB2_CH3_OVC_MARK, 3807 2784 }; 3808 2785 2786 + /* - USB30 ------------------------------------------------------------------ */ 2787 + static const unsigned int usb30_pins[] = { 2788 + /* PWEN, OVC */ 2789 + RCAR_GP_PIN(6, 28), RCAR_GP_PIN(6, 29), 2790 + }; 2791 + static const unsigned int usb30_mux[] = { 2792 + USB30_PWEN_MARK, USB30_OVC_MARK, 2793 + }; 2794 + 3809 2795 static const struct sh_pfc_pin_group pinmux_groups[] = { 2796 + SH_PFC_PIN_GROUP(audio_clk_a_a), 2797 + SH_PFC_PIN_GROUP(audio_clk_a_b), 2798 + SH_PFC_PIN_GROUP(audio_clk_a_c), 2799 + SH_PFC_PIN_GROUP(audio_clk_b_a), 2800 + SH_PFC_PIN_GROUP(audio_clk_b_b), 2801 + SH_PFC_PIN_GROUP(audio_clk_c_a), 2802 + SH_PFC_PIN_GROUP(audio_clk_c_b), 2803 + SH_PFC_PIN_GROUP(audio_clkout_a), 2804 + SH_PFC_PIN_GROUP(audio_clkout_b), 2805 + SH_PFC_PIN_GROUP(audio_clkout_c), 2806 + SH_PFC_PIN_GROUP(audio_clkout_d), 2807 + SH_PFC_PIN_GROUP(audio_clkout1_a), 2808 + SH_PFC_PIN_GROUP(audio_clkout1_b), 2809 + SH_PFC_PIN_GROUP(audio_clkout2_a), 2810 + SH_PFC_PIN_GROUP(audio_clkout2_b), 2811 + SH_PFC_PIN_GROUP(audio_clkout3_a), 2812 + SH_PFC_PIN_GROUP(audio_clkout3_b), 3810 2813 SH_PFC_PIN_GROUP(avb_link), 3811 2814 SH_PFC_PIN_GROUP(avb_magic), 3812 2815 SH_PFC_PIN_GROUP(avb_phy_int), ··· 3843 2794 SH_PFC_PIN_GROUP(avb_avtp_capture_a), 3844 2795 SH_PFC_PIN_GROUP(avb_avtp_match_b), 3845 2796 SH_PFC_PIN_GROUP(avb_avtp_capture_b), 2797 + SH_PFC_PIN_GROUP(drif0_ctrl_a), 2798 + SH_PFC_PIN_GROUP(drif0_data0_a), 2799 + SH_PFC_PIN_GROUP(drif0_data1_a), 2800 + SH_PFC_PIN_GROUP(drif0_ctrl_b), 2801 + SH_PFC_PIN_GROUP(drif0_data0_b), 2802 + SH_PFC_PIN_GROUP(drif0_data1_b), 2803 + SH_PFC_PIN_GROUP(drif0_ctrl_c), 2804 + SH_PFC_PIN_GROUP(drif0_data0_c), 2805 + SH_PFC_PIN_GROUP(drif0_data1_c), 2806 + SH_PFC_PIN_GROUP(drif1_ctrl_a), 2807 + SH_PFC_PIN_GROUP(drif1_data0_a), 2808 + SH_PFC_PIN_GROUP(drif1_data1_a), 2809 + SH_PFC_PIN_GROUP(drif1_ctrl_b), 2810 + SH_PFC_PIN_GROUP(drif1_data0_b), 2811 + SH_PFC_PIN_GROUP(drif1_data1_b), 2812 + SH_PFC_PIN_GROUP(drif1_ctrl_c), 2813 + SH_PFC_PIN_GROUP(drif1_data0_c), 2814 + SH_PFC_PIN_GROUP(drif1_data1_c), 2815 + SH_PFC_PIN_GROUP(drif2_ctrl_a), 2816 + SH_PFC_PIN_GROUP(drif2_data0_a), 2817 + SH_PFC_PIN_GROUP(drif2_data1_a), 2818 + SH_PFC_PIN_GROUP(drif2_ctrl_b), 2819 + SH_PFC_PIN_GROUP(drif2_data0_b), 2820 + SH_PFC_PIN_GROUP(drif2_data1_b), 2821 + SH_PFC_PIN_GROUP(drif3_ctrl_a), 2822 + SH_PFC_PIN_GROUP(drif3_data0_a), 2823 + SH_PFC_PIN_GROUP(drif3_data1_a), 2824 + SH_PFC_PIN_GROUP(drif3_ctrl_b), 2825 + SH_PFC_PIN_GROUP(drif3_data0_b), 2826 + SH_PFC_PIN_GROUP(drif3_data1_b), 3846 2827 SH_PFC_PIN_GROUP(du_rgb666), 3847 2828 SH_PFC_PIN_GROUP(du_rgb888), 3848 2829 SH_PFC_PIN_GROUP(du_clk_out_0), ··· 3881 2802 SH_PFC_PIN_GROUP(du_oddf), 3882 2803 SH_PFC_PIN_GROUP(du_cde), 3883 2804 SH_PFC_PIN_GROUP(du_disp), 2805 + SH_PFC_PIN_GROUP(hscif0_data), 2806 + SH_PFC_PIN_GROUP(hscif0_clk), 2807 + SH_PFC_PIN_GROUP(hscif0_ctrl), 2808 + SH_PFC_PIN_GROUP(hscif1_data_a), 2809 + SH_PFC_PIN_GROUP(hscif1_clk_a), 2810 + SH_PFC_PIN_GROUP(hscif1_ctrl_a), 2811 + SH_PFC_PIN_GROUP(hscif1_data_b), 2812 + SH_PFC_PIN_GROUP(hscif1_clk_b), 2813 + SH_PFC_PIN_GROUP(hscif1_ctrl_b), 2814 + SH_PFC_PIN_GROUP(hscif2_data_a), 2815 + SH_PFC_PIN_GROUP(hscif2_clk_a), 2816 + SH_PFC_PIN_GROUP(hscif2_ctrl_a), 2817 + SH_PFC_PIN_GROUP(hscif2_data_b), 2818 + SH_PFC_PIN_GROUP(hscif2_clk_b), 2819 + SH_PFC_PIN_GROUP(hscif2_ctrl_b), 2820 + SH_PFC_PIN_GROUP(hscif2_data_c), 2821 + SH_PFC_PIN_GROUP(hscif2_clk_c), 2822 + SH_PFC_PIN_GROUP(hscif2_ctrl_c), 2823 + SH_PFC_PIN_GROUP(hscif3_data_a), 2824 + SH_PFC_PIN_GROUP(hscif3_clk), 2825 + SH_PFC_PIN_GROUP(hscif3_ctrl), 2826 + SH_PFC_PIN_GROUP(hscif3_data_b), 2827 + SH_PFC_PIN_GROUP(hscif3_data_c), 2828 + SH_PFC_PIN_GROUP(hscif3_data_d), 2829 + SH_PFC_PIN_GROUP(hscif4_data_a), 2830 + SH_PFC_PIN_GROUP(hscif4_clk), 2831 + SH_PFC_PIN_GROUP(hscif4_ctrl), 2832 + SH_PFC_PIN_GROUP(hscif4_data_b), 2833 + SH_PFC_PIN_GROUP(i2c1_a), 2834 + SH_PFC_PIN_GROUP(i2c1_b), 2835 + SH_PFC_PIN_GROUP(i2c2_a), 2836 + SH_PFC_PIN_GROUP(i2c2_b), 2837 + SH_PFC_PIN_GROUP(i2c6_a), 2838 + SH_PFC_PIN_GROUP(i2c6_b), 2839 + SH_PFC_PIN_GROUP(i2c6_c), 2840 + SH_PFC_PIN_GROUP(intc_ex_irq0), 2841 + SH_PFC_PIN_GROUP(intc_ex_irq1), 2842 + SH_PFC_PIN_GROUP(intc_ex_irq2), 2843 + SH_PFC_PIN_GROUP(intc_ex_irq3), 2844 + SH_PFC_PIN_GROUP(intc_ex_irq4), 2845 + SH_PFC_PIN_GROUP(intc_ex_irq5), 3884 2846 SH_PFC_PIN_GROUP(msiof0_clk), 3885 2847 SH_PFC_PIN_GROUP(msiof0_sync), 3886 2848 SH_PFC_PIN_GROUP(msiof0_ss1), ··· 4063 2943 SH_PFC_PIN_GROUP(scif5_clk_b), 4064 2944 SH_PFC_PIN_GROUP(scif_clk_a), 4065 2945 SH_PFC_PIN_GROUP(scif_clk_b), 2946 + SH_PFC_PIN_GROUP(sdhi0_data1), 2947 + SH_PFC_PIN_GROUP(sdhi0_data4), 2948 + SH_PFC_PIN_GROUP(sdhi0_ctrl), 2949 + SH_PFC_PIN_GROUP(sdhi0_cd), 2950 + SH_PFC_PIN_GROUP(sdhi0_wp), 2951 + SH_PFC_PIN_GROUP(sdhi1_data1), 2952 + SH_PFC_PIN_GROUP(sdhi1_data4), 2953 + SH_PFC_PIN_GROUP(sdhi1_ctrl), 2954 + SH_PFC_PIN_GROUP(sdhi1_cd), 2955 + SH_PFC_PIN_GROUP(sdhi1_wp), 2956 + SH_PFC_PIN_GROUP(sdhi2_data1), 2957 + SH_PFC_PIN_GROUP(sdhi2_data4), 2958 + SH_PFC_PIN_GROUP(sdhi2_data8), 2959 + SH_PFC_PIN_GROUP(sdhi2_ctrl), 2960 + SH_PFC_PIN_GROUP(sdhi2_cd_a), 2961 + SH_PFC_PIN_GROUP(sdhi2_wp_a), 2962 + SH_PFC_PIN_GROUP(sdhi2_cd_b), 2963 + SH_PFC_PIN_GROUP(sdhi2_wp_b), 2964 + SH_PFC_PIN_GROUP(sdhi2_ds), 2965 + SH_PFC_PIN_GROUP(sdhi3_data1), 2966 + SH_PFC_PIN_GROUP(sdhi3_data4), 2967 + SH_PFC_PIN_GROUP(sdhi3_data8), 2968 + SH_PFC_PIN_GROUP(sdhi3_ctrl), 2969 + SH_PFC_PIN_GROUP(sdhi3_cd), 2970 + SH_PFC_PIN_GROUP(sdhi3_wp), 2971 + SH_PFC_PIN_GROUP(sdhi3_ds), 2972 + SH_PFC_PIN_GROUP(ssi0_data), 2973 + SH_PFC_PIN_GROUP(ssi01239_ctrl), 2974 + SH_PFC_PIN_GROUP(ssi1_data_a), 2975 + SH_PFC_PIN_GROUP(ssi1_data_b), 2976 + SH_PFC_PIN_GROUP(ssi1_ctrl_a), 2977 + SH_PFC_PIN_GROUP(ssi1_ctrl_b), 2978 + SH_PFC_PIN_GROUP(ssi2_data_a), 2979 + SH_PFC_PIN_GROUP(ssi2_data_b), 2980 + SH_PFC_PIN_GROUP(ssi2_ctrl_a), 2981 + SH_PFC_PIN_GROUP(ssi2_ctrl_b), 2982 + SH_PFC_PIN_GROUP(ssi3_data), 2983 + SH_PFC_PIN_GROUP(ssi349_ctrl), 2984 + SH_PFC_PIN_GROUP(ssi4_data), 2985 + SH_PFC_PIN_GROUP(ssi4_ctrl), 2986 + SH_PFC_PIN_GROUP(ssi5_data), 2987 + SH_PFC_PIN_GROUP(ssi5_ctrl), 2988 + SH_PFC_PIN_GROUP(ssi6_data), 2989 + SH_PFC_PIN_GROUP(ssi6_ctrl), 2990 + SH_PFC_PIN_GROUP(ssi7_data), 2991 + SH_PFC_PIN_GROUP(ssi78_ctrl), 2992 + SH_PFC_PIN_GROUP(ssi8_data), 2993 + SH_PFC_PIN_GROUP(ssi9_data_a), 2994 + SH_PFC_PIN_GROUP(ssi9_data_b), 2995 + SH_PFC_PIN_GROUP(ssi9_ctrl_a), 2996 + SH_PFC_PIN_GROUP(ssi9_ctrl_b), 4066 2997 SH_PFC_PIN_GROUP(usb0), 4067 2998 SH_PFC_PIN_GROUP(usb1), 4068 2999 SH_PFC_PIN_GROUP(usb2), 4069 3000 SH_PFC_PIN_GROUP(usb2_ch3), 3001 + SH_PFC_PIN_GROUP(usb30), 3002 + }; 3003 + 3004 + static const char * const audio_clk_groups[] = { 3005 + "audio_clk_a_a", 3006 + "audio_clk_a_b", 3007 + "audio_clk_a_c", 3008 + "audio_clk_b_a", 3009 + "audio_clk_b_b", 3010 + "audio_clk_c_a", 3011 + "audio_clk_c_b", 3012 + "audio_clkout_a", 3013 + "audio_clkout_b", 3014 + "audio_clkout_c", 3015 + "audio_clkout_d", 3016 + "audio_clkout1_a", 3017 + "audio_clkout1_b", 3018 + "audio_clkout2_a", 3019 + "audio_clkout2_b", 3020 + "audio_clkout3_a", 3021 + "audio_clkout3_b", 4070 3022 }; 4071 3023 4072 3024 static const char * const avb_groups[] = { ··· 4154 2962 "avb_avtp_capture_b", 4155 2963 }; 4156 2964 2965 + static const char * const drif0_groups[] = { 2966 + "drif0_ctrl_a", 2967 + "drif0_data0_a", 2968 + "drif0_data1_a", 2969 + "drif0_ctrl_b", 2970 + "drif0_data0_b", 2971 + "drif0_data1_b", 2972 + "drif0_ctrl_c", 2973 + "drif0_data0_c", 2974 + "drif0_data1_c", 2975 + }; 2976 + 2977 + static const char * const drif1_groups[] = { 2978 + "drif1_ctrl_a", 2979 + "drif1_data0_a", 2980 + "drif1_data1_a", 2981 + "drif1_ctrl_b", 2982 + "drif1_data0_b", 2983 + "drif1_data1_b", 2984 + "drif1_ctrl_c", 2985 + "drif1_data0_c", 2986 + "drif1_data1_c", 2987 + }; 2988 + 2989 + static const char * const drif2_groups[] = { 2990 + "drif2_ctrl_a", 2991 + "drif2_data0_a", 2992 + "drif2_data1_a", 2993 + "drif2_ctrl_b", 2994 + "drif2_data0_b", 2995 + "drif2_data1_b", 2996 + }; 2997 + 2998 + static const char * const drif3_groups[] = { 2999 + "drif3_ctrl_a", 3000 + "drif3_data0_a", 3001 + "drif3_data1_a", 3002 + "drif3_ctrl_b", 3003 + "drif3_data0_b", 3004 + "drif3_data1_b", 3005 + }; 3006 + 4157 3007 static const char * const du_groups[] = { 4158 3008 "du_rgb666", 4159 3009 "du_rgb888", ··· 4205 2971 "du_oddf", 4206 2972 "du_cde", 4207 2973 "du_disp", 2974 + }; 2975 + 2976 + static const char * const hscif0_groups[] = { 2977 + "hscif0_data", 2978 + "hscif0_clk", 2979 + "hscif0_ctrl", 2980 + }; 2981 + 2982 + static const char * const hscif1_groups[] = { 2983 + "hscif1_data_a", 2984 + "hscif1_clk_a", 2985 + "hscif1_ctrl_a", 2986 + "hscif1_data_b", 2987 + "hscif1_clk_b", 2988 + "hscif1_ctrl_b", 2989 + }; 2990 + 2991 + static const char * const hscif2_groups[] = { 2992 + "hscif2_data_a", 2993 + "hscif2_clk_a", 2994 + "hscif2_ctrl_a", 2995 + "hscif2_data_b", 2996 + "hscif2_clk_b", 2997 + "hscif2_ctrl_b", 2998 + "hscif2_data_c", 2999 + "hscif2_clk_c", 3000 + "hscif2_ctrl_c", 3001 + }; 3002 + 3003 + static const char * const hscif3_groups[] = { 3004 + "hscif3_data_a", 3005 + "hscif3_clk", 3006 + "hscif3_ctrl", 3007 + "hscif3_data_b", 3008 + "hscif3_data_c", 3009 + "hscif3_data_d", 3010 + }; 3011 + 3012 + static const char * const hscif4_groups[] = { 3013 + "hscif4_data_a", 3014 + "hscif4_clk", 3015 + "hscif4_ctrl", 3016 + "hscif4_data_b", 3017 + }; 3018 + 3019 + static const char * const i2c1_groups[] = { 3020 + "i2c1_a", 3021 + "i2c1_b", 3022 + }; 3023 + 3024 + static const char * const i2c2_groups[] = { 3025 + "i2c2_a", 3026 + "i2c2_b", 3027 + }; 3028 + 3029 + static const char * const i2c6_groups[] = { 3030 + "i2c6_a", 3031 + "i2c6_b", 3032 + "i2c6_c", 3033 + }; 3034 + 3035 + static const char * const intc_ex_groups[] = { 3036 + "intc_ex_irq0", 3037 + "intc_ex_irq1", 3038 + "intc_ex_irq2", 3039 + "intc_ex_irq3", 3040 + "intc_ex_irq4", 3041 + "intc_ex_irq5", 4208 3042 }; 4209 3043 4210 3044 static const char * const msiof0_groups[] = { ··· 4470 3168 "scif_clk_b", 4471 3169 }; 4472 3170 3171 + static const char * const sdhi0_groups[] = { 3172 + "sdhi0_data1", 3173 + "sdhi0_data4", 3174 + "sdhi0_ctrl", 3175 + "sdhi0_cd", 3176 + "sdhi0_wp", 3177 + }; 3178 + 3179 + static const char * const sdhi1_groups[] = { 3180 + "sdhi1_data1", 3181 + "sdhi1_data4", 3182 + "sdhi1_ctrl", 3183 + "sdhi1_cd", 3184 + "sdhi1_wp", 3185 + }; 3186 + 3187 + static const char * const sdhi2_groups[] = { 3188 + "sdhi2_data1", 3189 + "sdhi2_data4", 3190 + "sdhi2_data8", 3191 + "sdhi2_ctrl", 3192 + "sdhi2_cd_a", 3193 + "sdhi2_wp_a", 3194 + "sdhi2_cd_b", 3195 + "sdhi2_wp_b", 3196 + "sdhi2_ds", 3197 + }; 3198 + 3199 + static const char * const sdhi3_groups[] = { 3200 + "sdhi3_data1", 3201 + "sdhi3_data4", 3202 + "sdhi3_data8", 3203 + "sdhi3_ctrl", 3204 + "sdhi3_cd", 3205 + "sdhi3_wp", 3206 + "sdhi3_ds", 3207 + }; 3208 + 3209 + static const char * const ssi_groups[] = { 3210 + "ssi0_data", 3211 + "ssi01239_ctrl", 3212 + "ssi1_data_a", 3213 + "ssi1_data_b", 3214 + "ssi1_ctrl_a", 3215 + "ssi1_ctrl_b", 3216 + "ssi2_data_a", 3217 + "ssi2_data_b", 3218 + "ssi2_ctrl_a", 3219 + "ssi2_ctrl_b", 3220 + "ssi3_data", 3221 + "ssi349_ctrl", 3222 + "ssi4_data", 3223 + "ssi4_ctrl", 3224 + "ssi5_data", 3225 + "ssi5_ctrl", 3226 + "ssi6_data", 3227 + "ssi6_ctrl", 3228 + "ssi7_data", 3229 + "ssi78_ctrl", 3230 + "ssi8_data", 3231 + "ssi9_data_a", 3232 + "ssi9_data_b", 3233 + "ssi9_ctrl_a", 3234 + "ssi9_ctrl_b", 3235 + }; 3236 + 4473 3237 static const char * const usb0_groups[] = { 4474 3238 "usb0", 4475 3239 }; ··· 4552 3184 "usb2_ch3", 4553 3185 }; 4554 3186 3187 + static const char * const usb30_groups[] = { 3188 + "usb30", 3189 + }; 3190 + 4555 3191 static const struct sh_pfc_function pinmux_functions[] = { 3192 + SH_PFC_FUNCTION(audio_clk), 4556 3193 SH_PFC_FUNCTION(avb), 3194 + SH_PFC_FUNCTION(drif0), 3195 + SH_PFC_FUNCTION(drif1), 3196 + SH_PFC_FUNCTION(drif2), 3197 + SH_PFC_FUNCTION(drif3), 4557 3198 SH_PFC_FUNCTION(du), 3199 + SH_PFC_FUNCTION(hscif0), 3200 + SH_PFC_FUNCTION(hscif1), 3201 + SH_PFC_FUNCTION(hscif2), 3202 + SH_PFC_FUNCTION(hscif3), 3203 + SH_PFC_FUNCTION(hscif4), 3204 + SH_PFC_FUNCTION(i2c1), 3205 + SH_PFC_FUNCTION(i2c2), 3206 + SH_PFC_FUNCTION(i2c6), 3207 + SH_PFC_FUNCTION(intc_ex), 4558 3208 SH_PFC_FUNCTION(msiof0), 4559 3209 SH_PFC_FUNCTION(msiof1), 4560 3210 SH_PFC_FUNCTION(msiof2), ··· 4591 3205 SH_PFC_FUNCTION(scif4), 4592 3206 SH_PFC_FUNCTION(scif5), 4593 3207 SH_PFC_FUNCTION(scif_clk), 3208 + SH_PFC_FUNCTION(sdhi0), 3209 + SH_PFC_FUNCTION(sdhi1), 3210 + SH_PFC_FUNCTION(sdhi2), 3211 + SH_PFC_FUNCTION(sdhi3), 3212 + SH_PFC_FUNCTION(ssi), 4594 3213 SH_PFC_FUNCTION(usb0), 4595 3214 SH_PFC_FUNCTION(usb1), 4596 3215 SH_PFC_FUNCTION(usb2), 4597 3216 SH_PFC_FUNCTION(usb2_ch3), 3217 + SH_PFC_FUNCTION(usb30), 4598 3218 }; 4599 3219 4600 3220 static const struct pinmux_cfg_reg pinmux_config_regs[] = { ··· 5413 4021 { }, 5414 4022 }; 5415 4023 4024 + enum ioctrl_regs { 4025 + POCCTRL, 4026 + }; 4027 + 4028 + static const struct pinmux_ioctrl_reg pinmux_ioctrl_regs[] = { 4029 + [POCCTRL] = { 0xe6060380, }, 4030 + { /* sentinel */ }, 4031 + }; 4032 + 5416 4033 static int r8a7795_pin_to_pocctrl(struct sh_pfc *pfc, unsigned int pin, u32 *pocctrl) 5417 4034 { 5418 4035 int bit = -EINVAL; 5419 4036 5420 - *pocctrl = 0xe6060380; 4037 + *pocctrl = pinmux_ioctrl_regs[POCCTRL].reg; 5421 4038 5422 4039 if (pin >= RCAR_GP_PIN(3, 0) && pin <= RCAR_GP_PIN(3, 11)) 5423 4040 bit = pin & 0x1f; ··· 5437 4036 return bit; 5438 4037 } 5439 4038 5440 - #define PUEN 0xe6060400 5441 - #define PUD 0xe6060440 5442 - 5443 - #define PU0 0x00 5444 - #define PU1 0x04 5445 - #define PU2 0x08 5446 - #define PU3 0x0c 5447 - #define PU4 0x10 5448 - #define PU5 0x14 5449 - #define PU6 0x18 5450 - 5451 - static const struct sh_pfc_bias_info bias_info[] = { 5452 - { RCAR_GP_PIN(2, 11), PU0, 31 }, /* AVB_PHY_INT */ 5453 - { RCAR_GP_PIN(2, 10), PU0, 30 }, /* AVB_MAGIC */ 5454 - { RCAR_GP_PIN(2, 9), PU0, 29 }, /* AVB_MDC */ 5455 - { PIN_NUMBER('A', 9), PU0, 28 }, /* AVB_MDIO */ 5456 - { PIN_NUMBER('A', 12), PU0, 27 }, /* AVB_TXCREFCLK */ 5457 - { PIN_NUMBER('B', 17), PU0, 26 }, /* AVB_TD3 */ 5458 - { PIN_NUMBER('A', 17), PU0, 25 }, /* AVB_TD2 */ 5459 - { PIN_NUMBER('B', 18), PU0, 24 }, /* AVB_TD1 */ 5460 - { PIN_NUMBER('A', 18), PU0, 23 }, /* AVB_TD0 */ 5461 - { PIN_NUMBER('A', 19), PU0, 22 }, /* AVB_TXC */ 5462 - { PIN_NUMBER('A', 8), PU0, 21 }, /* AVB_TX_CTL */ 5463 - { PIN_NUMBER('B', 14), PU0, 20 }, /* AVB_RD3 */ 5464 - { PIN_NUMBER('A', 14), PU0, 19 }, /* AVB_RD2 */ 5465 - { PIN_NUMBER('B', 13), PU0, 18 }, /* AVB_RD1 */ 5466 - { PIN_NUMBER('A', 13), PU0, 17 }, /* AVB_RD0 */ 5467 - { PIN_NUMBER('B', 19), PU0, 16 }, /* AVB_RXC */ 5468 - { PIN_NUMBER('A', 16), PU0, 15 }, /* AVB_RX_CTL */ 5469 - { PIN_NUMBER('V', 7), PU0, 14 }, /* RPC_RESET# */ 5470 - { PIN_NUMBER('V', 6), PU0, 13 }, /* RPC_WP# */ 5471 - { PIN_NUMBER('Y', 7), PU0, 12 }, /* RPC_INT# */ 5472 - { PIN_NUMBER('V', 5), PU0, 11 }, /* QSPI1_SSL */ 5473 - { PIN_A_NUMBER('C', 3), PU0, 10 }, /* QSPI1_IO3 */ 5474 - { PIN_A_NUMBER('E', 4), PU0, 9 }, /* QSPI1_IO2 */ 5475 - { PIN_A_NUMBER('E', 5), PU0, 8 }, /* QSPI1_MISO_IO1 */ 5476 - { PIN_A_NUMBER('C', 7), PU0, 7 }, /* QSPI1_MOSI_IO0 */ 5477 - { PIN_NUMBER('V', 3), PU0, 6 }, /* QSPI1_SPCLK */ 5478 - { PIN_NUMBER('Y', 3), PU0, 5 }, /* QSPI0_SSL */ 5479 - { PIN_A_NUMBER('B', 6), PU0, 4 }, /* QSPI0_IO3 */ 5480 - { PIN_NUMBER('Y', 6), PU0, 3 }, /* QSPI0_IO2 */ 5481 - { PIN_A_NUMBER('B', 4), PU0, 2 }, /* QSPI0_MISO_IO1 */ 5482 - { PIN_A_NUMBER('C', 5), PU0, 1 }, /* QSPI0_MOSI_IO0 */ 5483 - { PIN_NUMBER('W', 3), PU0, 0 }, /* QSPI0_SPCLK */ 5484 - 5485 - { RCAR_GP_PIN(1, 19), PU1, 31 }, /* A19 */ 5486 - { RCAR_GP_PIN(1, 18), PU1, 30 }, /* A18 */ 5487 - { RCAR_GP_PIN(1, 17), PU1, 29 }, /* A17 */ 5488 - { RCAR_GP_PIN(1, 16), PU1, 28 }, /* A16 */ 5489 - { RCAR_GP_PIN(1, 15), PU1, 27 }, /* A15 */ 5490 - { RCAR_GP_PIN(1, 14), PU1, 26 }, /* A14 */ 5491 - { RCAR_GP_PIN(1, 13), PU1, 25 }, /* A13 */ 5492 - { RCAR_GP_PIN(1, 12), PU1, 24 }, /* A12 */ 5493 - { RCAR_GP_PIN(1, 11), PU1, 23 }, /* A11 */ 5494 - { RCAR_GP_PIN(1, 10), PU1, 22 }, /* A10 */ 5495 - { RCAR_GP_PIN(1, 9), PU1, 21 }, /* A9 */ 5496 - { RCAR_GP_PIN(1, 8), PU1, 20 }, /* A8 */ 5497 - { RCAR_GP_PIN(1, 7), PU1, 19 }, /* A7 */ 5498 - { RCAR_GP_PIN(1, 6), PU1, 18 }, /* A6 */ 5499 - { RCAR_GP_PIN(1, 5), PU1, 17 }, /* A5 */ 5500 - { RCAR_GP_PIN(1, 4), PU1, 16 }, /* A4 */ 5501 - { RCAR_GP_PIN(1, 3), PU1, 15 }, /* A3 */ 5502 - { RCAR_GP_PIN(1, 2), PU1, 14 }, /* A2 */ 5503 - { RCAR_GP_PIN(1, 1), PU1, 13 }, /* A1 */ 5504 - { RCAR_GP_PIN(1, 0), PU1, 12 }, /* A0 */ 5505 - { RCAR_GP_PIN(2, 8), PU1, 11 }, /* PWM2_A */ 5506 - { RCAR_GP_PIN(2, 7), PU1, 10 }, /* PWM1_A */ 5507 - { RCAR_GP_PIN(2, 6), PU1, 9 }, /* PWM0 */ 5508 - { RCAR_GP_PIN(2, 5), PU1, 8 }, /* IRQ5 */ 5509 - { RCAR_GP_PIN(2, 4), PU1, 7 }, /* IRQ4 */ 5510 - { RCAR_GP_PIN(2, 3), PU1, 6 }, /* IRQ3 */ 5511 - { RCAR_GP_PIN(2, 2), PU1, 5 }, /* IRQ2 */ 5512 - { RCAR_GP_PIN(2, 1), PU1, 4 }, /* IRQ1 */ 5513 - { RCAR_GP_PIN(2, 0), PU1, 3 }, /* IRQ0 */ 5514 - { RCAR_GP_PIN(2, 14), PU1, 2 }, /* AVB_AVTP_CAPTURE_A */ 5515 - { RCAR_GP_PIN(2, 13), PU1, 1 }, /* AVB_AVTP_MATCH_A */ 5516 - { RCAR_GP_PIN(2, 12), PU1, 0 }, /* AVB_LINK */ 5517 - 5518 - { PIN_A_NUMBER('P', 8), PU2, 31 }, /* DU_DOTCLKIN1 */ 5519 - { PIN_A_NUMBER('P', 7), PU2, 30 }, /* DU_DOTCLKIN0 */ 5520 - { RCAR_GP_PIN(7, 3), PU2, 29 }, /* HDMI1_CEC */ 5521 - { RCAR_GP_PIN(7, 2), PU2, 28 }, /* HDMI0_CEC */ 5522 - { RCAR_GP_PIN(7, 1), PU2, 27 }, /* AVS2 */ 5523 - { RCAR_GP_PIN(7, 0), PU2, 26 }, /* AVS1 */ 5524 - { RCAR_GP_PIN(0, 15), PU2, 25 }, /* D15 */ 5525 - { RCAR_GP_PIN(0, 14), PU2, 24 }, /* D14 */ 5526 - { RCAR_GP_PIN(0, 13), PU2, 23 }, /* D13 */ 5527 - { RCAR_GP_PIN(0, 12), PU2, 22 }, /* D12 */ 5528 - { RCAR_GP_PIN(0, 11), PU2, 21 }, /* D11 */ 5529 - { RCAR_GP_PIN(0, 10), PU2, 20 }, /* D10 */ 5530 - { RCAR_GP_PIN(0, 9), PU2, 19 }, /* D9 */ 5531 - { RCAR_GP_PIN(0, 8), PU2, 18 }, /* D8 */ 5532 - { RCAR_GP_PIN(0, 7), PU2, 17 }, /* D7 */ 5533 - { RCAR_GP_PIN(0, 6), PU2, 16 }, /* D6 */ 5534 - { RCAR_GP_PIN(0, 5), PU2, 15 }, /* D5 */ 5535 - { RCAR_GP_PIN(0, 4), PU2, 14 }, /* D4 */ 5536 - { RCAR_GP_PIN(0, 3), PU2, 13 }, /* D3 */ 5537 - { RCAR_GP_PIN(0, 2), PU2, 12 }, /* D2 */ 5538 - { RCAR_GP_PIN(0, 1), PU2, 11 }, /* D1 */ 5539 - { RCAR_GP_PIN(0, 0), PU2, 10 }, /* D0 */ 5540 - { PIN_NUMBER('C', 1), PU2, 9 }, /* PRESETOUT# */ 5541 - { RCAR_GP_PIN(1, 27), PU2, 8 }, /* EX_WAIT0_A */ 5542 - { RCAR_GP_PIN(1, 26), PU2, 7 }, /* WE1_N */ 5543 - { RCAR_GP_PIN(1, 25), PU2, 6 }, /* WE0_N */ 5544 - { RCAR_GP_PIN(1, 24), PU2, 5 }, /* RD_WR_N */ 5545 - { RCAR_GP_PIN(1, 23), PU2, 4 }, /* RD_N */ 5546 - { RCAR_GP_PIN(1, 22), PU2, 3 }, /* BS_N */ 5547 - { RCAR_GP_PIN(1, 21), PU2, 2 }, /* CS1_N */ 5548 - { RCAR_GP_PIN(1, 20), PU2, 1 }, /* CS0_N */ 5549 - { PIN_NUMBER('F', 1), PU2, 0 }, /* CLKOUT */ 5550 - 5551 - { RCAR_GP_PIN(4, 9), PU3, 31 }, /* SD3_DAT0 */ 5552 - { RCAR_GP_PIN(4, 8), PU3, 30 }, /* SD3_CMD */ 5553 - { RCAR_GP_PIN(4, 7), PU3, 29 }, /* SD3_CLK */ 5554 - { RCAR_GP_PIN(4, 6), PU3, 28 }, /* SD2_DS */ 5555 - { RCAR_GP_PIN(4, 5), PU3, 27 }, /* SD2_DAT3 */ 5556 - { RCAR_GP_PIN(4, 4), PU3, 26 }, /* SD2_DAT2 */ 5557 - { RCAR_GP_PIN(4, 3), PU3, 25 }, /* SD2_DAT1 */ 5558 - { RCAR_GP_PIN(4, 2), PU3, 24 }, /* SD2_DAT0 */ 5559 - { RCAR_GP_PIN(4, 1), PU3, 23 }, /* SD2_CMD */ 5560 - { RCAR_GP_PIN(4, 0), PU3, 22 }, /* SD2_CLK */ 5561 - { RCAR_GP_PIN(3, 11), PU3, 21 }, /* SD1_DAT3 */ 5562 - { RCAR_GP_PIN(3, 10), PU3, 20 }, /* SD1_DAT2 */ 5563 - { RCAR_GP_PIN(3, 9), PU3, 19 }, /* SD1_DAT1 */ 5564 - { RCAR_GP_PIN(3, 8), PU3, 18 }, /* SD1_DAT0 */ 5565 - { RCAR_GP_PIN(3, 7), PU3, 17 }, /* SD1_CMD */ 5566 - { RCAR_GP_PIN(3, 6), PU3, 16 }, /* SD1_CLK */ 5567 - { RCAR_GP_PIN(3, 5), PU3, 15 }, /* SD0_DAT3 */ 5568 - { RCAR_GP_PIN(3, 4), PU3, 14 }, /* SD0_DAT2 */ 5569 - { RCAR_GP_PIN(3, 3), PU3, 13 }, /* SD0_DAT1 */ 5570 - { RCAR_GP_PIN(3, 2), PU3, 12 }, /* SD0_DAT0 */ 5571 - { RCAR_GP_PIN(3, 1), PU3, 11 }, /* SD0_CMD */ 5572 - { RCAR_GP_PIN(3, 0), PU3, 10 }, /* SD0_CLK */ 5573 - { PIN_A_NUMBER('T', 30), PU3, 9 }, /* ASEBRK */ 5574 - /* bit 8 n/a */ 5575 - { PIN_A_NUMBER('R', 29), PU3, 7 }, /* TDI */ 5576 - { PIN_A_NUMBER('R', 30), PU3, 6 }, /* TMS */ 5577 - { PIN_A_NUMBER('T', 27), PU3, 5 }, /* TCK */ 5578 - { PIN_A_NUMBER('R', 26), PU3, 4 }, /* TRST# */ 5579 - { PIN_A_NUMBER('D', 39), PU3, 3 }, /* EXTALR*/ 5580 - { PIN_A_NUMBER('D', 38), PU3, 2 }, /* FSCLKST# */ 5581 - { PIN_A_NUMBER('R', 8), PU3, 1 }, /* DU_DOTCLKIN3 */ 5582 - { PIN_A_NUMBER('R', 7), PU3, 0 }, /* DU_DOTCLKIN2 */ 5583 - 5584 - { RCAR_GP_PIN(5, 19), PU4, 31 }, /* MSIOF0_SS1 */ 5585 - { RCAR_GP_PIN(5, 18), PU4, 30 }, /* MSIOF0_SYNC */ 5586 - { RCAR_GP_PIN(5, 17), PU4, 29 }, /* MSIOF0_SCK */ 5587 - { RCAR_GP_PIN(5, 16), PU4, 28 }, /* HRTS0_N */ 5588 - { RCAR_GP_PIN(5, 15), PU4, 27 }, /* HCTS0_N */ 5589 - { RCAR_GP_PIN(5, 14), PU4, 26 }, /* HTX0 */ 5590 - { RCAR_GP_PIN(5, 13), PU4, 25 }, /* HRX0 */ 5591 - { RCAR_GP_PIN(5, 12), PU4, 24 }, /* HSCK0 */ 5592 - { RCAR_GP_PIN(5, 11), PU4, 23 }, /* RX2_A */ 5593 - { RCAR_GP_PIN(5, 10), PU4, 22 }, /* TX2_A */ 5594 - { RCAR_GP_PIN(5, 9), PU4, 21 }, /* SCK2 */ 5595 - { RCAR_GP_PIN(5, 8), PU4, 20 }, /* RTS1_N_TANS */ 5596 - { RCAR_GP_PIN(5, 7), PU4, 19 }, /* CTS1_N */ 5597 - { RCAR_GP_PIN(5, 6), PU4, 18 }, /* TX1_A */ 5598 - { RCAR_GP_PIN(5, 5), PU4, 17 }, /* RX1_A */ 5599 - { RCAR_GP_PIN(5, 4), PU4, 16 }, /* RTS0_N_TANS */ 5600 - { RCAR_GP_PIN(5, 3), PU4, 15 }, /* CTS0_N */ 5601 - { RCAR_GP_PIN(5, 2), PU4, 14 }, /* TX0 */ 5602 - { RCAR_GP_PIN(5, 1), PU4, 13 }, /* RX0 */ 5603 - { RCAR_GP_PIN(5, 0), PU4, 12 }, /* SCK0 */ 5604 - { RCAR_GP_PIN(3, 15), PU4, 11 }, /* SD1_WP */ 5605 - { RCAR_GP_PIN(3, 14), PU4, 10 }, /* SD1_CD */ 5606 - { RCAR_GP_PIN(3, 13), PU4, 9 }, /* SD0_WP */ 5607 - { RCAR_GP_PIN(3, 12), PU4, 8 }, /* SD0_CD */ 5608 - { RCAR_GP_PIN(4, 17), PU4, 7 }, /* SD3_DS */ 5609 - { RCAR_GP_PIN(4, 16), PU4, 6 }, /* SD3_DAT7 */ 5610 - { RCAR_GP_PIN(4, 15), PU4, 5 }, /* SD3_DAT6 */ 5611 - { RCAR_GP_PIN(4, 14), PU4, 4 }, /* SD3_DAT5 */ 5612 - { RCAR_GP_PIN(4, 13), PU4, 3 }, /* SD3_DAT4 */ 5613 - { RCAR_GP_PIN(4, 12), PU4, 2 }, /* SD3_DAT3 */ 5614 - { RCAR_GP_PIN(4, 11), PU4, 1 }, /* SD3_DAT2 */ 5615 - { RCAR_GP_PIN(4, 10), PU4, 0 }, /* SD3_DAT1 */ 5616 - 5617 - { RCAR_GP_PIN(6, 24), PU5, 31 }, /* USB0_PWEN */ 5618 - { RCAR_GP_PIN(6, 23), PU5, 30 }, /* AUDIO_CLKB_B */ 5619 - { RCAR_GP_PIN(6, 22), PU5, 29 }, /* AUDIO_CLKA_A */ 5620 - { RCAR_GP_PIN(6, 21), PU5, 28 }, /* SSI_SDATA9_A */ 5621 - { RCAR_GP_PIN(6, 20), PU5, 27 }, /* SSI_SDATA8 */ 5622 - { RCAR_GP_PIN(6, 19), PU5, 26 }, /* SSI_SDATA7 */ 5623 - { RCAR_GP_PIN(6, 18), PU5, 25 }, /* SSI_WS78 */ 5624 - { RCAR_GP_PIN(6, 17), PU5, 24 }, /* SSI_SCK78 */ 5625 - { RCAR_GP_PIN(6, 16), PU5, 23 }, /* SSI_SDATA6 */ 5626 - { RCAR_GP_PIN(6, 15), PU5, 22 }, /* SSI_WS6 */ 5627 - { RCAR_GP_PIN(6, 14), PU5, 21 }, /* SSI_SCK6 */ 5628 - { RCAR_GP_PIN(6, 13), PU5, 20 }, /* SSI_SDATA5 */ 5629 - { RCAR_GP_PIN(6, 12), PU5, 19 }, /* SSI_WS5 */ 5630 - { RCAR_GP_PIN(6, 11), PU5, 18 }, /* SSI_SCK5 */ 5631 - { RCAR_GP_PIN(6, 10), PU5, 17 }, /* SSI_SDATA4 */ 5632 - { RCAR_GP_PIN(6, 9), PU5, 16 }, /* SSI_WS4 */ 5633 - { RCAR_GP_PIN(6, 8), PU5, 15 }, /* SSI_SCK4 */ 5634 - { RCAR_GP_PIN(6, 7), PU5, 14 }, /* SSI_SDATA3 */ 5635 - { RCAR_GP_PIN(6, 6), PU5, 13 }, /* SSI_WS349 */ 5636 - { RCAR_GP_PIN(6, 5), PU5, 12 }, /* SSI_SCK349 */ 5637 - { RCAR_GP_PIN(6, 4), PU5, 11 }, /* SSI_SDATA2_A */ 5638 - { RCAR_GP_PIN(6, 3), PU5, 10 }, /* SSI_SDATA1_A */ 5639 - { RCAR_GP_PIN(6, 2), PU5, 9 }, /* SSI_SDATA0 */ 5640 - { RCAR_GP_PIN(6, 1), PU5, 8 }, /* SSI_WS01239 */ 5641 - { RCAR_GP_PIN(6, 0), PU5, 7 }, /* SSI_SCK01239 */ 5642 - { PIN_NUMBER('H', 37), PU5, 6 }, /* MLB_REF */ 5643 - { RCAR_GP_PIN(5, 25), PU5, 5 }, /* MLB_DAT */ 5644 - { RCAR_GP_PIN(5, 24), PU5, 4 }, /* MLB_SIG */ 5645 - { RCAR_GP_PIN(5, 23), PU5, 3 }, /* MLB_CLK */ 5646 - { RCAR_GP_PIN(5, 22), PU5, 2 }, /* MSIOF0_RXD */ 5647 - { RCAR_GP_PIN(5, 21), PU5, 1 }, /* MSIOF0_SS2 */ 5648 - { RCAR_GP_PIN(5, 20), PU5, 0 }, /* MSIOF0_TXD */ 5649 - 5650 - { RCAR_GP_PIN(6, 31), PU6, 6 }, /* USB2_CH3_OVC */ 5651 - { RCAR_GP_PIN(6, 30), PU6, 5 }, /* USB2_CH3_PWEN */ 5652 - { RCAR_GP_PIN(6, 29), PU6, 4 }, /* USB30_OVC */ 5653 - { RCAR_GP_PIN(6, 28), PU6, 3 }, /* USB30_PWEN */ 5654 - { RCAR_GP_PIN(6, 27), PU6, 2 }, /* USB1_OVC */ 5655 - { RCAR_GP_PIN(6, 26), PU6, 1 }, /* USB1_PWEN */ 5656 - { RCAR_GP_PIN(6, 25), PU6, 0 }, /* USB0_OVC */ 4039 + static const struct pinmux_bias_reg pinmux_bias_regs[] = { 4040 + { PINMUX_BIAS_REG("PUEN0", 0xe6060400, "PUD0", 0xe6060440) { 4041 + [ 0] = PIN_NUMBER('W', 3), /* QSPI0_SPCLK */ 4042 + [ 1] = PIN_A_NUMBER('C', 5), /* QSPI0_MOSI_IO0 */ 4043 + [ 2] = PIN_A_NUMBER('B', 4), /* QSPI0_MISO_IO1 */ 4044 + [ 3] = PIN_NUMBER('Y', 6), /* QSPI0_IO2 */ 4045 + [ 4] = PIN_A_NUMBER('B', 6), /* QSPI0_IO3 */ 4046 + [ 5] = PIN_NUMBER('Y', 3), /* QSPI0_SSL */ 4047 + [ 6] = PIN_NUMBER('V', 3), /* QSPI1_SPCLK */ 4048 + [ 7] = PIN_A_NUMBER('C', 7), /* QSPI1_MOSI_IO0 */ 4049 + [ 8] = PIN_A_NUMBER('E', 5), /* QSPI1_MISO_IO1 */ 4050 + [ 9] = PIN_A_NUMBER('E', 4), /* QSPI1_IO2 */ 4051 + [10] = PIN_A_NUMBER('C', 3), /* QSPI1_IO3 */ 4052 + [11] = PIN_NUMBER('V', 5), /* QSPI1_SSL */ 4053 + [12] = PIN_NUMBER('Y', 7), /* RPC_INT# */ 4054 + [13] = PIN_NUMBER('V', 6), /* RPC_WP# */ 4055 + [14] = PIN_NUMBER('V', 7), /* RPC_RESET# */ 4056 + [15] = PIN_NUMBER('A', 16), /* AVB_RX_CTL */ 4057 + [16] = PIN_NUMBER('B', 19), /* AVB_RXC */ 4058 + [17] = PIN_NUMBER('A', 13), /* AVB_RD0 */ 4059 + [18] = PIN_NUMBER('B', 13), /* AVB_RD1 */ 4060 + [19] = PIN_NUMBER('A', 14), /* AVB_RD2 */ 4061 + [20] = PIN_NUMBER('B', 14), /* AVB_RD3 */ 4062 + [21] = PIN_NUMBER('A', 8), /* AVB_TX_CTL */ 4063 + [22] = PIN_NUMBER('A', 19), /* AVB_TXC */ 4064 + [23] = PIN_NUMBER('A', 18), /* AVB_TD0 */ 4065 + [24] = PIN_NUMBER('B', 18), /* AVB_TD1 */ 4066 + [25] = PIN_NUMBER('A', 17), /* AVB_TD2 */ 4067 + [26] = PIN_NUMBER('B', 17), /* AVB_TD3 */ 4068 + [27] = PIN_NUMBER('A', 12), /* AVB_TXCREFCLK */ 4069 + [28] = PIN_NUMBER('A', 9), /* AVB_MDIO */ 4070 + [29] = RCAR_GP_PIN(2, 9), /* AVB_MDC */ 4071 + [30] = RCAR_GP_PIN(2, 10), /* AVB_MAGIC */ 4072 + [31] = RCAR_GP_PIN(2, 11), /* AVB_PHY_INT */ 4073 + } }, 4074 + { PINMUX_BIAS_REG("PUEN1", 0xe6060404, "PUD1", 0xe6060444) { 4075 + [ 0] = RCAR_GP_PIN(2, 12), /* AVB_LINK */ 4076 + [ 1] = RCAR_GP_PIN(2, 13), /* AVB_AVTP_MATCH_A */ 4077 + [ 2] = RCAR_GP_PIN(2, 14), /* AVB_AVTP_CAPTURE_A */ 4078 + [ 3] = RCAR_GP_PIN(2, 0), /* IRQ0 */ 4079 + [ 4] = RCAR_GP_PIN(2, 1), /* IRQ1 */ 4080 + [ 5] = RCAR_GP_PIN(2, 2), /* IRQ2 */ 4081 + [ 6] = RCAR_GP_PIN(2, 3), /* IRQ3 */ 4082 + [ 7] = RCAR_GP_PIN(2, 4), /* IRQ4 */ 4083 + [ 8] = RCAR_GP_PIN(2, 5), /* IRQ5 */ 4084 + [ 9] = RCAR_GP_PIN(2, 6), /* PWM0 */ 4085 + [10] = RCAR_GP_PIN(2, 7), /* PWM1_A */ 4086 + [11] = RCAR_GP_PIN(2, 8), /* PWM2_A */ 4087 + [12] = RCAR_GP_PIN(1, 0), /* A0 */ 4088 + [13] = RCAR_GP_PIN(1, 1), /* A1 */ 4089 + [14] = RCAR_GP_PIN(1, 2), /* A2 */ 4090 + [15] = RCAR_GP_PIN(1, 3), /* A3 */ 4091 + [16] = RCAR_GP_PIN(1, 4), /* A4 */ 4092 + [17] = RCAR_GP_PIN(1, 5), /* A5 */ 4093 + [18] = RCAR_GP_PIN(1, 6), /* A6 */ 4094 + [19] = RCAR_GP_PIN(1, 7), /* A7 */ 4095 + [20] = RCAR_GP_PIN(1, 8), /* A8 */ 4096 + [21] = RCAR_GP_PIN(1, 9), /* A9 */ 4097 + [22] = RCAR_GP_PIN(1, 10), /* A10 */ 4098 + [23] = RCAR_GP_PIN(1, 11), /* A11 */ 4099 + [24] = RCAR_GP_PIN(1, 12), /* A12 */ 4100 + [25] = RCAR_GP_PIN(1, 13), /* A13 */ 4101 + [26] = RCAR_GP_PIN(1, 14), /* A14 */ 4102 + [27] = RCAR_GP_PIN(1, 15), /* A15 */ 4103 + [28] = RCAR_GP_PIN(1, 16), /* A16 */ 4104 + [29] = RCAR_GP_PIN(1, 17), /* A17 */ 4105 + [30] = RCAR_GP_PIN(1, 18), /* A18 */ 4106 + [31] = RCAR_GP_PIN(1, 19), /* A19 */ 4107 + } }, 4108 + { PINMUX_BIAS_REG("PUEN2", 0xe6060408, "PUD2", 0xe6060448) { 4109 + [ 0] = PIN_NUMBER('F', 1), /* CLKOUT */ 4110 + [ 1] = RCAR_GP_PIN(1, 20), /* CS0_N */ 4111 + [ 2] = RCAR_GP_PIN(1, 21), /* CS1_N */ 4112 + [ 3] = RCAR_GP_PIN(1, 22), /* BS_N */ 4113 + [ 4] = RCAR_GP_PIN(1, 23), /* RD_N */ 4114 + [ 5] = RCAR_GP_PIN(1, 24), /* RD_WR_N */ 4115 + [ 6] = RCAR_GP_PIN(1, 25), /* WE0_N */ 4116 + [ 7] = RCAR_GP_PIN(1, 26), /* WE1_N */ 4117 + [ 8] = RCAR_GP_PIN(1, 27), /* EX_WAIT0_A */ 4118 + [ 9] = PIN_NUMBER('C', 1), /* PRESETOUT# */ 4119 + [10] = RCAR_GP_PIN(0, 0), /* D0 */ 4120 + [11] = RCAR_GP_PIN(0, 1), /* D1 */ 4121 + [12] = RCAR_GP_PIN(0, 2), /* D2 */ 4122 + [13] = RCAR_GP_PIN(0, 3), /* D3 */ 4123 + [14] = RCAR_GP_PIN(0, 4), /* D4 */ 4124 + [15] = RCAR_GP_PIN(0, 5), /* D5 */ 4125 + [16] = RCAR_GP_PIN(0, 6), /* D6 */ 4126 + [17] = RCAR_GP_PIN(0, 7), /* D7 */ 4127 + [18] = RCAR_GP_PIN(0, 8), /* D8 */ 4128 + [19] = RCAR_GP_PIN(0, 9), /* D9 */ 4129 + [20] = RCAR_GP_PIN(0, 10), /* D10 */ 4130 + [21] = RCAR_GP_PIN(0, 11), /* D11 */ 4131 + [22] = RCAR_GP_PIN(0, 12), /* D12 */ 4132 + [23] = RCAR_GP_PIN(0, 13), /* D13 */ 4133 + [24] = RCAR_GP_PIN(0, 14), /* D14 */ 4134 + [25] = RCAR_GP_PIN(0, 15), /* D15 */ 4135 + [26] = RCAR_GP_PIN(7, 0), /* AVS1 */ 4136 + [27] = RCAR_GP_PIN(7, 1), /* AVS2 */ 4137 + [28] = RCAR_GP_PIN(7, 2), /* HDMI0_CEC */ 4138 + [29] = RCAR_GP_PIN(7, 3), /* HDMI1_CEC */ 4139 + [30] = PIN_A_NUMBER('P', 7), /* DU_DOTCLKIN0 */ 4140 + [31] = PIN_A_NUMBER('P', 8), /* DU_DOTCLKIN1 */ 4141 + } }, 4142 + { PINMUX_BIAS_REG("PUEN3", 0xe606040c, "PUD3", 0xe606044c) { 4143 + [ 0] = PIN_A_NUMBER('R', 7), /* DU_DOTCLKIN2 */ 4144 + [ 1] = PIN_A_NUMBER('R', 8), /* DU_DOTCLKIN3 */ 4145 + [ 2] = PIN_A_NUMBER('D', 38), /* FSCLKST# */ 4146 + [ 3] = PIN_A_NUMBER('D', 39), /* EXTALR*/ 4147 + [ 4] = PIN_A_NUMBER('R', 26), /* TRST# */ 4148 + [ 5] = PIN_A_NUMBER('T', 27), /* TCK */ 4149 + [ 6] = PIN_A_NUMBER('R', 30), /* TMS */ 4150 + [ 7] = PIN_A_NUMBER('R', 29), /* TDI */ 4151 + [ 8] = PIN_NONE, 4152 + [ 9] = PIN_A_NUMBER('T', 30), /* ASEBRK */ 4153 + [10] = RCAR_GP_PIN(3, 0), /* SD0_CLK */ 4154 + [11] = RCAR_GP_PIN(3, 1), /* SD0_CMD */ 4155 + [12] = RCAR_GP_PIN(3, 2), /* SD0_DAT0 */ 4156 + [13] = RCAR_GP_PIN(3, 3), /* SD0_DAT1 */ 4157 + [14] = RCAR_GP_PIN(3, 4), /* SD0_DAT2 */ 4158 + [15] = RCAR_GP_PIN(3, 5), /* SD0_DAT3 */ 4159 + [16] = RCAR_GP_PIN(3, 6), /* SD1_CLK */ 4160 + [17] = RCAR_GP_PIN(3, 7), /* SD1_CMD */ 4161 + [18] = RCAR_GP_PIN(3, 8), /* SD1_DAT0 */ 4162 + [19] = RCAR_GP_PIN(3, 9), /* SD1_DAT1 */ 4163 + [20] = RCAR_GP_PIN(3, 10), /* SD1_DAT2 */ 4164 + [21] = RCAR_GP_PIN(3, 11), /* SD1_DAT3 */ 4165 + [22] = RCAR_GP_PIN(4, 0), /* SD2_CLK */ 4166 + [23] = RCAR_GP_PIN(4, 1), /* SD2_CMD */ 4167 + [24] = RCAR_GP_PIN(4, 2), /* SD2_DAT0 */ 4168 + [25] = RCAR_GP_PIN(4, 3), /* SD2_DAT1 */ 4169 + [26] = RCAR_GP_PIN(4, 4), /* SD2_DAT2 */ 4170 + [27] = RCAR_GP_PIN(4, 5), /* SD2_DAT3 */ 4171 + [28] = RCAR_GP_PIN(4, 6), /* SD2_DS */ 4172 + [29] = RCAR_GP_PIN(4, 7), /* SD3_CLK */ 4173 + [30] = RCAR_GP_PIN(4, 8), /* SD3_CMD */ 4174 + [31] = RCAR_GP_PIN(4, 9), /* SD3_DAT0 */ 4175 + } }, 4176 + { PINMUX_BIAS_REG("PUEN4", 0xe6060410, "PUD4", 0xe6060450) { 4177 + [ 0] = RCAR_GP_PIN(4, 10), /* SD3_DAT1 */ 4178 + [ 1] = RCAR_GP_PIN(4, 11), /* SD3_DAT2 */ 4179 + [ 2] = RCAR_GP_PIN(4, 12), /* SD3_DAT3 */ 4180 + [ 3] = RCAR_GP_PIN(4, 13), /* SD3_DAT4 */ 4181 + [ 4] = RCAR_GP_PIN(4, 14), /* SD3_DAT5 */ 4182 + [ 5] = RCAR_GP_PIN(4, 15), /* SD3_DAT6 */ 4183 + [ 6] = RCAR_GP_PIN(4, 16), /* SD3_DAT7 */ 4184 + [ 7] = RCAR_GP_PIN(4, 17), /* SD3_DS */ 4185 + [ 8] = RCAR_GP_PIN(3, 12), /* SD0_CD */ 4186 + [ 9] = RCAR_GP_PIN(3, 13), /* SD0_WP */ 4187 + [10] = RCAR_GP_PIN(3, 14), /* SD1_CD */ 4188 + [11] = RCAR_GP_PIN(3, 15), /* SD1_WP */ 4189 + [12] = RCAR_GP_PIN(5, 0), /* SCK0 */ 4190 + [13] = RCAR_GP_PIN(5, 1), /* RX0 */ 4191 + [14] = RCAR_GP_PIN(5, 2), /* TX0 */ 4192 + [15] = RCAR_GP_PIN(5, 3), /* CTS0_N */ 4193 + [16] = RCAR_GP_PIN(5, 4), /* RTS0_N_TANS */ 4194 + [17] = RCAR_GP_PIN(5, 5), /* RX1_A */ 4195 + [18] = RCAR_GP_PIN(5, 6), /* TX1_A */ 4196 + [19] = RCAR_GP_PIN(5, 7), /* CTS1_N */ 4197 + [20] = RCAR_GP_PIN(5, 8), /* RTS1_N_TANS */ 4198 + [21] = RCAR_GP_PIN(5, 9), /* SCK2 */ 4199 + [22] = RCAR_GP_PIN(5, 10), /* TX2_A */ 4200 + [23] = RCAR_GP_PIN(5, 11), /* RX2_A */ 4201 + [24] = RCAR_GP_PIN(5, 12), /* HSCK0 */ 4202 + [25] = RCAR_GP_PIN(5, 13), /* HRX0 */ 4203 + [26] = RCAR_GP_PIN(5, 14), /* HTX0 */ 4204 + [27] = RCAR_GP_PIN(5, 15), /* HCTS0_N */ 4205 + [28] = RCAR_GP_PIN(5, 16), /* HRTS0_N */ 4206 + [29] = RCAR_GP_PIN(5, 17), /* MSIOF0_SCK */ 4207 + [30] = RCAR_GP_PIN(5, 18), /* MSIOF0_SYNC */ 4208 + [31] = RCAR_GP_PIN(5, 19), /* MSIOF0_SS1 */ 4209 + } }, 4210 + { PINMUX_BIAS_REG("PUEN5", 0xe6060414, "PUD5", 0xe6060454) { 4211 + [ 0] = RCAR_GP_PIN(5, 20), /* MSIOF0_TXD */ 4212 + [ 1] = RCAR_GP_PIN(5, 21), /* MSIOF0_SS2 */ 4213 + [ 2] = RCAR_GP_PIN(5, 22), /* MSIOF0_RXD */ 4214 + [ 3] = RCAR_GP_PIN(5, 23), /* MLB_CLK */ 4215 + [ 4] = RCAR_GP_PIN(5, 24), /* MLB_SIG */ 4216 + [ 5] = RCAR_GP_PIN(5, 25), /* MLB_DAT */ 4217 + [ 6] = PIN_NUMBER('H', 37), /* MLB_REF */ 4218 + [ 7] = RCAR_GP_PIN(6, 0), /* SSI_SCK01239 */ 4219 + [ 8] = RCAR_GP_PIN(6, 1), /* SSI_WS01239 */ 4220 + [ 9] = RCAR_GP_PIN(6, 2), /* SSI_SDATA0 */ 4221 + [10] = RCAR_GP_PIN(6, 3), /* SSI_SDATA1_A */ 4222 + [11] = RCAR_GP_PIN(6, 4), /* SSI_SDATA2_A */ 4223 + [12] = RCAR_GP_PIN(6, 5), /* SSI_SCK349 */ 4224 + [13] = RCAR_GP_PIN(6, 6), /* SSI_WS349 */ 4225 + [14] = RCAR_GP_PIN(6, 7), /* SSI_SDATA3 */ 4226 + [15] = RCAR_GP_PIN(6, 8), /* SSI_SCK4 */ 4227 + [16] = RCAR_GP_PIN(6, 9), /* SSI_WS4 */ 4228 + [17] = RCAR_GP_PIN(6, 10), /* SSI_SDATA4 */ 4229 + [18] = RCAR_GP_PIN(6, 11), /* SSI_SCK5 */ 4230 + [19] = RCAR_GP_PIN(6, 12), /* SSI_WS5 */ 4231 + [20] = RCAR_GP_PIN(6, 13), /* SSI_SDATA5 */ 4232 + [21] = RCAR_GP_PIN(6, 14), /* SSI_SCK6 */ 4233 + [22] = RCAR_GP_PIN(6, 15), /* SSI_WS6 */ 4234 + [23] = RCAR_GP_PIN(6, 16), /* SSI_SDATA6 */ 4235 + [24] = RCAR_GP_PIN(6, 17), /* SSI_SCK78 */ 4236 + [25] = RCAR_GP_PIN(6, 18), /* SSI_WS78 */ 4237 + [26] = RCAR_GP_PIN(6, 19), /* SSI_SDATA7 */ 4238 + [27] = RCAR_GP_PIN(6, 20), /* SSI_SDATA8 */ 4239 + [28] = RCAR_GP_PIN(6, 21), /* SSI_SDATA9_A */ 4240 + [29] = RCAR_GP_PIN(6, 22), /* AUDIO_CLKA_A */ 4241 + [30] = RCAR_GP_PIN(6, 23), /* AUDIO_CLKB_B */ 4242 + [31] = RCAR_GP_PIN(6, 24), /* USB0_PWEN */ 4243 + } }, 4244 + { PINMUX_BIAS_REG("PUEN6", 0xe6060418, "PUD6", 0xe6060458) { 4245 + [ 0] = RCAR_GP_PIN(6, 25), /* USB0_OVC */ 4246 + [ 1] = RCAR_GP_PIN(6, 26), /* USB1_PWEN */ 4247 + [ 2] = RCAR_GP_PIN(6, 27), /* USB1_OVC */ 4248 + [ 3] = RCAR_GP_PIN(6, 28), /* USB30_PWEN */ 4249 + [ 4] = RCAR_GP_PIN(6, 29), /* USB30_OVC */ 4250 + [ 5] = RCAR_GP_PIN(6, 30), /* USB2_CH3_PWEN */ 4251 + [ 6] = RCAR_GP_PIN(6, 31), /* USB2_CH3_OVC */ 4252 + [ 7] = PIN_NONE, 4253 + [ 8] = PIN_NONE, 4254 + [ 9] = PIN_NONE, 4255 + [10] = PIN_NONE, 4256 + [11] = PIN_NONE, 4257 + [12] = PIN_NONE, 4258 + [13] = PIN_NONE, 4259 + [14] = PIN_NONE, 4260 + [15] = PIN_NONE, 4261 + [16] = PIN_NONE, 4262 + [17] = PIN_NONE, 4263 + [18] = PIN_NONE, 4264 + [19] = PIN_NONE, 4265 + [20] = PIN_NONE, 4266 + [21] = PIN_NONE, 4267 + [22] = PIN_NONE, 4268 + [23] = PIN_NONE, 4269 + [24] = PIN_NONE, 4270 + [25] = PIN_NONE, 4271 + [26] = PIN_NONE, 4272 + [27] = PIN_NONE, 4273 + [28] = PIN_NONE, 4274 + [29] = PIN_NONE, 4275 + [30] = PIN_NONE, 4276 + [31] = PIN_NONE, 4277 + } }, 4278 + { /* sentinel */ }, 5657 4279 }; 5658 4280 5659 4281 static unsigned int r8a7795_pinmux_get_bias(struct sh_pfc *pfc, 5660 4282 unsigned int pin) 5661 4283 { 5662 - const struct sh_pfc_bias_info *info; 5663 - u32 reg; 5664 - u32 bit; 4284 + const struct pinmux_bias_reg *reg; 4285 + unsigned int bit; 5665 4286 5666 - info = sh_pfc_pin_to_bias_info(bias_info, ARRAY_SIZE(bias_info), pin); 5667 - if (!info) 4287 + reg = sh_pfc_pin_to_bias_reg(pfc, pin, &bit); 4288 + if (!reg) 5668 4289 return PIN_CONFIG_BIAS_DISABLE; 5669 4290 5670 - reg = info->reg; 5671 - bit = BIT(info->bit); 5672 - 5673 - if (!(sh_pfc_read_reg(pfc, PUEN + reg, 32) & bit)) 4291 + if (!(sh_pfc_read(pfc, reg->puen) & BIT(bit))) 5674 4292 return PIN_CONFIG_BIAS_DISABLE; 5675 - else if (sh_pfc_read_reg(pfc, PUD + reg, 32) & bit) 4293 + else if (sh_pfc_read(pfc, reg->pud) & BIT(bit)) 5676 4294 return PIN_CONFIG_BIAS_PULL_UP; 5677 4295 else 5678 4296 return PIN_CONFIG_BIAS_PULL_DOWN; ··· 5700 4280 static void r8a7795_pinmux_set_bias(struct sh_pfc *pfc, unsigned int pin, 5701 4281 unsigned int bias) 5702 4282 { 5703 - const struct sh_pfc_bias_info *info; 4283 + const struct pinmux_bias_reg *reg; 5704 4284 u32 enable, updown; 5705 - u32 reg; 5706 - u32 bit; 4285 + unsigned int bit; 5707 4286 5708 - info = sh_pfc_pin_to_bias_info(bias_info, ARRAY_SIZE(bias_info), pin); 5709 - if (!info) 4287 + reg = sh_pfc_pin_to_bias_reg(pfc, pin, &bit); 4288 + if (!reg) 5710 4289 return; 5711 4290 5712 - reg = info->reg; 5713 - bit = BIT(info->bit); 5714 - 5715 - enable = sh_pfc_read_reg(pfc, PUEN + reg, 32) & ~bit; 4291 + enable = sh_pfc_read(pfc, reg->puen) & ~BIT(bit); 5716 4292 if (bias != PIN_CONFIG_BIAS_DISABLE) 5717 - enable |= bit; 4293 + enable |= BIT(bit); 5718 4294 5719 - updown = sh_pfc_read_reg(pfc, PUD + reg, 32) & ~bit; 4295 + updown = sh_pfc_read(pfc, reg->pud) & ~BIT(bit); 5720 4296 if (bias == PIN_CONFIG_BIAS_PULL_UP) 5721 - updown |= bit; 4297 + updown |= BIT(bit); 5722 4298 5723 - sh_pfc_write_reg(pfc, PUD + reg, 32, updown); 5724 - sh_pfc_write_reg(pfc, PUEN + reg, 32, enable); 4299 + sh_pfc_write(pfc, reg->pud, updown); 4300 + sh_pfc_write(pfc, reg->puen, enable); 5725 4301 } 5726 4302 5727 4303 static const struct soc_device_attribute r8a7795es1[] = { ··· 5756 4340 5757 4341 .cfg_regs = pinmux_config_regs, 5758 4342 .drive_regs = pinmux_drive_regs, 4343 + .bias_regs = pinmux_bias_regs, 4344 + .ioctrl_regs = pinmux_ioctrl_regs, 5759 4345 5760 4346 .pinmux_data = pinmux_data, 5761 4347 .pinmux_data_size = ARRAY_SIZE(pinmux_data),
+330 -243
drivers/pinctrl/sh-pfc/pfc-r8a7796.c
··· 495 495 #define MOD_SEL1_1 FM(SEL_PWM2_0) FM(SEL_PWM2_1) 496 496 #define MOD_SEL1_0 FM(SEL_PWM1_0) FM(SEL_PWM1_1) 497 497 498 - /* MOD_SEL1 */ /* 0 */ /* 1 */ /* 2 */ /* 3 */ /* 4 */ /* 5 */ /* 6 */ /* 7 */ 498 + /* MOD_SEL2 */ /* 0 */ /* 1 */ /* 2 */ /* 3 */ /* 4 */ /* 5 */ /* 6 */ /* 7 */ 499 499 #define MOD_SEL2_31 FM(I2C_SEL_5_0) FM(I2C_SEL_5_1) 500 500 #define MOD_SEL2_30 FM(I2C_SEL_3_0) FM(I2C_SEL_3_1) 501 501 #define MOD_SEL2_29 FM(I2C_SEL_0_0) FM(I2C_SEL_0_1) ··· 1518 1518 #define ROW_GROUP_A(r) ('Z' - 'A' + 1 + (r)) 1519 1519 #define PIN_NUMBER(r, c) (((r) - 'A') * 39 + (c) + 300) 1520 1520 #define PIN_A_NUMBER(r, c) PIN_NUMBER(ROW_GROUP_A(r), c) 1521 + #define PIN_NONE U16_MAX 1521 1522 1522 1523 static const struct sh_pfc_pin pinmux_pins[] = { 1523 1524 PINMUX_GPIO_GP_ALL(), ··· 2391 2390 }; 2392 2391 static const unsigned int i2c6_c_mux[] = { 2393 2392 SDA6_C_MARK, SCL6_C_MARK, 2393 + }; 2394 + 2395 + /* - INTC-EX ---------------------------------------------------------------- */ 2396 + static const unsigned int intc_ex_irq0_pins[] = { 2397 + /* IRQ0 */ 2398 + RCAR_GP_PIN(2, 0), 2399 + }; 2400 + static const unsigned int intc_ex_irq0_mux[] = { 2401 + IRQ0_MARK, 2402 + }; 2403 + static const unsigned int intc_ex_irq1_pins[] = { 2404 + /* IRQ1 */ 2405 + RCAR_GP_PIN(2, 1), 2406 + }; 2407 + static const unsigned int intc_ex_irq1_mux[] = { 2408 + IRQ1_MARK, 2409 + }; 2410 + static const unsigned int intc_ex_irq2_pins[] = { 2411 + /* IRQ2 */ 2412 + RCAR_GP_PIN(2, 2), 2413 + }; 2414 + static const unsigned int intc_ex_irq2_mux[] = { 2415 + IRQ2_MARK, 2416 + }; 2417 + static const unsigned int intc_ex_irq3_pins[] = { 2418 + /* IRQ3 */ 2419 + RCAR_GP_PIN(2, 3), 2420 + }; 2421 + static const unsigned int intc_ex_irq3_mux[] = { 2422 + IRQ3_MARK, 2423 + }; 2424 + static const unsigned int intc_ex_irq4_pins[] = { 2425 + /* IRQ4 */ 2426 + RCAR_GP_PIN(2, 4), 2427 + }; 2428 + static const unsigned int intc_ex_irq4_mux[] = { 2429 + IRQ4_MARK, 2430 + }; 2431 + static const unsigned int intc_ex_irq5_pins[] = { 2432 + /* IRQ5 */ 2433 + RCAR_GP_PIN(2, 5), 2434 + }; 2435 + static const unsigned int intc_ex_irq5_mux[] = { 2436 + IRQ5_MARK, 2394 2437 }; 2395 2438 2396 2439 /* - MSIOF0 ----------------------------------------------------------------- */ ··· 3967 3922 SH_PFC_PIN_GROUP(i2c6_a), 3968 3923 SH_PFC_PIN_GROUP(i2c6_b), 3969 3924 SH_PFC_PIN_GROUP(i2c6_c), 3925 + SH_PFC_PIN_GROUP(intc_ex_irq0), 3926 + SH_PFC_PIN_GROUP(intc_ex_irq1), 3927 + SH_PFC_PIN_GROUP(intc_ex_irq2), 3928 + SH_PFC_PIN_GROUP(intc_ex_irq3), 3929 + SH_PFC_PIN_GROUP(intc_ex_irq4), 3930 + SH_PFC_PIN_GROUP(intc_ex_irq5), 3970 3931 SH_PFC_PIN_GROUP(msiof0_clk), 3971 3932 SH_PFC_PIN_GROUP(msiof0_sync), 3972 3933 SH_PFC_PIN_GROUP(msiof0_ss1), ··· 4337 4286 "i2c6_c", 4338 4287 }; 4339 4288 4289 + static const char * const intc_ex_groups[] = { 4290 + "intc_ex_irq0", 4291 + "intc_ex_irq1", 4292 + "intc_ex_irq2", 4293 + "intc_ex_irq3", 4294 + "intc_ex_irq4", 4295 + "intc_ex_irq5", 4296 + }; 4297 + 4340 4298 static const char * const msiof0_groups[] = { 4341 4299 "msiof0_clk", 4342 4300 "msiof0_sync", ··· 4640 4580 SH_PFC_FUNCTION(i2c1), 4641 4581 SH_PFC_FUNCTION(i2c2), 4642 4582 SH_PFC_FUNCTION(i2c6), 4583 + SH_PFC_FUNCTION(intc_ex), 4643 4584 SH_PFC_FUNCTION(msiof0), 4644 4585 SH_PFC_FUNCTION(msiof1), 4645 4586 SH_PFC_FUNCTION(msiof2), ··· 5477 5416 { }, 5478 5417 }; 5479 5418 5419 + enum ioctrl_regs { 5420 + POCCTRL, 5421 + }; 5422 + 5423 + static const struct pinmux_ioctrl_reg pinmux_ioctrl_regs[] = { 5424 + [POCCTRL] = { 0xe6060380, }, 5425 + { /* sentinel */ }, 5426 + }; 5427 + 5480 5428 static int r8a7796_pin_to_pocctrl(struct sh_pfc *pfc, unsigned int pin, u32 *pocctrl) 5481 5429 { 5482 5430 int bit = -EINVAL; 5483 5431 5484 - *pocctrl = 0xe6060380; 5432 + *pocctrl = pinmux_ioctrl_regs[POCCTRL].reg; 5485 5433 5486 5434 if (pin >= RCAR_GP_PIN(3, 0) && pin <= RCAR_GP_PIN(3, 11)) 5487 5435 bit = pin & 0x1f; ··· 5501 5431 return bit; 5502 5432 } 5503 5433 5504 - #define PUEN 0xe6060400 5505 - #define PUD 0xe6060440 5506 - 5507 - #define PU0 0x00 5508 - #define PU1 0x04 5509 - #define PU2 0x08 5510 - #define PU3 0x0c 5511 - #define PU4 0x10 5512 - #define PU5 0x14 5513 - #define PU6 0x18 5514 - 5515 - static const struct sh_pfc_bias_info bias_info[] = { 5516 - { RCAR_GP_PIN(2, 11), PU0, 31 }, /* AVB_PHY_INT */ 5517 - { RCAR_GP_PIN(2, 10), PU0, 30 }, /* AVB_MAGIC */ 5518 - { RCAR_GP_PIN(2, 9), PU0, 29 }, /* AVB_MDC */ 5519 - { PIN_NUMBER('A', 9), PU0, 28 }, /* AVB_MDIO */ 5520 - { PIN_NUMBER('A', 12), PU0, 27 }, /* AVB_TXCREFCLK */ 5521 - { PIN_NUMBER('B', 17), PU0, 26 }, /* AVB_TD3 */ 5522 - { PIN_NUMBER('A', 17), PU0, 25 }, /* AVB_TD2 */ 5523 - { PIN_NUMBER('B', 18), PU0, 24 }, /* AVB_TD1 */ 5524 - { PIN_NUMBER('A', 18), PU0, 23 }, /* AVB_TD0 */ 5525 - { PIN_NUMBER('A', 19), PU0, 22 }, /* AVB_TXC */ 5526 - { PIN_NUMBER('A', 8), PU0, 21 }, /* AVB_TX_CTL */ 5527 - { PIN_NUMBER('B', 14), PU0, 20 }, /* AVB_RD3 */ 5528 - { PIN_NUMBER('A', 14), PU0, 19 }, /* AVB_RD2 */ 5529 - { PIN_NUMBER('B', 13), PU0, 18 }, /* AVB_RD1 */ 5530 - { PIN_NUMBER('A', 13), PU0, 17 }, /* AVB_RD0 */ 5531 - { PIN_NUMBER('B', 19), PU0, 16 }, /* AVB_RXC */ 5532 - { PIN_NUMBER('A', 16), PU0, 15 }, /* AVB_RX_CTL */ 5533 - { PIN_NUMBER('V', 7), PU0, 14 }, /* RPC_RESET# */ 5534 - { PIN_NUMBER('V', 6), PU0, 13 }, /* RPC_WP# */ 5535 - { PIN_NUMBER('Y', 7), PU0, 12 }, /* RPC_INT# */ 5536 - { PIN_NUMBER('V', 5), PU0, 11 }, /* QSPI1_SSL */ 5537 - { PIN_A_NUMBER('C', 3), PU0, 10 }, /* QSPI1_IO3 */ 5538 - { PIN_A_NUMBER('E', 4), PU0, 9 }, /* QSPI1_IO2 */ 5539 - { PIN_A_NUMBER('E', 5), PU0, 8 }, /* QSPI1_MISO_IO1 */ 5540 - { PIN_A_NUMBER('C', 7), PU0, 7 }, /* QSPI1_MOSI_IO0 */ 5541 - { PIN_NUMBER('V', 3), PU0, 6 }, /* QSPI1_SPCLK */ 5542 - { PIN_NUMBER('Y', 3), PU0, 5 }, /* QSPI0_SSL */ 5543 - { PIN_A_NUMBER('B', 6), PU0, 4 }, /* QSPI0_IO3 */ 5544 - { PIN_NUMBER('Y', 6), PU0, 3 }, /* QSPI0_IO2 */ 5545 - { PIN_A_NUMBER('B', 4), PU0, 2 }, /* QSPI0_MISO_IO1 */ 5546 - { PIN_A_NUMBER('C', 5), PU0, 1 }, /* QSPI0_MOSI_IO0 */ 5547 - { PIN_NUMBER('W', 3), PU0, 0 }, /* QSPI0_SPCLK */ 5548 - 5549 - { RCAR_GP_PIN(1, 19), PU1, 31 }, /* A19 */ 5550 - { RCAR_GP_PIN(1, 18), PU1, 30 }, /* A18 */ 5551 - { RCAR_GP_PIN(1, 17), PU1, 29 }, /* A17 */ 5552 - { RCAR_GP_PIN(1, 16), PU1, 28 }, /* A16 */ 5553 - { RCAR_GP_PIN(1, 15), PU1, 27 }, /* A15 */ 5554 - { RCAR_GP_PIN(1, 14), PU1, 26 }, /* A14 */ 5555 - { RCAR_GP_PIN(1, 13), PU1, 25 }, /* A13 */ 5556 - { RCAR_GP_PIN(1, 12), PU1, 24 }, /* A12 */ 5557 - { RCAR_GP_PIN(1, 11), PU1, 23 }, /* A11 */ 5558 - { RCAR_GP_PIN(1, 10), PU1, 22 }, /* A10 */ 5559 - { RCAR_GP_PIN(1, 9), PU1, 21 }, /* A9 */ 5560 - { RCAR_GP_PIN(1, 8), PU1, 20 }, /* A8 */ 5561 - { RCAR_GP_PIN(1, 7), PU1, 19 }, /* A7 */ 5562 - { RCAR_GP_PIN(1, 6), PU1, 18 }, /* A6 */ 5563 - { RCAR_GP_PIN(1, 5), PU1, 17 }, /* A5 */ 5564 - { RCAR_GP_PIN(1, 4), PU1, 16 }, /* A4 */ 5565 - { RCAR_GP_PIN(1, 3), PU1, 15 }, /* A3 */ 5566 - { RCAR_GP_PIN(1, 2), PU1, 14 }, /* A2 */ 5567 - { RCAR_GP_PIN(1, 1), PU1, 13 }, /* A1 */ 5568 - { RCAR_GP_PIN(1, 0), PU1, 12 }, /* A0 */ 5569 - { RCAR_GP_PIN(2, 8), PU1, 11 }, /* PWM2_A */ 5570 - { RCAR_GP_PIN(2, 7), PU1, 10 }, /* PWM1_A */ 5571 - { RCAR_GP_PIN(2, 6), PU1, 9 }, /* PWM0 */ 5572 - { RCAR_GP_PIN(2, 5), PU1, 8 }, /* IRQ5 */ 5573 - { RCAR_GP_PIN(2, 4), PU1, 7 }, /* IRQ4 */ 5574 - { RCAR_GP_PIN(2, 3), PU1, 6 }, /* IRQ3 */ 5575 - { RCAR_GP_PIN(2, 2), PU1, 5 }, /* IRQ2 */ 5576 - { RCAR_GP_PIN(2, 1), PU1, 4 }, /* IRQ1 */ 5577 - { RCAR_GP_PIN(2, 0), PU1, 3 }, /* IRQ0 */ 5578 - { RCAR_GP_PIN(2, 14), PU1, 2 }, /* AVB_AVTP_CAPTURE_A */ 5579 - { RCAR_GP_PIN(2, 13), PU1, 1 }, /* AVB_AVTP_MATCH_A */ 5580 - { RCAR_GP_PIN(2, 12), PU1, 0 }, /* AVB_LINK */ 5581 - 5582 - { PIN_A_NUMBER('P', 8), PU2, 31 }, /* DU_DOTCLKIN1 */ 5583 - { PIN_A_NUMBER('P', 7), PU2, 30 }, /* DU_DOTCLKIN0 */ 5584 - { RCAR_GP_PIN(7, 3), PU2, 29 }, /* GP7_03 */ 5585 - { RCAR_GP_PIN(7, 2), PU2, 28 }, /* HDMI0_CEC */ 5586 - { RCAR_GP_PIN(7, 1), PU2, 27 }, /* AVS2 */ 5587 - { RCAR_GP_PIN(7, 0), PU2, 26 }, /* AVS1 */ 5588 - { RCAR_GP_PIN(0, 15), PU2, 25 }, /* D15 */ 5589 - { RCAR_GP_PIN(0, 14), PU2, 24 }, /* D14 */ 5590 - { RCAR_GP_PIN(0, 13), PU2, 23 }, /* D13 */ 5591 - { RCAR_GP_PIN(0, 12), PU2, 22 }, /* D12 */ 5592 - { RCAR_GP_PIN(0, 11), PU2, 21 }, /* D11 */ 5593 - { RCAR_GP_PIN(0, 10), PU2, 20 }, /* D10 */ 5594 - { RCAR_GP_PIN(0, 9), PU2, 19 }, /* D9 */ 5595 - { RCAR_GP_PIN(0, 8), PU2, 18 }, /* D8 */ 5596 - { RCAR_GP_PIN(0, 7), PU2, 17 }, /* D7 */ 5597 - { RCAR_GP_PIN(0, 6), PU2, 16 }, /* D6 */ 5598 - { RCAR_GP_PIN(0, 5), PU2, 15 }, /* D5 */ 5599 - { RCAR_GP_PIN(0, 4), PU2, 14 }, /* D4 */ 5600 - { RCAR_GP_PIN(0, 3), PU2, 13 }, /* D3 */ 5601 - { RCAR_GP_PIN(0, 2), PU2, 12 }, /* D2 */ 5602 - { RCAR_GP_PIN(0, 1), PU2, 11 }, /* D1 */ 5603 - { RCAR_GP_PIN(0, 0), PU2, 10 }, /* D0 */ 5604 - { PIN_NUMBER('C', 1), PU2, 9 }, /* PRESETOUT# */ 5605 - { RCAR_GP_PIN(1, 27), PU2, 8 }, /* EX_WAIT0_A */ 5606 - { RCAR_GP_PIN(1, 26), PU2, 7 }, /* WE1_N */ 5607 - { RCAR_GP_PIN(1, 25), PU2, 6 }, /* WE0_N */ 5608 - { RCAR_GP_PIN(1, 24), PU2, 5 }, /* RD_WR_N */ 5609 - { RCAR_GP_PIN(1, 23), PU2, 4 }, /* RD_N */ 5610 - { RCAR_GP_PIN(1, 22), PU2, 3 }, /* BS_N */ 5611 - { RCAR_GP_PIN(1, 21), PU2, 2 }, /* CS1_N */ 5612 - { RCAR_GP_PIN(1, 20), PU2, 1 }, /* CS0_N */ 5613 - { RCAR_GP_PIN(1, 28), PU2, 0 }, /* CLKOUT */ 5614 - 5615 - { RCAR_GP_PIN(4, 9), PU3, 31 }, /* SD3_DAT0 */ 5616 - { RCAR_GP_PIN(4, 8), PU3, 30 }, /* SD3_CMD */ 5617 - { RCAR_GP_PIN(4, 7), PU3, 29 }, /* SD3_CLK */ 5618 - { RCAR_GP_PIN(4, 6), PU3, 28 }, /* SD2_DS */ 5619 - { RCAR_GP_PIN(4, 5), PU3, 27 }, /* SD2_DAT3 */ 5620 - { RCAR_GP_PIN(4, 4), PU3, 26 }, /* SD2_DAT2 */ 5621 - { RCAR_GP_PIN(4, 3), PU3, 25 }, /* SD2_DAT1 */ 5622 - { RCAR_GP_PIN(4, 2), PU3, 24 }, /* SD2_DAT0 */ 5623 - { RCAR_GP_PIN(4, 1), PU3, 23 }, /* SD2_CMD */ 5624 - { RCAR_GP_PIN(4, 0), PU3, 22 }, /* SD2_CLK */ 5625 - { RCAR_GP_PIN(3, 11), PU3, 21 }, /* SD1_DAT3 */ 5626 - { RCAR_GP_PIN(3, 10), PU3, 20 }, /* SD1_DAT2 */ 5627 - { RCAR_GP_PIN(3, 9), PU3, 19 }, /* SD1_DAT1 */ 5628 - { RCAR_GP_PIN(3, 8), PU3, 18 }, /* SD1_DAT0 */ 5629 - { RCAR_GP_PIN(3, 7), PU3, 17 }, /* SD1_CMD */ 5630 - { RCAR_GP_PIN(3, 6), PU3, 16 }, /* SD1_CLK */ 5631 - { RCAR_GP_PIN(3, 5), PU3, 15 }, /* SD0_DAT3 */ 5632 - { RCAR_GP_PIN(3, 4), PU3, 14 }, /* SD0_DAT2 */ 5633 - { RCAR_GP_PIN(3, 3), PU3, 13 }, /* SD0_DAT1 */ 5634 - { RCAR_GP_PIN(3, 2), PU3, 12 }, /* SD0_DAT0 */ 5635 - { RCAR_GP_PIN(3, 1), PU3, 11 }, /* SD0_CMD */ 5636 - { RCAR_GP_PIN(3, 0), PU3, 10 }, /* SD0_CLK */ 5637 - { PIN_A_NUMBER('T', 30), PU3, 9 }, /* ASEBRK */ 5638 - /* bit 8 n/a */ 5639 - { PIN_A_NUMBER('R', 29), PU3, 7 }, /* TDI */ 5640 - { PIN_A_NUMBER('R', 30), PU3, 6 }, /* TMS */ 5641 - { PIN_A_NUMBER('T', 27), PU3, 5 }, /* TCK */ 5642 - { PIN_A_NUMBER('R', 26), PU3, 4 }, /* TRST# */ 5643 - { PIN_A_NUMBER('D', 39), PU3, 3 }, /* EXTALR*/ 5644 - { PIN_A_NUMBER('D', 38), PU3, 2 }, /* FSCLKST */ 5645 - /* bit 1 n/a on M3*/ 5646 - { PIN_A_NUMBER('R', 8), PU3, 0 }, /* DU_DOTCLKIN2 */ 5647 - 5648 - { RCAR_GP_PIN(5, 19), PU4, 31 }, /* MSIOF0_SS1 */ 5649 - { RCAR_GP_PIN(5, 18), PU4, 30 }, /* MSIOF0_SYNC */ 5650 - { RCAR_GP_PIN(5, 17), PU4, 29 }, /* MSIOF0_SCK */ 5651 - { RCAR_GP_PIN(5, 16), PU4, 28 }, /* HRTS0_N */ 5652 - { RCAR_GP_PIN(5, 15), PU4, 27 }, /* HCTS0_N */ 5653 - { RCAR_GP_PIN(5, 14), PU4, 26 }, /* HTX0 */ 5654 - { RCAR_GP_PIN(5, 13), PU4, 25 }, /* HRX0 */ 5655 - { RCAR_GP_PIN(5, 12), PU4, 24 }, /* HSCK0 */ 5656 - { RCAR_GP_PIN(5, 11), PU4, 23 }, /* RX2_A */ 5657 - { RCAR_GP_PIN(5, 10), PU4, 22 }, /* TX2_A */ 5658 - { RCAR_GP_PIN(5, 9), PU4, 21 }, /* SCK2 */ 5659 - { RCAR_GP_PIN(5, 8), PU4, 20 }, /* RTS1_N_TANS */ 5660 - { RCAR_GP_PIN(5, 7), PU4, 19 }, /* CTS1_N */ 5661 - { RCAR_GP_PIN(5, 6), PU4, 18 }, /* TX1_A */ 5662 - { RCAR_GP_PIN(5, 5), PU4, 17 }, /* RX1_A */ 5663 - { RCAR_GP_PIN(5, 4), PU4, 16 }, /* RTS0_N_TANS */ 5664 - { RCAR_GP_PIN(5, 3), PU4, 15 }, /* CTS0_N */ 5665 - { RCAR_GP_PIN(5, 2), PU4, 14 }, /* TX0 */ 5666 - { RCAR_GP_PIN(5, 1), PU4, 13 }, /* RX0 */ 5667 - { RCAR_GP_PIN(5, 0), PU4, 12 }, /* SCK0 */ 5668 - { RCAR_GP_PIN(3, 15), PU4, 11 }, /* SD1_WP */ 5669 - { RCAR_GP_PIN(3, 14), PU4, 10 }, /* SD1_CD */ 5670 - { RCAR_GP_PIN(3, 13), PU4, 9 }, /* SD0_WP */ 5671 - { RCAR_GP_PIN(3, 12), PU4, 8 }, /* SD0_CD */ 5672 - { RCAR_GP_PIN(4, 17), PU4, 7 }, /* SD3_DS */ 5673 - { RCAR_GP_PIN(4, 16), PU4, 6 }, /* SD3_DAT7 */ 5674 - { RCAR_GP_PIN(4, 15), PU4, 5 }, /* SD3_DAT6 */ 5675 - { RCAR_GP_PIN(4, 14), PU4, 4 }, /* SD3_DAT5 */ 5676 - { RCAR_GP_PIN(4, 13), PU4, 3 }, /* SD3_DAT4 */ 5677 - { RCAR_GP_PIN(4, 12), PU4, 2 }, /* SD3_DAT3 */ 5678 - { RCAR_GP_PIN(4, 11), PU4, 1 }, /* SD3_DAT2 */ 5679 - { RCAR_GP_PIN(4, 10), PU4, 0 }, /* SD3_DAT1 */ 5680 - 5681 - { RCAR_GP_PIN(6, 24), PU5, 31 }, /* USB0_PWEN */ 5682 - { RCAR_GP_PIN(6, 23), PU5, 30 }, /* AUDIO_CLKB_B */ 5683 - { RCAR_GP_PIN(6, 22), PU5, 29 }, /* AUDIO_CLKA_A */ 5684 - { RCAR_GP_PIN(6, 21), PU5, 28 }, /* SSI_SDATA9_A */ 5685 - { RCAR_GP_PIN(6, 20), PU5, 27 }, /* SSI_SDATA8 */ 5686 - { RCAR_GP_PIN(6, 19), PU5, 26 }, /* SSI_SDATA7 */ 5687 - { RCAR_GP_PIN(6, 18), PU5, 25 }, /* SSI_WS78 */ 5688 - { RCAR_GP_PIN(6, 17), PU5, 24 }, /* SSI_SCK78 */ 5689 - { RCAR_GP_PIN(6, 16), PU5, 23 }, /* SSI_SDATA6 */ 5690 - { RCAR_GP_PIN(6, 15), PU5, 22 }, /* SSI_WS6 */ 5691 - { RCAR_GP_PIN(6, 14), PU5, 21 }, /* SSI_SCK6 */ 5692 - { RCAR_GP_PIN(6, 13), PU5, 20 }, /* SSI_SDATA5 */ 5693 - { RCAR_GP_PIN(6, 12), PU5, 19 }, /* SSI_WS5 */ 5694 - { RCAR_GP_PIN(6, 11), PU5, 18 }, /* SSI_SCK5 */ 5695 - { RCAR_GP_PIN(6, 10), PU5, 17 }, /* SSI_SDATA4 */ 5696 - { RCAR_GP_PIN(6, 9), PU5, 16 }, /* SSI_WS4 */ 5697 - { RCAR_GP_PIN(6, 8), PU5, 15 }, /* SSI_SCK4 */ 5698 - { RCAR_GP_PIN(6, 7), PU5, 14 }, /* SSI_SDATA3 */ 5699 - { RCAR_GP_PIN(6, 6), PU5, 13 }, /* SSI_WS349 */ 5700 - { RCAR_GP_PIN(6, 5), PU5, 12 }, /* SSI_SCK349 */ 5701 - { RCAR_GP_PIN(6, 4), PU5, 11 }, /* SSI_SDATA2_A */ 5702 - { RCAR_GP_PIN(6, 3), PU5, 10 }, /* SSI_SDATA1_A */ 5703 - { RCAR_GP_PIN(6, 2), PU5, 9 }, /* SSI_SDATA0 */ 5704 - { RCAR_GP_PIN(6, 1), PU5, 8 }, /* SSI_WS01239 */ 5705 - { RCAR_GP_PIN(6, 0), PU5, 7 }, /* SSI_SCK01239 */ 5706 - { PIN_NUMBER('H', 37), PU5, 6 }, /* MLB_REF */ 5707 - { RCAR_GP_PIN(5, 25), PU5, 5 }, /* MLB_DAT */ 5708 - { RCAR_GP_PIN(5, 24), PU5, 4 }, /* MLB_SIG */ 5709 - { RCAR_GP_PIN(5, 23), PU5, 3 }, /* MLB_CLK */ 5710 - { RCAR_GP_PIN(5, 22), PU5, 2 }, /* MSIOF0_RXD */ 5711 - { RCAR_GP_PIN(5, 21), PU5, 1 }, /* MSIOF0_SS2 */ 5712 - { RCAR_GP_PIN(5, 20), PU5, 0 }, /* MSIOF0_TXD */ 5713 - 5714 - { RCAR_GP_PIN(6, 31), PU6, 6 }, /* GP6_31 */ 5715 - { RCAR_GP_PIN(6, 30), PU6, 5 }, /* GP6_30 */ 5716 - { RCAR_GP_PIN(6, 29), PU6, 4 }, /* USB30_OVC */ 5717 - { RCAR_GP_PIN(6, 28), PU6, 3 }, /* USB30_PWEN */ 5718 - { RCAR_GP_PIN(6, 27), PU6, 2 }, /* USB1_OVC */ 5719 - { RCAR_GP_PIN(6, 26), PU6, 1 }, /* USB1_PWEN */ 5720 - { RCAR_GP_PIN(6, 25), PU6, 0 }, /* USB0_OVC */ 5434 + static const struct pinmux_bias_reg pinmux_bias_regs[] = { 5435 + { PINMUX_BIAS_REG("PUEN0", 0xe6060400, "PUD0", 0xe6060440) { 5436 + [ 0] = PIN_NUMBER('W', 3), /* QSPI0_SPCLK */ 5437 + [ 1] = PIN_A_NUMBER('C', 5), /* QSPI0_MOSI_IO0 */ 5438 + [ 2] = PIN_A_NUMBER('B', 4), /* QSPI0_MISO_IO1 */ 5439 + [ 3] = PIN_NUMBER('Y', 6), /* QSPI0_IO2 */ 5440 + [ 4] = PIN_A_NUMBER('B', 6), /* QSPI0_IO3 */ 5441 + [ 5] = PIN_NUMBER('Y', 3), /* QSPI0_SSL */ 5442 + [ 6] = PIN_NUMBER('V', 3), /* QSPI1_SPCLK */ 5443 + [ 7] = PIN_A_NUMBER('C', 7), /* QSPI1_MOSI_IO0 */ 5444 + [ 8] = PIN_A_NUMBER('E', 5), /* QSPI1_MISO_IO1 */ 5445 + [ 9] = PIN_A_NUMBER('E', 4), /* QSPI1_IO2 */ 5446 + [10] = PIN_A_NUMBER('C', 3), /* QSPI1_IO3 */ 5447 + [11] = PIN_NUMBER('V', 5), /* QSPI1_SSL */ 5448 + [12] = PIN_NUMBER('Y', 7), /* RPC_INT# */ 5449 + [13] = PIN_NUMBER('V', 6), /* RPC_WP# */ 5450 + [14] = PIN_NUMBER('V', 7), /* RPC_RESET# */ 5451 + [15] = PIN_NUMBER('A', 16), /* AVB_RX_CTL */ 5452 + [16] = PIN_NUMBER('B', 19), /* AVB_RXC */ 5453 + [17] = PIN_NUMBER('A', 13), /* AVB_RD0 */ 5454 + [18] = PIN_NUMBER('B', 13), /* AVB_RD1 */ 5455 + [19] = PIN_NUMBER('A', 14), /* AVB_RD2 */ 5456 + [20] = PIN_NUMBER('B', 14), /* AVB_RD3 */ 5457 + [21] = PIN_NUMBER('A', 8), /* AVB_TX_CTL */ 5458 + [22] = PIN_NUMBER('A', 19), /* AVB_TXC */ 5459 + [23] = PIN_NUMBER('A', 18), /* AVB_TD0 */ 5460 + [24] = PIN_NUMBER('B', 18), /* AVB_TD1 */ 5461 + [25] = PIN_NUMBER('A', 17), /* AVB_TD2 */ 5462 + [26] = PIN_NUMBER('B', 17), /* AVB_TD3 */ 5463 + [27] = PIN_NUMBER('A', 12), /* AVB_TXCREFCLK */ 5464 + [28] = PIN_NUMBER('A', 9), /* AVB_MDIO */ 5465 + [29] = RCAR_GP_PIN(2, 9), /* AVB_MDC */ 5466 + [30] = RCAR_GP_PIN(2, 10), /* AVB_MAGIC */ 5467 + [31] = RCAR_GP_PIN(2, 11), /* AVB_PHY_INT */ 5468 + } }, 5469 + { PINMUX_BIAS_REG("PUEN1", 0xe6060404, "PUD1", 0xe6060444) { 5470 + [ 0] = RCAR_GP_PIN(2, 12), /* AVB_LINK */ 5471 + [ 1] = RCAR_GP_PIN(2, 13), /* AVB_AVTP_MATCH_A */ 5472 + [ 2] = RCAR_GP_PIN(2, 14), /* AVB_AVTP_CAPTURE_A */ 5473 + [ 3] = RCAR_GP_PIN(2, 0), /* IRQ0 */ 5474 + [ 4] = RCAR_GP_PIN(2, 1), /* IRQ1 */ 5475 + [ 5] = RCAR_GP_PIN(2, 2), /* IRQ2 */ 5476 + [ 6] = RCAR_GP_PIN(2, 3), /* IRQ3 */ 5477 + [ 7] = RCAR_GP_PIN(2, 4), /* IRQ4 */ 5478 + [ 8] = RCAR_GP_PIN(2, 5), /* IRQ5 */ 5479 + [ 9] = RCAR_GP_PIN(2, 6), /* PWM0 */ 5480 + [10] = RCAR_GP_PIN(2, 7), /* PWM1_A */ 5481 + [11] = RCAR_GP_PIN(2, 8), /* PWM2_A */ 5482 + [12] = RCAR_GP_PIN(1, 0), /* A0 */ 5483 + [13] = RCAR_GP_PIN(1, 1), /* A1 */ 5484 + [14] = RCAR_GP_PIN(1, 2), /* A2 */ 5485 + [15] = RCAR_GP_PIN(1, 3), /* A3 */ 5486 + [16] = RCAR_GP_PIN(1, 4), /* A4 */ 5487 + [17] = RCAR_GP_PIN(1, 5), /* A5 */ 5488 + [18] = RCAR_GP_PIN(1, 6), /* A6 */ 5489 + [19] = RCAR_GP_PIN(1, 7), /* A7 */ 5490 + [20] = RCAR_GP_PIN(1, 8), /* A8 */ 5491 + [21] = RCAR_GP_PIN(1, 9), /* A9 */ 5492 + [22] = RCAR_GP_PIN(1, 10), /* A10 */ 5493 + [23] = RCAR_GP_PIN(1, 11), /* A11 */ 5494 + [24] = RCAR_GP_PIN(1, 12), /* A12 */ 5495 + [25] = RCAR_GP_PIN(1, 13), /* A13 */ 5496 + [26] = RCAR_GP_PIN(1, 14), /* A14 */ 5497 + [27] = RCAR_GP_PIN(1, 15), /* A15 */ 5498 + [28] = RCAR_GP_PIN(1, 16), /* A16 */ 5499 + [29] = RCAR_GP_PIN(1, 17), /* A17 */ 5500 + [30] = RCAR_GP_PIN(1, 18), /* A18 */ 5501 + [31] = RCAR_GP_PIN(1, 19), /* A19 */ 5502 + } }, 5503 + { PINMUX_BIAS_REG("PUEN2", 0xe6060408, "PUD2", 0xe6060448) { 5504 + [ 0] = RCAR_GP_PIN(1, 28), /* CLKOUT */ 5505 + [ 1] = RCAR_GP_PIN(1, 20), /* CS0_N */ 5506 + [ 2] = RCAR_GP_PIN(1, 21), /* CS1_N */ 5507 + [ 3] = RCAR_GP_PIN(1, 22), /* BS_N */ 5508 + [ 4] = RCAR_GP_PIN(1, 23), /* RD_N */ 5509 + [ 5] = RCAR_GP_PIN(1, 24), /* RD_WR_N */ 5510 + [ 6] = RCAR_GP_PIN(1, 25), /* WE0_N */ 5511 + [ 7] = RCAR_GP_PIN(1, 26), /* WE1_N */ 5512 + [ 8] = RCAR_GP_PIN(1, 27), /* EX_WAIT0_A */ 5513 + [ 9] = PIN_NUMBER('C', 1), /* PRESETOUT# */ 5514 + [10] = RCAR_GP_PIN(0, 0), /* D0 */ 5515 + [11] = RCAR_GP_PIN(0, 1), /* D1 */ 5516 + [12] = RCAR_GP_PIN(0, 2), /* D2 */ 5517 + [13] = RCAR_GP_PIN(0, 3), /* D3 */ 5518 + [14] = RCAR_GP_PIN(0, 4), /* D4 */ 5519 + [15] = RCAR_GP_PIN(0, 5), /* D5 */ 5520 + [16] = RCAR_GP_PIN(0, 6), /* D6 */ 5521 + [17] = RCAR_GP_PIN(0, 7), /* D7 */ 5522 + [18] = RCAR_GP_PIN(0, 8), /* D8 */ 5523 + [19] = RCAR_GP_PIN(0, 9), /* D9 */ 5524 + [20] = RCAR_GP_PIN(0, 10), /* D10 */ 5525 + [21] = RCAR_GP_PIN(0, 11), /* D11 */ 5526 + [22] = RCAR_GP_PIN(0, 12), /* D12 */ 5527 + [23] = RCAR_GP_PIN(0, 13), /* D13 */ 5528 + [24] = RCAR_GP_PIN(0, 14), /* D14 */ 5529 + [25] = RCAR_GP_PIN(0, 15), /* D15 */ 5530 + [26] = RCAR_GP_PIN(7, 0), /* AVS1 */ 5531 + [27] = RCAR_GP_PIN(7, 1), /* AVS2 */ 5532 + [28] = RCAR_GP_PIN(7, 2), /* HDMI0_CEC */ 5533 + [29] = RCAR_GP_PIN(7, 3), /* GP7_03 */ 5534 + [30] = PIN_A_NUMBER('P', 7), /* DU_DOTCLKIN0 */ 5535 + [31] = PIN_A_NUMBER('P', 8), /* DU_DOTCLKIN1 */ 5536 + } }, 5537 + { PINMUX_BIAS_REG("PUEN3", 0xe606040c, "PUD3", 0xe606044c) { 5538 + [ 0] = PIN_A_NUMBER('R', 8), /* DU_DOTCLKIN2 */ 5539 + [ 1] = PIN_NONE, 5540 + [ 2] = PIN_A_NUMBER('D', 38), /* FSCLKST */ 5541 + [ 3] = PIN_A_NUMBER('D', 39), /* EXTALR*/ 5542 + [ 4] = PIN_A_NUMBER('R', 26), /* TRST# */ 5543 + [ 5] = PIN_A_NUMBER('T', 27), /* TCK */ 5544 + [ 6] = PIN_A_NUMBER('R', 30), /* TMS */ 5545 + [ 7] = PIN_A_NUMBER('R', 29), /* TDI */ 5546 + [ 8] = PIN_NONE, 5547 + [ 9] = PIN_A_NUMBER('T', 30), /* ASEBRK */ 5548 + [10] = RCAR_GP_PIN(3, 0), /* SD0_CLK */ 5549 + [11] = RCAR_GP_PIN(3, 1), /* SD0_CMD */ 5550 + [12] = RCAR_GP_PIN(3, 2), /* SD0_DAT0 */ 5551 + [13] = RCAR_GP_PIN(3, 3), /* SD0_DAT1 */ 5552 + [14] = RCAR_GP_PIN(3, 4), /* SD0_DAT2 */ 5553 + [15] = RCAR_GP_PIN(3, 5), /* SD0_DAT3 */ 5554 + [16] = RCAR_GP_PIN(3, 6), /* SD1_CLK */ 5555 + [17] = RCAR_GP_PIN(3, 7), /* SD1_CMD */ 5556 + [18] = RCAR_GP_PIN(3, 8), /* SD1_DAT0 */ 5557 + [19] = RCAR_GP_PIN(3, 9), /* SD1_DAT1 */ 5558 + [20] = RCAR_GP_PIN(3, 10), /* SD1_DAT2 */ 5559 + [21] = RCAR_GP_PIN(3, 11), /* SD1_DAT3 */ 5560 + [22] = RCAR_GP_PIN(4, 0), /* SD2_CLK */ 5561 + [23] = RCAR_GP_PIN(4, 1), /* SD2_CMD */ 5562 + [24] = RCAR_GP_PIN(4, 2), /* SD2_DAT0 */ 5563 + [25] = RCAR_GP_PIN(4, 3), /* SD2_DAT1 */ 5564 + [26] = RCAR_GP_PIN(4, 4), /* SD2_DAT2 */ 5565 + [27] = RCAR_GP_PIN(4, 5), /* SD2_DAT3 */ 5566 + [28] = RCAR_GP_PIN(4, 6), /* SD2_DS */ 5567 + [29] = RCAR_GP_PIN(4, 7), /* SD3_CLK */ 5568 + [30] = RCAR_GP_PIN(4, 8), /* SD3_CMD */ 5569 + [31] = RCAR_GP_PIN(4, 9), /* SD3_DAT0 */ 5570 + } }, 5571 + { PINMUX_BIAS_REG("PUEN4", 0xe6060410, "PUD4", 0xe6060450) { 5572 + [ 0] = RCAR_GP_PIN(4, 10), /* SD3_DAT1 */ 5573 + [ 1] = RCAR_GP_PIN(4, 11), /* SD3_DAT2 */ 5574 + [ 2] = RCAR_GP_PIN(4, 12), /* SD3_DAT3 */ 5575 + [ 3] = RCAR_GP_PIN(4, 13), /* SD3_DAT4 */ 5576 + [ 4] = RCAR_GP_PIN(4, 14), /* SD3_DAT5 */ 5577 + [ 5] = RCAR_GP_PIN(4, 15), /* SD3_DAT6 */ 5578 + [ 6] = RCAR_GP_PIN(4, 16), /* SD3_DAT7 */ 5579 + [ 7] = RCAR_GP_PIN(4, 17), /* SD3_DS */ 5580 + [ 8] = RCAR_GP_PIN(3, 12), /* SD0_CD */ 5581 + [ 9] = RCAR_GP_PIN(3, 13), /* SD0_WP */ 5582 + [10] = RCAR_GP_PIN(3, 14), /* SD1_CD */ 5583 + [11] = RCAR_GP_PIN(3, 15), /* SD1_WP */ 5584 + [12] = RCAR_GP_PIN(5, 0), /* SCK0 */ 5585 + [13] = RCAR_GP_PIN(5, 1), /* RX0 */ 5586 + [14] = RCAR_GP_PIN(5, 2), /* TX0 */ 5587 + [15] = RCAR_GP_PIN(5, 3), /* CTS0_N */ 5588 + [16] = RCAR_GP_PIN(5, 4), /* RTS0_N_TANS */ 5589 + [17] = RCAR_GP_PIN(5, 5), /* RX1_A */ 5590 + [18] = RCAR_GP_PIN(5, 6), /* TX1_A */ 5591 + [19] = RCAR_GP_PIN(5, 7), /* CTS1_N */ 5592 + [20] = RCAR_GP_PIN(5, 8), /* RTS1_N_TANS */ 5593 + [21] = RCAR_GP_PIN(5, 9), /* SCK2 */ 5594 + [22] = RCAR_GP_PIN(5, 10), /* TX2_A */ 5595 + [23] = RCAR_GP_PIN(5, 11), /* RX2_A */ 5596 + [24] = RCAR_GP_PIN(5, 12), /* HSCK0 */ 5597 + [25] = RCAR_GP_PIN(5, 13), /* HRX0 */ 5598 + [26] = RCAR_GP_PIN(5, 14), /* HTX0 */ 5599 + [27] = RCAR_GP_PIN(5, 15), /* HCTS0_N */ 5600 + [28] = RCAR_GP_PIN(5, 16), /* HRTS0_N */ 5601 + [29] = RCAR_GP_PIN(5, 17), /* MSIOF0_SCK */ 5602 + [30] = RCAR_GP_PIN(5, 18), /* MSIOF0_SYNC */ 5603 + [31] = RCAR_GP_PIN(5, 19), /* MSIOF0_SS1 */ 5604 + } }, 5605 + { PINMUX_BIAS_REG("PUEN5", 0xe6060414, "PUD5", 0xe6060454) { 5606 + [ 0] = RCAR_GP_PIN(5, 20), /* MSIOF0_TXD */ 5607 + [ 1] = RCAR_GP_PIN(5, 21), /* MSIOF0_SS2 */ 5608 + [ 2] = RCAR_GP_PIN(5, 22), /* MSIOF0_RXD */ 5609 + [ 3] = RCAR_GP_PIN(5, 23), /* MLB_CLK */ 5610 + [ 4] = RCAR_GP_PIN(5, 24), /* MLB_SIG */ 5611 + [ 5] = RCAR_GP_PIN(5, 25), /* MLB_DAT */ 5612 + [ 6] = PIN_NUMBER('H', 37), /* MLB_REF */ 5613 + [ 7] = RCAR_GP_PIN(6, 0), /* SSI_SCK01239 */ 5614 + [ 8] = RCAR_GP_PIN(6, 1), /* SSI_WS01239 */ 5615 + [ 9] = RCAR_GP_PIN(6, 2), /* SSI_SDATA0 */ 5616 + [10] = RCAR_GP_PIN(6, 3), /* SSI_SDATA1_A */ 5617 + [11] = RCAR_GP_PIN(6, 4), /* SSI_SDATA2_A */ 5618 + [12] = RCAR_GP_PIN(6, 5), /* SSI_SCK349 */ 5619 + [13] = RCAR_GP_PIN(6, 6), /* SSI_WS349 */ 5620 + [14] = RCAR_GP_PIN(6, 7), /* SSI_SDATA3 */ 5621 + [15] = RCAR_GP_PIN(6, 8), /* SSI_SCK4 */ 5622 + [16] = RCAR_GP_PIN(6, 9), /* SSI_WS4 */ 5623 + [17] = RCAR_GP_PIN(6, 10), /* SSI_SDATA4 */ 5624 + [18] = RCAR_GP_PIN(6, 11), /* SSI_SCK5 */ 5625 + [19] = RCAR_GP_PIN(6, 12), /* SSI_WS5 */ 5626 + [20] = RCAR_GP_PIN(6, 13), /* SSI_SDATA5 */ 5627 + [21] = RCAR_GP_PIN(6, 14), /* SSI_SCK6 */ 5628 + [22] = RCAR_GP_PIN(6, 15), /* SSI_WS6 */ 5629 + [23] = RCAR_GP_PIN(6, 16), /* SSI_SDATA6 */ 5630 + [24] = RCAR_GP_PIN(6, 17), /* SSI_SCK78 */ 5631 + [25] = RCAR_GP_PIN(6, 18), /* SSI_WS78 */ 5632 + [26] = RCAR_GP_PIN(6, 19), /* SSI_SDATA7 */ 5633 + [27] = RCAR_GP_PIN(6, 20), /* SSI_SDATA8 */ 5634 + [28] = RCAR_GP_PIN(6, 21), /* SSI_SDATA9_A */ 5635 + [29] = RCAR_GP_PIN(6, 22), /* AUDIO_CLKA_A */ 5636 + [30] = RCAR_GP_PIN(6, 23), /* AUDIO_CLKB_B */ 5637 + [31] = RCAR_GP_PIN(6, 24), /* USB0_PWEN */ 5638 + } }, 5639 + { PINMUX_BIAS_REG("PUEN6", 0xe6060418, "PUD6", 0xe6060458) { 5640 + [ 0] = RCAR_GP_PIN(6, 25), /* USB0_OVC */ 5641 + [ 1] = RCAR_GP_PIN(6, 26), /* USB1_PWEN */ 5642 + [ 2] = RCAR_GP_PIN(6, 27), /* USB1_OVC */ 5643 + [ 3] = RCAR_GP_PIN(6, 28), /* USB30_PWEN */ 5644 + [ 4] = RCAR_GP_PIN(6, 29), /* USB30_OVC */ 5645 + [ 5] = RCAR_GP_PIN(6, 30), /* GP6_30 */ 5646 + [ 6] = RCAR_GP_PIN(6, 31), /* GP6_31 */ 5647 + [ 7] = PIN_NONE, 5648 + [ 8] = PIN_NONE, 5649 + [ 9] = PIN_NONE, 5650 + [10] = PIN_NONE, 5651 + [11] = PIN_NONE, 5652 + [12] = PIN_NONE, 5653 + [13] = PIN_NONE, 5654 + [14] = PIN_NONE, 5655 + [15] = PIN_NONE, 5656 + [16] = PIN_NONE, 5657 + [17] = PIN_NONE, 5658 + [18] = PIN_NONE, 5659 + [19] = PIN_NONE, 5660 + [20] = PIN_NONE, 5661 + [21] = PIN_NONE, 5662 + [22] = PIN_NONE, 5663 + [23] = PIN_NONE, 5664 + [24] = PIN_NONE, 5665 + [25] = PIN_NONE, 5666 + [26] = PIN_NONE, 5667 + [27] = PIN_NONE, 5668 + [28] = PIN_NONE, 5669 + [29] = PIN_NONE, 5670 + [30] = PIN_NONE, 5671 + [31] = PIN_NONE, 5672 + } }, 5673 + { /* sentinel */ }, 5721 5674 }; 5722 5675 5723 5676 static unsigned int r8a7796_pinmux_get_bias(struct sh_pfc *pfc, 5724 5677 unsigned int pin) 5725 5678 { 5726 - const struct sh_pfc_bias_info *info; 5727 - u32 reg; 5728 - u32 bit; 5679 + const struct pinmux_bias_reg *reg; 5680 + unsigned int bit; 5729 5681 5730 - info = sh_pfc_pin_to_bias_info(bias_info, ARRAY_SIZE(bias_info), pin); 5731 - if (!info) 5682 + reg = sh_pfc_pin_to_bias_reg(pfc, pin, &bit); 5683 + if (!reg) 5732 5684 return PIN_CONFIG_BIAS_DISABLE; 5733 5685 5734 - reg = info->reg; 5735 - bit = BIT(info->bit); 5736 - 5737 - if (!(sh_pfc_read_reg(pfc, PUEN + reg, 32) & bit)) 5686 + if (!(sh_pfc_read(pfc, reg->puen) & BIT(bit))) 5738 5687 return PIN_CONFIG_BIAS_DISABLE; 5739 - else if (sh_pfc_read_reg(pfc, PUD + reg, 32) & bit) 5688 + else if (sh_pfc_read(pfc, reg->pud) & BIT(bit)) 5740 5689 return PIN_CONFIG_BIAS_PULL_UP; 5741 5690 else 5742 5691 return PIN_CONFIG_BIAS_PULL_DOWN; ··· 5764 5675 static void r8a7796_pinmux_set_bias(struct sh_pfc *pfc, unsigned int pin, 5765 5676 unsigned int bias) 5766 5677 { 5767 - const struct sh_pfc_bias_info *info; 5678 + const struct pinmux_bias_reg *reg; 5768 5679 u32 enable, updown; 5769 - u32 reg; 5770 - u32 bit; 5680 + unsigned int bit; 5771 5681 5772 - info = sh_pfc_pin_to_bias_info(bias_info, ARRAY_SIZE(bias_info), pin); 5773 - if (!info) 5682 + reg = sh_pfc_pin_to_bias_reg(pfc, pin, &bit); 5683 + if (!reg) 5774 5684 return; 5775 5685 5776 - reg = info->reg; 5777 - bit = BIT(info->bit); 5778 - 5779 - enable = sh_pfc_read_reg(pfc, PUEN + reg, 32) & ~bit; 5686 + enable = sh_pfc_read(pfc, reg->puen) & ~BIT(bit); 5780 5687 if (bias != PIN_CONFIG_BIAS_DISABLE) 5781 - enable |= bit; 5688 + enable |= BIT(bit); 5782 5689 5783 - updown = sh_pfc_read_reg(pfc, PUD + reg, 32) & ~bit; 5690 + updown = sh_pfc_read(pfc, reg->pud) & ~BIT(bit); 5784 5691 if (bias == PIN_CONFIG_BIAS_PULL_UP) 5785 - updown |= bit; 5692 + updown |= BIT(bit); 5786 5693 5787 - sh_pfc_write_reg(pfc, PUD + reg, 32, updown); 5788 - sh_pfc_write_reg(pfc, PUEN + reg, 32, enable); 5694 + sh_pfc_write(pfc, reg->pud, updown); 5695 + sh_pfc_write(pfc, reg->puen, enable); 5789 5696 } 5790 5697 5791 5698 static const struct sh_pfc_soc_operations r8a7796_pinmux_ops = { ··· 5806 5721 5807 5722 .cfg_regs = pinmux_config_regs, 5808 5723 .drive_regs = pinmux_drive_regs, 5724 + .bias_regs = pinmux_bias_regs, 5725 + .ioctrl_regs = pinmux_ioctrl_regs, 5809 5726 5810 5727 .pinmux_data = pinmux_data, 5811 5728 .pinmux_data_size = ARRAY_SIZE(pinmux_data),
+390 -4
drivers/pinctrl/sh-pfc/pfc-r8a77995.c
··· 198 198 #define GPSR6_0 FM(QSPI0_SPCLK) 199 199 200 200 /* IPSRx */ /* 0 */ /* 1 */ /* 2 */ /* 3 */ /* 4 */ /* 5 */ /* 6 - F */ 201 - #define IP0_3_0 FM(IRQ0_A) FM(MSIOF2_SYNC_B) FM(USB0_IDIN) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) 202 - #define IP0_7_4 FM(MSIOF2_SCK) F_(0, 0) FM(USB0_IDPU) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) 201 + #define IP0_3_0 FM(IRQ0_A) FM(MSIOF2_SYNC_B) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) 202 + #define IP0_7_4 FM(MSIOF2_SCK) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) 203 203 #define IP0_11_8 FM(MSIOF2_TXD) FM(SCL3_A) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) 204 204 #define IP0_15_12 FM(MSIOF2_RXD) FM(SDA3_A) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) 205 205 #define IP0_19_16 FM(MLB_CLK) FM(MSIOF2_SYNC_A) FM(SCK5_A) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) ··· 522 522 /* IPSR0 */ 523 523 PINMUX_IPSR_MSEL(IP0_3_0, IRQ0_A, SEL_IRQ_0_0), 524 524 PINMUX_IPSR_MSEL(IP0_3_0, MSIOF2_SYNC_B, SEL_MSIOF2_1), 525 - PINMUX_IPSR_GPSR(IP0_3_0, USB0_IDIN), 526 525 527 526 PINMUX_IPSR_GPSR(IP0_7_4, MSIOF2_SCK), 528 - PINMUX_IPSR_GPSR(IP0_7_4, USB0_IDPU), 529 527 530 528 PINMUX_IPSR_GPSR(IP0_11_8, MSIOF2_TXD), 531 529 PINMUX_IPSR_MSEL(IP0_11_8, SCL3_A, SEL_I2C3_0), ··· 934 936 PINMUX_GPIO_GP_ALL(), 935 937 }; 936 938 939 + /* - AUDIO CLOCK ------------------------------------------------------------- */ 940 + static const unsigned int audio_clk_a_pins[] = { 941 + /* CLK A */ 942 + RCAR_GP_PIN(4, 1), 943 + }; 944 + static const unsigned int audio_clk_a_mux[] = { 945 + AUDIO_CLKA_MARK, 946 + }; 947 + static const unsigned int audio_clk_b_pins[] = { 948 + /* CLK B */ 949 + RCAR_GP_PIN(2, 27), 950 + }; 951 + static const unsigned int audio_clk_b_mux[] = { 952 + AUDIO_CLKB_MARK, 953 + }; 954 + static const unsigned int audio_clkout_pins[] = { 955 + /* CLKOUT */ 956 + RCAR_GP_PIN(4, 5), 957 + }; 958 + static const unsigned int audio_clkout_mux[] = { 959 + AUDIO_CLKOUT_MARK, 960 + }; 961 + static const unsigned int audio_clkout1_pins[] = { 962 + /* CLKOUT1 */ 963 + RCAR_GP_PIN(4, 22), 964 + }; 965 + static const unsigned int audio_clkout1_mux[] = { 966 + AUDIO_CLKOUT1_MARK, 967 + }; 968 + 969 + /* - EtherAVB --------------------------------------------------------------- */ 970 + static const unsigned int avb0_link_pins[] = { 971 + /* AVB0_LINK */ 972 + RCAR_GP_PIN(5, 20), 973 + }; 974 + static const unsigned int avb0_link_mux[] = { 975 + AVB0_LINK_MARK, 976 + }; 977 + static const unsigned int avb0_magic_pins[] = { 978 + /* AVB0_MAGIC */ 979 + RCAR_GP_PIN(5, 18), 980 + }; 981 + static const unsigned int avb0_magic_mux[] = { 982 + AVB0_MAGIC_MARK, 983 + }; 984 + static const unsigned int avb0_phy_int_pins[] = { 985 + /* AVB0_PHY_INT */ 986 + RCAR_GP_PIN(5, 19), 987 + }; 988 + static const unsigned int avb0_phy_int_mux[] = { 989 + AVB0_PHY_INT_MARK, 990 + }; 991 + static const unsigned int avb0_mdc_pins[] = { 992 + /* AVB0_MDC, AVB0_MDIO */ 993 + RCAR_GP_PIN(5, 17), RCAR_GP_PIN(5, 16), 994 + }; 995 + static const unsigned int avb0_mdc_mux[] = { 996 + AVB0_MDC_MARK, AVB0_MDIO_MARK, 997 + }; 998 + static const unsigned int avb0_mii_pins[] = { 999 + /* 1000 + * AVB0_TX_CTL, AVB0_TXC, AVB0_TD0, 1001 + * AVB0_TD1, AVB0_TD2, AVB0_TD3, 1002 + * AVB0_RX_CTL, AVB0_RXC, AVB0_RD0, 1003 + * AVB0_RD1, AVB0_RD2, AVB0_RD3, 1004 + * AVB0_TXCREFCLK 1005 + */ 1006 + RCAR_GP_PIN(5, 9), RCAR_GP_PIN(5, 10), RCAR_GP_PIN(5, 11), 1007 + RCAR_GP_PIN(5, 12), RCAR_GP_PIN(5, 13), RCAR_GP_PIN(5, 14), 1008 + RCAR_GP_PIN(5, 3), RCAR_GP_PIN(5, 4), RCAR_GP_PIN(5, 5), 1009 + RCAR_GP_PIN(5, 6), RCAR_GP_PIN(5, 7), RCAR_GP_PIN(5, 8), 1010 + RCAR_GP_PIN(5, 15), 1011 + }; 1012 + static const unsigned int avb0_mii_mux[] = { 1013 + AVB0_TX_CTL_MARK, AVB0_TXC_MARK, AVB0_TD0_MARK, 1014 + AVB0_TD1_MARK, AVB0_TD2_MARK, AVB0_TD3_MARK, 1015 + AVB0_RX_CTL_MARK, AVB0_RXC_MARK, AVB0_RD0_MARK, 1016 + AVB0_RD1_MARK, AVB0_RD2_MARK, AVB0_RD3_MARK, 1017 + AVB0_TXCREFCLK_MARK, 1018 + }; 1019 + static const unsigned int avb0_avtp_pps_a_pins[] = { 1020 + /* AVB0_AVTP_PPS_A */ 1021 + RCAR_GP_PIN(5, 2), 1022 + }; 1023 + static const unsigned int avb0_avtp_pps_a_mux[] = { 1024 + AVB0_AVTP_PPS_A_MARK, 1025 + }; 1026 + static const unsigned int avb0_avtp_match_a_pins[] = { 1027 + /* AVB0_AVTP_MATCH_A */ 1028 + RCAR_GP_PIN(5, 1), 1029 + }; 1030 + static const unsigned int avb0_avtp_match_a_mux[] = { 1031 + AVB0_AVTP_MATCH_A_MARK, 1032 + }; 1033 + static const unsigned int avb0_avtp_capture_a_pins[] = { 1034 + /* AVB0_AVTP_CAPTURE_A */ 1035 + RCAR_GP_PIN(5, 0), 1036 + }; 1037 + static const unsigned int avb0_avtp_capture_a_mux[] = { 1038 + AVB0_AVTP_CAPTURE_A_MARK, 1039 + }; 1040 + static const unsigned int avb0_avtp_pps_b_pins[] = { 1041 + /* AVB0_AVTP_PPS_B */ 1042 + RCAR_GP_PIN(4, 16), 1043 + }; 1044 + static const unsigned int avb0_avtp_pps_b_mux[] = { 1045 + AVB0_AVTP_PPS_B_MARK, 1046 + }; 1047 + static const unsigned int avb0_avtp_match_b_pins[] = { 1048 + /* AVB0_AVTP_MATCH_B */ 1049 + RCAR_GP_PIN(4, 18), 1050 + }; 1051 + static const unsigned int avb0_avtp_match_b_mux[] = { 1052 + AVB0_AVTP_MATCH_B_MARK, 1053 + }; 1054 + static const unsigned int avb0_avtp_capture_b_pins[] = { 1055 + /* AVB0_AVTP_CAPTURE_B */ 1056 + RCAR_GP_PIN(4, 17), 1057 + }; 1058 + static const unsigned int avb0_avtp_capture_b_mux[] = { 1059 + AVB0_AVTP_CAPTURE_B_MARK, 1060 + }; 1061 + 937 1062 /* - I2C -------------------------------------------------------------------- */ 938 1063 static const unsigned int i2c0_pins[] = { 939 1064 /* SCL, SDA */ ··· 1137 1016 }; 1138 1017 static const unsigned int mmc_ctrl_mux[] = { 1139 1018 MMC_CLK_MARK, MMC_CMD_MARK, 1019 + }; 1020 + 1021 + /* - PWM0 ------------------------------------------------------------------ */ 1022 + static const unsigned int pwm0_a_pins[] = { 1023 + /* PWM */ 1024 + RCAR_GP_PIN(2, 1), 1025 + }; 1026 + 1027 + static const unsigned int pwm0_a_mux[] = { 1028 + PWM0_A_MARK, 1029 + }; 1030 + 1031 + static const unsigned int pwm0_b_pins[] = { 1032 + /* PWM */ 1033 + RCAR_GP_PIN(1, 18), 1034 + }; 1035 + 1036 + static const unsigned int pwm0_b_mux[] = { 1037 + PWM0_B_MARK, 1038 + }; 1039 + 1040 + static const unsigned int pwm0_c_pins[] = { 1041 + /* PWM */ 1042 + RCAR_GP_PIN(2, 29), 1043 + }; 1044 + 1045 + static const unsigned int pwm0_c_mux[] = { 1046 + PWM0_C_MARK, 1047 + }; 1048 + 1049 + /* - PWM1 ------------------------------------------------------------------ */ 1050 + static const unsigned int pwm1_a_pins[] = { 1051 + /* PWM */ 1052 + RCAR_GP_PIN(2, 2), 1053 + }; 1054 + 1055 + static const unsigned int pwm1_a_mux[] = { 1056 + PWM1_A_MARK, 1057 + }; 1058 + 1059 + static const unsigned int pwm1_b_pins[] = { 1060 + /* PWM */ 1061 + RCAR_GP_PIN(1, 19), 1062 + }; 1063 + 1064 + static const unsigned int pwm1_b_mux[] = { 1065 + PWM1_B_MARK, 1066 + }; 1067 + 1068 + static const unsigned int pwm1_c_pins[] = { 1069 + /* PWM */ 1070 + RCAR_GP_PIN(2, 30), 1071 + }; 1072 + 1073 + static const unsigned int pwm1_c_mux[] = { 1074 + PWM1_C_MARK, 1075 + }; 1076 + 1077 + /* - PWM2 ------------------------------------------------------------------ */ 1078 + static const unsigned int pwm2_a_pins[] = { 1079 + /* PWM */ 1080 + RCAR_GP_PIN(2, 3), 1081 + }; 1082 + 1083 + static const unsigned int pwm2_a_mux[] = { 1084 + PWM2_A_MARK, 1085 + }; 1086 + 1087 + static const unsigned int pwm2_b_pins[] = { 1088 + /* PWM */ 1089 + RCAR_GP_PIN(1, 22), 1090 + }; 1091 + 1092 + static const unsigned int pwm2_b_mux[] = { 1093 + PWM2_B_MARK, 1094 + }; 1095 + 1096 + static const unsigned int pwm2_c_pins[] = { 1097 + /* PWM */ 1098 + RCAR_GP_PIN(2, 31), 1099 + }; 1100 + 1101 + static const unsigned int pwm2_c_mux[] = { 1102 + PWM2_C_MARK, 1103 + }; 1104 + 1105 + /* - PWM3 ------------------------------------------------------------------ */ 1106 + static const unsigned int pwm3_a_pins[] = { 1107 + /* PWM */ 1108 + RCAR_GP_PIN(2, 4), 1109 + }; 1110 + 1111 + static const unsigned int pwm3_a_mux[] = { 1112 + PWM3_A_MARK, 1113 + }; 1114 + 1115 + static const unsigned int pwm3_b_pins[] = { 1116 + /* PWM */ 1117 + RCAR_GP_PIN(1, 27), 1118 + }; 1119 + 1120 + static const unsigned int pwm3_b_mux[] = { 1121 + PWM3_B_MARK, 1122 + }; 1123 + 1124 + static const unsigned int pwm3_c_pins[] = { 1125 + /* PWM */ 1126 + RCAR_GP_PIN(4, 0), 1127 + }; 1128 + 1129 + static const unsigned int pwm3_c_mux[] = { 1130 + PWM3_C_MARK, 1140 1131 }; 1141 1132 1142 1133 /* - SCIF0 ------------------------------------------------------------------ */ ··· 1435 1202 SCIF_CLK_MARK, 1436 1203 }; 1437 1204 1205 + /* - SSI ---------------------------------------------------------------*/ 1206 + static const unsigned int ssi3_data_pins[] = { 1207 + /* SDATA */ 1208 + RCAR_GP_PIN(4, 3), 1209 + }; 1210 + static const unsigned int ssi3_data_mux[] = { 1211 + SSI_SDATA3_MARK, 1212 + }; 1213 + static const unsigned int ssi34_ctrl_pins[] = { 1214 + /* SCK, WS */ 1215 + RCAR_GP_PIN(4, 2), RCAR_GP_PIN(4, 4), 1216 + }; 1217 + static const unsigned int ssi34_ctrl_mux[] = { 1218 + SSI_SCK34_MARK, SSI_WS34_MARK, 1219 + }; 1220 + static const unsigned int ssi4_ctrl_a_pins[] = { 1221 + /* SCK, WS */ 1222 + RCAR_GP_PIN(4, 5), RCAR_GP_PIN(4, 7), 1223 + }; 1224 + static const unsigned int ssi4_ctrl_a_mux[] = { 1225 + SSI_SCK4_A_MARK, SSI_WS4_A_MARK, 1226 + }; 1227 + static const unsigned int ssi4_data_a_pins[] = { 1228 + /* SDATA */ 1229 + RCAR_GP_PIN(4, 6), 1230 + }; 1231 + static const unsigned int ssi4_data_a_mux[] = { 1232 + SSI_SDATA4_A_MARK, 1233 + }; 1234 + static const unsigned int ssi4_ctrl_b_pins[] = { 1235 + /* SCK, WS */ 1236 + RCAR_GP_PIN(2, 15), RCAR_GP_PIN(2, 20), 1237 + }; 1238 + static const unsigned int ssi4_ctrl_b_mux[] = { 1239 + SSI_SCK4_B_MARK, SSI_WS4_B_MARK, 1240 + }; 1241 + static const unsigned int ssi4_data_b_pins[] = { 1242 + /* SDATA */ 1243 + RCAR_GP_PIN(2, 16), 1244 + }; 1245 + static const unsigned int ssi4_data_b_mux[] = { 1246 + SSI_SDATA4_B_MARK, 1247 + }; 1248 + 1249 + /* - USB0 ------------------------------------------------------------------- */ 1250 + static const unsigned int usb0_pins[] = { 1251 + /* PWEN, OVC */ 1252 + RCAR_GP_PIN(0, 0), RCAR_GP_PIN(0, 1), 1253 + }; 1254 + static const unsigned int usb0_mux[] = { 1255 + USB0_PWEN_MARK, USB0_OVC_MARK, 1256 + }; 1257 + 1438 1258 static const struct sh_pfc_pin_group pinmux_groups[] = { 1259 + SH_PFC_PIN_GROUP(audio_clk_a), 1260 + SH_PFC_PIN_GROUP(audio_clk_b), 1261 + SH_PFC_PIN_GROUP(audio_clkout), 1262 + SH_PFC_PIN_GROUP(audio_clkout1), 1263 + SH_PFC_PIN_GROUP(avb0_link), 1264 + SH_PFC_PIN_GROUP(avb0_magic), 1265 + SH_PFC_PIN_GROUP(avb0_phy_int), 1266 + SH_PFC_PIN_GROUP(avb0_mdc), 1267 + SH_PFC_PIN_GROUP(avb0_mii), 1268 + SH_PFC_PIN_GROUP(avb0_avtp_pps_a), 1269 + SH_PFC_PIN_GROUP(avb0_avtp_match_a), 1270 + SH_PFC_PIN_GROUP(avb0_avtp_capture_a), 1271 + SH_PFC_PIN_GROUP(avb0_avtp_pps_b), 1272 + SH_PFC_PIN_GROUP(avb0_avtp_match_b), 1273 + SH_PFC_PIN_GROUP(avb0_avtp_capture_b), 1439 1274 SH_PFC_PIN_GROUP(i2c0), 1440 1275 SH_PFC_PIN_GROUP(i2c1), 1441 1276 SH_PFC_PIN_GROUP(i2c2_a), ··· 1514 1213 SH_PFC_PIN_GROUP(mmc_data4), 1515 1214 SH_PFC_PIN_GROUP(mmc_data8), 1516 1215 SH_PFC_PIN_GROUP(mmc_ctrl), 1216 + SH_PFC_PIN_GROUP(pwm0_a), 1217 + SH_PFC_PIN_GROUP(pwm0_b), 1218 + SH_PFC_PIN_GROUP(pwm0_c), 1219 + SH_PFC_PIN_GROUP(pwm1_a), 1220 + SH_PFC_PIN_GROUP(pwm1_b), 1221 + SH_PFC_PIN_GROUP(pwm1_c), 1222 + SH_PFC_PIN_GROUP(pwm2_a), 1223 + SH_PFC_PIN_GROUP(pwm2_b), 1224 + SH_PFC_PIN_GROUP(pwm2_c), 1225 + SH_PFC_PIN_GROUP(pwm3_a), 1226 + SH_PFC_PIN_GROUP(pwm3_b), 1227 + SH_PFC_PIN_GROUP(pwm3_c), 1517 1228 SH_PFC_PIN_GROUP(scif0_data_a), 1518 1229 SH_PFC_PIN_GROUP(scif0_clk_a), 1519 1230 SH_PFC_PIN_GROUP(scif0_data_b), ··· 1551 1238 SH_PFC_PIN_GROUP(scif5_data_b), 1552 1239 SH_PFC_PIN_GROUP(scif5_clk_b), 1553 1240 SH_PFC_PIN_GROUP(scif_clk), 1241 + SH_PFC_PIN_GROUP(ssi3_data), 1242 + SH_PFC_PIN_GROUP(ssi34_ctrl), 1243 + SH_PFC_PIN_GROUP(ssi4_ctrl_a), 1244 + SH_PFC_PIN_GROUP(ssi4_data_a), 1245 + SH_PFC_PIN_GROUP(ssi4_ctrl_b), 1246 + SH_PFC_PIN_GROUP(ssi4_data_b), 1247 + SH_PFC_PIN_GROUP(usb0), 1248 + }; 1249 + 1250 + static const char * const audio_clk_groups[] = { 1251 + "audio_clk_a", 1252 + "audio_clk_b", 1253 + "audio_clkout", 1254 + "audio_clkout1", 1255 + }; 1256 + 1257 + static const char * const avb0_groups[] = { 1258 + "avb0_link", 1259 + "avb0_magic", 1260 + "avb0_phy_int", 1261 + "avb0_mdc", 1262 + "avb0_mii", 1263 + "avb0_avtp_pps_a", 1264 + "avb0_avtp_match_a", 1265 + "avb0_avtp_capture_a", 1266 + "avb0_avtp_pps_b", 1267 + "avb0_avtp_match_b", 1268 + "avb0_avtp_capture_b", 1554 1269 }; 1555 1270 1556 1271 static const char * const i2c0_groups[] = { ··· 1603 1262 "mmc_data4", 1604 1263 "mmc_data8", 1605 1264 "mmc_ctrl", 1265 + }; 1266 + 1267 + static const char * const pwm0_groups[] = { 1268 + "pwm0_a", 1269 + "pwm0_b", 1270 + "pwm0_c", 1271 + }; 1272 + 1273 + static const char * const pwm1_groups[] = { 1274 + "pwm1_a", 1275 + "pwm1_b", 1276 + "pwm1_c", 1277 + }; 1278 + 1279 + static const char * const pwm2_groups[] = { 1280 + "pwm2_a", 1281 + "pwm2_b", 1282 + "pwm2_c", 1283 + }; 1284 + 1285 + static const char * const pwm3_groups[] = { 1286 + "pwm3_a", 1287 + "pwm3_b", 1288 + "pwm3_c", 1606 1289 }; 1607 1290 1608 1291 static const char * const scif0_groups[] = { ··· 1675 1310 "scif_clk", 1676 1311 }; 1677 1312 1313 + static const char * const ssi_groups[] = { 1314 + "ssi3_data", 1315 + "ssi34_ctrl", 1316 + "ssi4_ctrl_a", 1317 + "ssi4_data_a", 1318 + "ssi4_ctrl_b", 1319 + "ssi4_data_b", 1320 + }; 1321 + 1322 + static const char * const usb0_groups[] = { 1323 + "usb0", 1324 + }; 1325 + 1678 1326 static const struct sh_pfc_function pinmux_functions[] = { 1327 + SH_PFC_FUNCTION(audio_clk), 1328 + SH_PFC_FUNCTION(avb0), 1679 1329 SH_PFC_FUNCTION(i2c0), 1680 1330 SH_PFC_FUNCTION(i2c1), 1681 1331 SH_PFC_FUNCTION(i2c2), 1682 1332 SH_PFC_FUNCTION(i2c3), 1683 1333 SH_PFC_FUNCTION(mmc), 1334 + SH_PFC_FUNCTION(pwm0), 1335 + SH_PFC_FUNCTION(pwm1), 1336 + SH_PFC_FUNCTION(pwm2), 1337 + SH_PFC_FUNCTION(pwm3), 1684 1338 SH_PFC_FUNCTION(scif0), 1685 1339 SH_PFC_FUNCTION(scif1), 1686 1340 SH_PFC_FUNCTION(scif2), ··· 1707 1323 SH_PFC_FUNCTION(scif4), 1708 1324 SH_PFC_FUNCTION(scif5), 1709 1325 SH_PFC_FUNCTION(scif_clk), 1326 + SH_PFC_FUNCTION(ssi), 1327 + SH_PFC_FUNCTION(usb0), 1710 1328 }; 1711 1329 1712 1330 static const struct pinmux_cfg_reg pinmux_config_regs[] = {
+6 -6
drivers/pinctrl/sh-pfc/pinctrl.c
··· 513 513 return -EINVAL; 514 514 515 515 spin_lock_irqsave(&pfc->lock, flags); 516 - val = sh_pfc_read_reg(pfc, reg, 32); 516 + val = sh_pfc_read(pfc, reg); 517 517 spin_unlock_irqrestore(&pfc->lock, flags); 518 518 519 519 val = (val >> offset) & GENMASK(size - 1, 0); ··· 550 550 551 551 spin_lock_irqsave(&pfc->lock, flags); 552 552 553 - val = sh_pfc_read_reg(pfc, reg, 32); 553 + val = sh_pfc_read(pfc, reg); 554 554 val &= ~GENMASK(offset + size - 1, offset); 555 555 val |= strength << offset; 556 556 557 - sh_pfc_write_reg(pfc, reg, 32, val); 557 + sh_pfc_write(pfc, reg, val); 558 558 559 559 spin_unlock_irqrestore(&pfc->lock, flags); 560 560 ··· 645 645 return bit; 646 646 647 647 spin_lock_irqsave(&pfc->lock, flags); 648 - val = sh_pfc_read_reg(pfc, pocctrl, 32); 648 + val = sh_pfc_read(pfc, pocctrl); 649 649 spin_unlock_irqrestore(&pfc->lock, flags); 650 650 651 651 arg = (val & BIT(bit)) ? 3300 : 1800; ··· 716 716 return -EINVAL; 717 717 718 718 spin_lock_irqsave(&pfc->lock, flags); 719 - val = sh_pfc_read_reg(pfc, pocctrl, 32); 719 + val = sh_pfc_read(pfc, pocctrl); 720 720 if (mV == 3300) 721 721 val |= BIT(bit); 722 722 else 723 723 val &= ~BIT(bit); 724 - sh_pfc_write_reg(pfc, pocctrl, 32, val); 724 + sh_pfc_write(pfc, pocctrl, val); 725 725 spin_unlock_irqrestore(&pfc->lock, flags); 726 726 727 727 break;
+18 -6
drivers/pinctrl/sh-pfc/sh_pfc.h
··· 148 148 .reg = r, \ 149 149 .fields = 150 150 151 + struct pinmux_bias_reg { 152 + u32 puen; /* Pull-enable or pull-up control register */ 153 + u32 pud; /* Pull-up/down control register (optional) */ 154 + const u16 pins[32]; 155 + }; 156 + 157 + #define PINMUX_BIAS_REG(name1, r1, name2, r2) \ 158 + .puen = r1, \ 159 + .pud = r2, \ 160 + .pins = 161 + 162 + struct pinmux_ioctrl_reg { 163 + u32 reg; 164 + }; 165 + 151 166 struct pinmux_data_reg { 152 167 u32 reg; 153 168 u8 reg_width; ··· 204 189 unsigned long size; 205 190 }; 206 191 207 - struct sh_pfc_bias_info { 208 - u16 pin; 209 - u16 reg : 11; 210 - u16 bit : 5; 211 - }; 212 - 213 192 struct sh_pfc_pin_range; 214 193 215 194 struct sh_pfc { ··· 222 213 unsigned int nr_gpio_pins; 223 214 224 215 struct sh_pfc_chip *gpio; 216 + u32 *saved_regs; 225 217 }; 226 218 227 219 struct sh_pfc_soc_operations { ··· 255 245 256 246 const struct pinmux_cfg_reg *cfg_regs; 257 247 const struct pinmux_drive_reg *drive_regs; 248 + const struct pinmux_bias_reg *bias_regs; 249 + const struct pinmux_ioctrl_reg *ioctrl_regs; 258 250 const struct pinmux_data_reg *data_regs; 259 251 260 252 const u16 *pinmux_data;
+2 -2
drivers/pinctrl/sirf/pinctrl-atlas7.c
··· 5860 5860 if (ret < 0) 5861 5861 return ret; 5862 5862 5863 - if (pinctrl_request_gpio(chip->base + gpio)) 5863 + if (pinctrl_gpio_request(chip->base + gpio)) 5864 5864 return -ENODEV; 5865 5865 5866 5866 raw_spin_lock_irqsave(&a7gc->lock, flags); ··· 5890 5890 5891 5891 raw_spin_unlock_irqrestore(&a7gc->lock, flags); 5892 5892 5893 - pinctrl_free_gpio(chip->base + gpio); 5893 + pinctrl_gpio_free(chip->base + gpio); 5894 5894 } 5895 5895 5896 5896 static int atlas7_gpio_direction_input(struct gpio_chip *chip,
+2 -2
drivers/pinctrl/sirf/pinctrl-sirf.c
··· 614 614 struct sirfsoc_gpio_bank *bank = sirfsoc_gpio_to_bank(sgpio, offset); 615 615 unsigned long flags; 616 616 617 - if (pinctrl_request_gpio(chip->base + offset)) 617 + if (pinctrl_gpio_request(chip->base + offset)) 618 618 return -ENODEV; 619 619 620 620 spin_lock_irqsave(&bank->lock, flags); ··· 644 644 645 645 spin_unlock_irqrestore(&bank->lock, flags); 646 646 647 - pinctrl_free_gpio(chip->base + offset); 647 + pinctrl_gpio_free(chip->base + offset); 648 648 } 649 649 650 650 static int sirfsoc_gpio_direction_input(struct gpio_chip *chip, unsigned gpio)
+3 -3
drivers/pinctrl/spear/pinctrl-plgpio.c
··· 204 204 if (offset >= chip->ngpio) 205 205 return -EINVAL; 206 206 207 - ret = pinctrl_request_gpio(gpio); 207 + ret = pinctrl_gpio_request(gpio); 208 208 if (ret) 209 209 return ret; 210 210 ··· 242 242 if (!IS_ERR(plgpio->clk)) 243 243 clk_disable(plgpio->clk); 244 244 err0: 245 - pinctrl_free_gpio(gpio); 245 + pinctrl_gpio_free(gpio); 246 246 return ret; 247 247 } 248 248 ··· 273 273 if (!IS_ERR(plgpio->clk)) 274 274 clk_disable(plgpio->clk); 275 275 276 - pinctrl_free_gpio(gpio); 276 + pinctrl_gpio_free(gpio); 277 277 } 278 278 279 279 /* PLGPIO IRQ */
+2 -2
drivers/pinctrl/stm32/pinctrl-stm32.c
··· 150 150 return -EINVAL; 151 151 } 152 152 153 - return pinctrl_request_gpio(chip->base + offset); 153 + return pinctrl_gpio_request(chip->base + offset); 154 154 } 155 155 156 156 static void stm32_gpio_free(struct gpio_chip *chip, unsigned offset) 157 157 { 158 - pinctrl_free_gpio(chip->base + offset); 158 + pinctrl_gpio_free(chip->base + offset); 159 159 } 160 160 161 161 static int stm32_gpio_get(struct gpio_chip *chip, unsigned offset)
+1
drivers/pinctrl/sunxi/pinctrl-sun4i-a10.c
··· 1289 1289 .npins = ARRAY_SIZE(sun4i_a10_pins), 1290 1290 .irq_banks = 1, 1291 1291 .irq_read_needs_mux = true, 1292 + .disable_strict_mode = true, 1292 1293 }; 1293 1294 1294 1295 static int sun4i_a10_pinctrl_probe(struct platform_device *pdev)
+1
drivers/pinctrl/sunxi/pinctrl-sun5i.c
··· 713 713 .pins = sun5i_pins, 714 714 .npins = ARRAY_SIZE(sun5i_pins), 715 715 .irq_banks = 1, 716 + .disable_strict_mode = true, 716 717 }; 717 718 718 719 static int sun5i_pinctrl_probe(struct platform_device *pdev)
+1
drivers/pinctrl/sunxi/pinctrl-sun6i-a31-r.c
··· 106 106 .npins = ARRAY_SIZE(sun6i_a31_r_pins), 107 107 .pin_base = PL_BASE, 108 108 .irq_banks = 2, 109 + .disable_strict_mode = true, 109 110 }; 110 111 111 112 static int sun6i_a31_r_pinctrl_probe(struct platform_device *pdev)
+1
drivers/pinctrl/sunxi/pinctrl-sun6i-a31.c
··· 965 965 .pins = sun6i_a31_pins, 966 966 .npins = ARRAY_SIZE(sun6i_a31_pins), 967 967 .irq_banks = 4, 968 + .disable_strict_mode = true, 968 969 }; 969 970 970 971 static int sun6i_a31_pinctrl_probe(struct platform_device *pdev)
+1
drivers/pinctrl/sunxi/pinctrl-sun8i-a23-r.c
··· 93 93 .npins = ARRAY_SIZE(sun8i_a23_r_pins), 94 94 .pin_base = PL_BASE, 95 95 .irq_banks = 1, 96 + .disable_strict_mode = true, 96 97 }; 97 98 98 99 static int sun8i_a23_r_pinctrl_probe(struct platform_device *pdev)
+1
drivers/pinctrl/sunxi/pinctrl-sun8i-a23.c
··· 563 563 .pins = sun8i_a23_pins, 564 564 .npins = ARRAY_SIZE(sun8i_a23_pins), 565 565 .irq_banks = 3, 566 + .disable_strict_mode = true, 566 567 }; 567 568 568 569 static int sun8i_a23_pinctrl_probe(struct platform_device *pdev)
+1
drivers/pinctrl/sunxi/pinctrl-sun8i-a33.c
··· 486 486 .npins = ARRAY_SIZE(sun8i_a33_pins), 487 487 .irq_banks = 2, 488 488 .irq_bank_base = 1, 489 + .disable_strict_mode = true, 489 490 }; 490 491 491 492 static int sun8i_a33_pinctrl_probe(struct platform_device *pdev)
+2 -1
drivers/pinctrl/sunxi/pinctrl-sun8i-h3-r.c
··· 82 82 .npins = ARRAY_SIZE(sun8i_h3_r_pins), 83 83 .irq_banks = 1, 84 84 .pin_base = PL_BASE, 85 - .irq_read_needs_mux = true 85 + .irq_read_needs_mux = true, 86 + .disable_strict_mode = true, 86 87 }; 87 88 88 89 static int sun8i_h3_r_pinctrl_probe(struct platform_device *pdev)
+2 -1
drivers/pinctrl/sunxi/pinctrl-sun8i-h3.c
··· 491 491 .pins = sun8i_h3_pins, 492 492 .npins = ARRAY_SIZE(sun8i_h3_pins), 493 493 .irq_banks = 2, 494 - .irq_read_needs_mux = true 494 + .irq_read_needs_mux = true, 495 + .disable_strict_mode = true, 495 496 }; 496 497 497 498 static int sun8i_h3_pinctrl_probe(struct platform_device *pdev)
+1
drivers/pinctrl/sunxi/pinctrl-sun9i-a80-r.c
··· 152 152 .npins = ARRAY_SIZE(sun9i_a80_r_pins), 153 153 .pin_base = PL_BASE, 154 154 .irq_banks = 2, 155 + .disable_strict_mode = true, 155 156 }; 156 157 157 158 static int sun9i_a80_r_pinctrl_probe(struct platform_device *pdev)
+1
drivers/pinctrl/sunxi/pinctrl-sun9i-a80.c
··· 721 721 .pins = sun9i_a80_pins, 722 722 .npins = ARRAY_SIZE(sun9i_a80_pins), 723 723 .irq_banks = 5, 724 + .disable_strict_mode = true, 724 725 }; 725 726 726 727 static int sun9i_a80_pinctrl_probe(struct platform_device *pdev)
+12 -1
drivers/pinctrl/sunxi/pinctrl-sunxi.c
··· 696 696 .get_function_groups = sunxi_pmx_get_func_groups, 697 697 .set_mux = sunxi_pmx_set_mux, 698 698 .gpio_set_direction = sunxi_pmx_gpio_set_direction, 699 + .strict = true, 699 700 }; 700 701 701 702 static int sunxi_pinctrl_gpio_direction_input(struct gpio_chip *chip, ··· 1246 1245 struct pinctrl_desc *pctrl_desc; 1247 1246 struct pinctrl_pin_desc *pins; 1248 1247 struct sunxi_pinctrl *pctl; 1248 + struct pinmux_ops *pmxops; 1249 1249 struct resource *res; 1250 1250 int i, ret, last_pin, pin_idx; 1251 1251 struct clk *clk; ··· 1307 1305 pctrl_desc->npins = pctl->ngroups; 1308 1306 pctrl_desc->confops = &sunxi_pconf_ops; 1309 1307 pctrl_desc->pctlops = &sunxi_pctrl_ops; 1310 - pctrl_desc->pmxops = &sunxi_pmx_ops; 1308 + 1309 + pmxops = devm_kmemdup(&pdev->dev, &sunxi_pmx_ops, sizeof(sunxi_pmx_ops), 1310 + GFP_KERNEL); 1311 + if (!pmxops) 1312 + return -ENOMEM; 1313 + 1314 + if (desc->disable_strict_mode) 1315 + pmxops->strict = false; 1316 + 1317 + pctrl_desc->pmxops = pmxops; 1311 1318 1312 1319 pctl->pctl_dev = devm_pinctrl_register(&pdev->dev, pctrl_desc, pctl); 1313 1320 if (IS_ERR(pctl->pctl_dev)) {
+1
drivers/pinctrl/sunxi/pinctrl-sunxi.h
··· 112 112 unsigned irq_banks; 113 113 unsigned irq_bank_base; 114 114 bool irq_read_needs_mux; 115 + bool disable_strict_mode; 115 116 }; 116 117 117 118 struct sunxi_pinctrl_function {
-4
drivers/pinctrl/ti/pinctrl-ti-iodelay.c
··· 575 575 unsigned long *config) 576 576 { 577 577 struct ti_iodelay_device *iod; 578 - struct device *dev; 579 578 struct ti_iodelay_pingroup *group; 580 579 581 580 iod = pinctrl_dev_get_drvdata(pctldev); 582 - dev = iod->dev; 583 581 group = ti_iodelay_get_pingroup(iod, selector); 584 582 585 583 if (!group) ··· 691 693 unsigned int selector) 692 694 { 693 695 struct ti_iodelay_device *iod; 694 - struct device *dev; 695 696 struct ti_iodelay_pingroup *group; 696 697 int i; 697 698 698 699 iod = pinctrl_dev_get_drvdata(pctldev); 699 - dev = iod->dev; 700 700 group = ti_iodelay_get_pingroup(iod, selector); 701 701 if (!group) 702 702 return;
+8 -6
drivers/pinctrl/uniphier/pinctrl-uniphier-core.c
··· 204 204 const struct pin_desc *desc = pin_desc_get(pctldev, pin); 205 205 enum uniphier_pin_drv_type type = 206 206 uniphier_pin_get_drv_type(desc->drv_data); 207 - const unsigned int strength_1bit[] = {4, 8}; 208 - const unsigned int strength_2bit[] = {8, 12, 16, 20}; 209 - const unsigned int strength_3bit[] = {4, 5, 7, 9, 11, 12, 14, 16}; 207 + static const unsigned int strength_1bit[] = {4, 8}; 208 + static const unsigned int strength_2bit[] = {8, 12, 16, 20}; 209 + static const unsigned int strength_3bit[] = {4, 5, 7, 9, 11, 12, 210 + 14, 16}; 210 211 const unsigned int *supported_strength; 211 212 unsigned int drvctrl, reg, shift, mask, width, val; 212 213 int ret; ··· 400 399 const struct pin_desc *desc = pin_desc_get(pctldev, pin); 401 400 enum uniphier_pin_drv_type type = 402 401 uniphier_pin_get_drv_type(desc->drv_data); 403 - const unsigned int strength_1bit[] = {4, 8, -1}; 404 - const unsigned int strength_2bit[] = {8, 12, 16, 20, -1}; 405 - const unsigned int strength_3bit[] = {4, 5, 7, 9, 11, 12, 14, 16, -1}; 402 + static const unsigned int strength_1bit[] = {4, 8, -1}; 403 + static const unsigned int strength_2bit[] = {8, 12, 16, 20, -1}; 404 + static const unsigned int strength_3bit[] = {4, 5, 7, 9, 11, 12, 14, 405 + 16, -1}; 406 406 const unsigned int *supported_strength; 407 407 unsigned int drvctrl, reg, shift, mask, width, val; 408 408
+2 -2
drivers/pinctrl/uniphier/pinctrl-uniphier-ld11.c
··· 472 472 473 473 static const unsigned aout_pins[] = {135, 136, 137, 138, 139, 140, 141, 142}; 474 474 static const int aout_muxvals[] = {0, 0, 0, 0, 0, 0, 0, 0}; 475 - static const unsigned emmc_pins[] = {18, 19, 20, 21, 22, 23, 24, 25}; 476 - static const int emmc_muxvals[] = {0, 0, 0, 0, 0, 0, 0, 0}; 475 + static const unsigned int emmc_pins[] = {19, 20, 21, 22, 23, 24, 25}; 476 + static const int emmc_muxvals[] = {0, 0, 0, 0, 0, 0, 0}; 477 477 static const unsigned emmc_dat8_pins[] = {26, 27, 28, 29}; 478 478 static const int emmc_dat8_muxvals[] = {0, 0, 0, 0}; 479 479 static const unsigned ether_rmii_pins[] = {6, 7, 8, 9, 10, 11, 12, 13, 14, 15,
+2 -2
drivers/pinctrl/uniphier/pinctrl-uniphier-ld20.c
··· 553 553 554 554 static const unsigned aout_pins[] = {135, 136, 137, 138, 139, 140, 141, 142}; 555 555 static const int aout_muxvals[] = {0, 0, 0, 0, 0, 0, 0, 0}; 556 - static const unsigned emmc_pins[] = {18, 19, 20, 21, 22, 23, 24, 25}; 557 - static const int emmc_muxvals[] = {0, 0, 0, 0, 0, 0, 0, 0}; 556 + static const unsigned int emmc_pins[] = {19, 20, 21, 22, 23, 24, 25}; 557 + static const int emmc_muxvals[] = {0, 0, 0, 0, 0, 0, 0}; 558 558 static const unsigned emmc_dat8_pins[] = {26, 27, 28, 29}; 559 559 static const int emmc_dat8_muxvals[] = {0, 0, 0, 0}; 560 560 static const unsigned ether_rgmii_pins[] = {30, 31, 32, 33, 34, 35, 36, 37, 38,
+2 -2
drivers/pinctrl/uniphier/pinctrl-uniphier-pxs3.c
··· 776 776 250, UNIPHIER_PIN_PULL_DOWN), 777 777 }; 778 778 779 - static const unsigned int emmc_pins[] = {31, 32, 33, 34, 35, 36, 37, 38}; 780 - static const int emmc_muxvals[] = {0, 0, 0, 0, 0, 0, 0, 0}; 779 + static const unsigned int emmc_pins[] = {32, 33, 34, 35, 36, 37, 38}; 780 + static const int emmc_muxvals[] = {0, 0, 0, 0, 0, 0, 0}; 781 781 static const unsigned int emmc_dat8_pins[] = {39, 40, 41, 42}; 782 782 static const int emmc_dat8_muxvals[] = {0, 0, 0, 0}; 783 783 static const unsigned int ether_rgmii_pins[] = {52, 53, 54, 55, 56, 57, 58, 59,
+1 -1
include/dt-bindings/gpio/meson-gxbb-gpio.h
··· 29 29 #define GPIOAO_11 11 30 30 #define GPIOAO_12 12 31 31 #define GPIOAO_13 13 32 + #define GPIO_TEST_N 14 32 33 33 34 #define GPIOZ_0 0 34 35 #define GPIOZ_1 1 ··· 150 149 #define GPIOCLK_1 116 151 150 #define GPIOCLK_2 117 152 151 #define GPIOCLK_3 118 153 - #define GPIO_TEST_N 119 154 152 155 153 #endif
+1 -1
include/dt-bindings/gpio/meson-gxl-gpio.h
··· 25 25 #define GPIOAO_7 7 26 26 #define GPIOAO_8 8 27 27 #define GPIOAO_9 9 28 + #define GPIO_TEST_N 10 28 29 29 30 #define GPIOZ_0 0 30 31 #define GPIOZ_1 1 ··· 127 126 #define GPIOX_18 97 128 127 #define GPIOCLK_0 98 129 128 #define GPIOCLK_1 99 130 - #define GPIO_TEST_N 100 131 129 132 130 #endif
+4 -4
include/linux/pinctrl/consumer.h
··· 25 25 #ifdef CONFIG_PINCTRL 26 26 27 27 /* External interface to pin control */ 28 - extern int pinctrl_request_gpio(unsigned gpio); 29 - extern void pinctrl_free_gpio(unsigned gpio); 28 + extern int pinctrl_gpio_request(unsigned gpio); 29 + extern void pinctrl_gpio_free(unsigned gpio); 30 30 extern int pinctrl_gpio_direction_input(unsigned gpio); 31 31 extern int pinctrl_gpio_direction_output(unsigned gpio); 32 32 extern int pinctrl_gpio_set_config(unsigned gpio, unsigned long config); ··· 62 62 63 63 #else /* !CONFIG_PINCTRL */ 64 64 65 - static inline int pinctrl_request_gpio(unsigned gpio) 65 + static inline int pinctrl_gpio_request(unsigned gpio) 66 66 { 67 67 return 0; 68 68 } 69 69 70 - static inline void pinctrl_free_gpio(unsigned gpio) 70 + static inline void pinctrl_gpio_free(unsigned gpio) 71 71 { 72 72 } 73 73
+5
include/linux/pinctrl/pinconf-generic.h
··· 90 90 * @PIN_CONFIG_SLEW_RATE: if the pin can select slew rate, the argument to 91 91 * this parameter (on a custom format) tells the driver which alternative 92 92 * slew rate to use. 93 + * @PIN_CONFIG_SKEW_DELAY: if the pin has programmable skew rate (on inputs) 94 + * or latch delay (on outputs) this parameter (in a custom format) 95 + * specifies the clock skew or latch delay. It typically controls how 96 + * many double inverters are put in front of the line. 93 97 * @PIN_CONFIG_END: this is the last enumerator for pin configurations, if 94 98 * you need to pass in custom configurations to the pin controller, use 95 99 * PIN_CONFIG_END+1 as the base offset. ··· 121 117 PIN_CONFIG_POWER_SOURCE, 122 118 PIN_CONFIG_SLEEP_HARDWARE_STATE, 123 119 PIN_CONFIG_SLEW_RATE, 120 + PIN_CONFIG_SKEW_DELAY, 124 121 PIN_CONFIG_END = 0x7F, 125 122 PIN_CONFIG_MAX = 0xFF, 126 123 };