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

pinctrl: artpec-6: Add smaller groups for uarts

Add group configuration for uarts that are cut down
variants, the standard being full, i.e. all signals,
flow control, i.e. rx/tx and cts/rts, and rx/tx only.

This allows us to be more precise in which pins we're
actually using.

Signed-off-by: Jesper Nilsson <jesper.nilsson@axis.com>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>

authored by

Jesper Nilsson and committed by
Linus Walleij
41e009b2 4a7cba71

+50 -16
+50 -16
drivers/pinctrl/pinctrl-artpec6.c
··· 277 277 .config = ARTPEC6_CONFIG_3, 278 278 }, 279 279 { 280 - .name = "uart0grp0", 280 + .name = "uart0grp0", /* All pins. */ 281 281 .pins = uart0_pins0, 282 282 .num_pins = ARRAY_SIZE(uart0_pins0), 283 283 .config = ARTPEC6_CONFIG_1, 284 284 }, 285 285 { 286 - .name = "uart0grp1", 286 + .name = "uart0grp1", /* RX/TX and RTS/CTS */ 287 287 .pins = uart0_pins1, 288 288 .num_pins = ARRAY_SIZE(uart0_pins1), 289 289 .config = ARTPEC6_CONFIG_1, 290 290 }, 291 291 { 292 - .name = "uart1grp0", 292 + .name = "uart0grp2", /* Only RX/TX pins. */ 293 + .pins = uart0_pins1, 294 + .num_pins = ARRAY_SIZE(uart0_pins1) - 2, 295 + .config = ARTPEC6_CONFIG_1, 296 + }, 297 + { 298 + .name = "uart1grp0", /* RX/TX and RTS/CTS */ 293 299 .pins = uart1_pins0, 294 300 .num_pins = ARRAY_SIZE(uart1_pins0), 295 301 .config = ARTPEC6_CONFIG_2, 296 302 }, 297 303 { 298 - .name = "uart2grp0", 304 + .name = "uart1grp1", /* Only RX/TX pins. */ 305 + .pins = uart1_pins0, 306 + .num_pins = 2, 307 + .config = ARTPEC6_CONFIG_2, 308 + }, 309 + { 310 + .name = "uart2grp0", /* Full pinout */ 299 311 .pins = uart2_pins0, 300 312 .num_pins = ARRAY_SIZE(uart2_pins0), 301 313 .config = ARTPEC6_CONFIG_1, 302 314 }, 303 315 { 304 - .name = "uart2grp1", 316 + .name = "uart2grp1", /* RX/TX and RTS/CTS */ 305 317 .pins = uart2_pins1, 306 318 .num_pins = ARRAY_SIZE(uart2_pins1), 307 319 .config = ARTPEC6_CONFIG_1, 308 320 }, 309 321 { 310 - .name = "uart3grp0", 322 + .name = "uart2grp2", /* Only RX/TX */ 323 + .pins = uart2_pins1, 324 + .num_pins = 2, 325 + .config = ARTPEC6_CONFIG_1, 326 + }, 327 + { 328 + .name = "uart3grp0", /* RX/TX and CTS/RTS */ 329 + .pins = uart3_pins0, 330 + .num_pins = ARRAY_SIZE(uart3_pins0), 331 + .config = ARTPEC6_CONFIG_0, 332 + }, 333 + { 334 + .name = "uart3grp1", /* Only RX/TX */ 311 335 .pins = uart3_pins0, 312 336 .num_pins = ARRAY_SIZE(uart3_pins0), 313 337 .config = ARTPEC6_CONFIG_0, ··· 343 319 .config = ARTPEC6_CONFIG_2, 344 320 }, 345 321 { 346 - .name = "uart5grp0", 322 + .name = "uart5grp0", /* TX/RX and RTS/CTS */ 347 323 .pins = uart5_pins0, 348 324 .num_pins = ARRAY_SIZE(uart5_pins0), 349 325 .config = ARTPEC6_CONFIG_2, 350 326 }, 351 327 { 352 - .name = "uart5nocts", 328 + .name = "uart5grp1", /* Only TX/RX */ 329 + .pins = uart5_pins0, 330 + .num_pins = 2, 331 + .config = ARTPEC6_CONFIG_2, 332 + }, 333 + { 334 + .name = "uart5nocts", /* TX/RX/RTS */ 353 335 .pins = uart5_pins0, 354 336 .num_pins = ARRAY_SIZE(uart5_pins0) - 1, 355 337 .config = ARTPEC6_CONFIG_2, ··· 487 457 "cpuclkoutgrp0", "udlclkoutgrp0", "i2c1grp0", "i2c2grp0", 488 458 "i2c3grp0", "i2s0grp0", "i2s1grp0", "i2srefclkgrp0", 489 459 "spi0grp0", "spi1grp0", "pciedebuggrp0", "uart0grp0", 490 - "uart0grp1", "uart1grp0", "uart2grp0", "uart2grp1", 491 - "uart4grp0", "uart5grp0", 460 + "uart0grp1", "uart0grp2", "uart1grp0", "uart1grp1", 461 + "uart2grp0", "uart2grp1", "uart2grp2", "uart4grp0", "uart5grp0", 462 + "uart5grp1", "uart5nocts", 492 463 }; 493 464 static const char * const cpuclkoutgrps[] = { "cpuclkoutgrp0" }; 494 465 static const char * const udlclkoutgrps[] = { "udlclkoutgrp0" }; ··· 502 471 static const char * const spi0grps[] = { "spi0grp0" }; 503 472 static const char * const spi1grps[] = { "spi1grp0" }; 504 473 static const char * const pciedebuggrps[] = { "pciedebuggrp0" }; 505 - static const char * const uart0grps[] = { "uart0grp0", "uart0grp1" }; 506 - static const char * const uart1grps[] = { "uart1grp0" }; 507 - static const char * const uart2grps[] = { "uart2grp0", "uart2grp1" }; 474 + static const char * const uart0grps[] = { "uart0grp0", "uart0grp1", 475 + "uart0grp2" }; 476 + static const char * const uart1grps[] = { "uart1grp0", "uart1grp1" }; 477 + static const char * const uart2grps[] = { "uart2grp0", "uart2grp1", 478 + "uart2grp2" }; 508 479 static const char * const uart3grps[] = { "uart3grp0" }; 509 - static const char * const uart4grps[] = { "uart4grp0" }; 510 - static const char * const uart5grps[] = { "uart5grp0", "uart5nocts" }; 480 + static const char * const uart4grps[] = { "uart4grp0", "uart4grp1" }; 481 + static const char * const uart5grps[] = { "uart5grp0", "uart5grp1", 482 + "uart5nocts" }; 511 483 static const char * const nandgrps[] = { "nandgrp0" }; 512 484 static const char * const sdio0grps[] = { "sdio0grp0" }; 513 485 static const char * const sdio1grps[] = { "sdio1grp0" }; ··· 635 601 } 636 602 637 603 static const char *artpec6_pmx_get_fname(struct pinctrl_dev *pctldev, 638 - unsigned int function) 604 + unsigned int function) 639 605 { 640 606 return artpec6_pmx_functions[function].name; 641 607 }