Lines Matching +full:gpio +full:- +full:config
1 // SPDX-License-Identifier: GPL-2.0-or-later
20 #include "pinctrl-mvebu.h"
23 #define INT_REGS_MASK ~(SZ_1M - 1)
44 /* Global Config regmap registers */
64 unsigned pid, unsigned long *config) in dove_pmu_mpp_ctrl_get() argument
68 unsigned long pmu = readl(data->base + PMU_MPP_GENERAL_CTRL); in dove_pmu_mpp_ctrl_get()
72 return mvebu_mmio_mpp_ctrl_get(data, pid, config); in dove_pmu_mpp_ctrl_get()
75 *config = (func >> shift) & MVEBU_MPP_MASK; in dove_pmu_mpp_ctrl_get()
76 *config |= CONFIG_PMU; in dove_pmu_mpp_ctrl_get()
82 unsigned pid, unsigned long config) in dove_pmu_mpp_ctrl_set() argument
86 unsigned long pmu = readl(data->base + PMU_MPP_GENERAL_CTRL); in dove_pmu_mpp_ctrl_set()
89 if ((config & CONFIG_PMU) == 0) { in dove_pmu_mpp_ctrl_set()
90 writel(pmu & ~BIT(pid), data->base + PMU_MPP_GENERAL_CTRL); in dove_pmu_mpp_ctrl_set()
91 return mvebu_mmio_mpp_ctrl_set(data, pid, config); in dove_pmu_mpp_ctrl_set()
94 writel(pmu | BIT(pid), data->base + PMU_MPP_GENERAL_CTRL); in dove_pmu_mpp_ctrl_set()
97 func |= (config & MVEBU_MPP_MASK) << shift; in dove_pmu_mpp_ctrl_set()
104 unsigned long *config) in dove_mpp4_ctrl_get() argument
126 return -EINVAL; in dove_mpp4_ctrl_get()
129 *config = ((mpp4 & mask) != 0); in dove_mpp4_ctrl_get()
135 unsigned long config) in dove_mpp4_ctrl_set() argument
157 return -EINVAL; in dove_mpp4_ctrl_set()
161 if (config) in dove_mpp4_ctrl_set()
170 unsigned long *config) in dove_nand_ctrl_get() argument
175 *config = ((gmpp & NAND_GPIO_EN) != 0); in dove_nand_ctrl_get()
181 unsigned long config) in dove_nand_ctrl_set() argument
185 (config) ? NAND_GPIO_EN : 0); in dove_nand_ctrl_set()
190 unsigned long *config) in dove_audio0_ctrl_get() argument
192 unsigned long pmu = readl(data->base + PMU_MPP_GENERAL_CTRL); in dove_audio0_ctrl_get()
194 *config = ((pmu & AU0_AC97_SEL) != 0); in dove_audio0_ctrl_get()
200 unsigned long config) in dove_audio0_ctrl_set() argument
202 unsigned long pmu = readl(data->base + PMU_MPP_GENERAL_CTRL); in dove_audio0_ctrl_set()
205 if (config) in dove_audio0_ctrl_set()
207 writel(pmu, data->base + PMU_MPP_GENERAL_CTRL); in dove_audio0_ctrl_set()
213 unsigned long *config) in dove_audio1_ctrl_get() argument
224 *config = 0; in dove_audio1_ctrl_get()
226 *config |= BIT(3); in dove_audio1_ctrl_get()
228 *config |= BIT(2); in dove_audio1_ctrl_get()
230 *config |= BIT(1); in dove_audio1_ctrl_get()
232 *config |= BIT(0); in dove_audio1_ctrl_get()
235 if ((*config & BIT(3)) == 0) in dove_audio1_ctrl_get()
236 *config &= ~(BIT(2) | BIT(0)); in dove_audio1_ctrl_get()
238 if ((*config & BIT(1)) == 0) in dove_audio1_ctrl_get()
239 *config &= ~BIT(0); in dove_audio1_ctrl_get()
244 unsigned long config) in dove_audio1_ctrl_set() argument
249 if (config & BIT(3)) in dove_audio1_ctrl_set()
255 (config & BIT(2)) ? SSP_ON_AU1 : 0); in dove_audio1_ctrl_set()
258 (config & BIT(1)) ? AU1_SPDIFO_GPIO_EN : 0); in dove_audio1_ctrl_set()
261 (config & BIT(0)) ? TWSI_OPTION3_GPIO : 0); in dove_audio1_ctrl_set()
266 /* mpp[52:57] gpio pins depend heavily on current config;
267 * gpio_req does not try to mux in gpio capabilities to not
268 * break other functions. If you require all mpps as gpio
269 * enforce gpio setting by pinctrl mapping.
274 unsigned long config; in dove_audio1_ctrl_gpio_req() local
276 dove_audio1_ctrl_get(data, pid, &config); in dove_audio1_ctrl_gpio_req()
278 switch (config) { in dove_audio1_ctrl_gpio_req()
279 case 0x02: /* i2s1 : gpio[56:57] */ in dove_audio1_ctrl_gpio_req()
280 case 0x0e: /* ssp : gpio[56:57] */ in dove_audio1_ctrl_gpio_req()
283 return -ENOTSUPP; in dove_audio1_ctrl_gpio_req()
284 case 0x08: /* spdifo : gpio[52:55] */ in dove_audio1_ctrl_gpio_req()
285 case 0x0b: /* twsi : gpio[52:55] */ in dove_audio1_ctrl_gpio_req()
288 return -ENOTSUPP; in dove_audio1_ctrl_gpio_req()
289 case 0x0a: /* all gpio */ in dove_audio1_ctrl_gpio_req()
291 /* 0x00 : i2s1/spdifo : no gpio */ in dove_audio1_ctrl_gpio_req()
292 /* 0x0c : ssp/spdifo : no gpio */ in dove_audio1_ctrl_gpio_req()
293 /* 0x0f : ssp/twsi : no gpio */ in dove_audio1_ctrl_gpio_req()
295 return -ENOTSUPP; in dove_audio1_ctrl_gpio_req()
298 /* mpp[52:57] has gpio pins capable of in and out */
303 return -ENOTSUPP; in dove_audio1_ctrl_gpio_dir()
308 unsigned long *config) in dove_twsi_ctrl_get() argument
316 *config = 0; in dove_twsi_ctrl_get()
318 *config = 1; in dove_twsi_ctrl_get()
320 *config = 2; in dove_twsi_ctrl_get()
322 *config = 3; in dove_twsi_ctrl_get()
328 unsigned long config) in dove_twsi_ctrl_set() argument
333 switch (config) { in dove_twsi_ctrl_set()
371 MPP_FUNCTION(0x00, "gpio", NULL),
375 MPP_FUNCTION(CONFIG_PMU | 0x0, "pmu-nc", NULL),
376 MPP_FUNCTION(CONFIG_PMU | 0x1, "pmu-low", NULL),
377 MPP_FUNCTION(CONFIG_PMU | 0x2, "pmu-high", NULL),
379 MPP_FUNCTION(CONFIG_PMU | 0x4, "cpu-pwr-down", NULL),
380 MPP_FUNCTION(CONFIG_PMU | 0x5, "standby-pwr-down", NULL),
381 MPP_FUNCTION(CONFIG_PMU | 0x8, "core-pwr-good", NULL),
382 MPP_FUNCTION(CONFIG_PMU | 0xa, "bat-fault", NULL),
383 MPP_FUNCTION(CONFIG_PMU | 0xb, "ext0-wakeup", NULL),
384 MPP_FUNCTION(CONFIG_PMU | 0xc, "ext1-wakeup", NULL),
385 MPP_FUNCTION(CONFIG_PMU | 0xd, "ext2-wakeup", NULL),
386 MPP_FUNCTION(CONFIG_PMU | 0xe, "pmu-blink", NULL)),
388 MPP_FUNCTION(0x00, "gpio", NULL),
392 MPP_FUNCTION(CONFIG_PMU | 0x0, "pmu-nc", NULL),
393 MPP_FUNCTION(CONFIG_PMU | 0x1, "pmu-low", NULL),
394 MPP_FUNCTION(CONFIG_PMU | 0x2, "pmu-high", NULL),
396 MPP_FUNCTION(CONFIG_PMU | 0x4, "cpu-pwr-down", NULL),
397 MPP_FUNCTION(CONFIG_PMU | 0x5, "standby-pwr-down", NULL),
398 MPP_FUNCTION(CONFIG_PMU | 0x8, "core-pwr-good", NULL),
399 MPP_FUNCTION(CONFIG_PMU | 0xa, "bat-fault", NULL),
400 MPP_FUNCTION(CONFIG_PMU | 0xb, "ext0-wakeup", NULL),
401 MPP_FUNCTION(CONFIG_PMU | 0xc, "ext1-wakeup", NULL),
402 MPP_FUNCTION(CONFIG_PMU | 0xd, "ext2-wakeup", NULL),
403 MPP_FUNCTION(CONFIG_PMU | 0xe, "pmu-blink", NULL)),
405 MPP_FUNCTION(0x00, "gpio", NULL),
410 MPP_FUNCTION(CONFIG_PMU | 0x0, "pmu-nc", NULL),
411 MPP_FUNCTION(CONFIG_PMU | 0x1, "pmu-low", NULL),
412 MPP_FUNCTION(CONFIG_PMU | 0x2, "pmu-high", NULL),
414 MPP_FUNCTION(CONFIG_PMU | 0x4, "cpu-pwr-down", NULL),
415 MPP_FUNCTION(CONFIG_PMU | 0x5, "standby-pwr-down", NULL),
416 MPP_FUNCTION(CONFIG_PMU | 0x8, "core-pwr-good", NULL),
417 MPP_FUNCTION(CONFIG_PMU | 0xa, "bat-fault", NULL),
418 MPP_FUNCTION(CONFIG_PMU | 0xb, "ext0-wakeup", NULL),
419 MPP_FUNCTION(CONFIG_PMU | 0xc, "ext1-wakeup", NULL),
420 MPP_FUNCTION(CONFIG_PMU | 0xd, "ext2-wakeup", NULL),
421 MPP_FUNCTION(CONFIG_PMU | 0xe, "pmu-blink", NULL)),
423 MPP_FUNCTION(0x00, "gpio", NULL),
428 MPP_FUNCTION(0x0f, "lcd-spi", "cs1"),
429 MPP_FUNCTION(CONFIG_PMU | 0x0, "pmu-nc", NULL),
430 MPP_FUNCTION(CONFIG_PMU | 0x1, "pmu-low", NULL),
431 MPP_FUNCTION(CONFIG_PMU | 0x2, "pmu-high", NULL),
433 MPP_FUNCTION(CONFIG_PMU | 0x4, "cpu-pwr-down", NULL),
434 MPP_FUNCTION(CONFIG_PMU | 0x5, "standby-pwr-down", NULL),
435 MPP_FUNCTION(CONFIG_PMU | 0x8, "core-pwr-good", NULL),
436 MPP_FUNCTION(CONFIG_PMU | 0xa, "bat-fault", NULL),
437 MPP_FUNCTION(CONFIG_PMU | 0xb, "ext0-wakeup", NULL),
438 MPP_FUNCTION(CONFIG_PMU | 0xc, "ext1-wakeup", NULL),
439 MPP_FUNCTION(CONFIG_PMU | 0xd, "ext2-wakeup", NULL),
440 MPP_FUNCTION(CONFIG_PMU | 0xe, "pmu-blink", NULL)),
442 MPP_FUNCTION(0x00, "gpio", NULL),
446 MPP_FUNCTION(CONFIG_PMU | 0x0, "pmu-nc", NULL),
447 MPP_FUNCTION(CONFIG_PMU | 0x1, "pmu-low", NULL),
448 MPP_FUNCTION(CONFIG_PMU | 0x2, "pmu-high", NULL),
450 MPP_FUNCTION(CONFIG_PMU | 0x4, "cpu-pwr-down", NULL),
451 MPP_FUNCTION(CONFIG_PMU | 0x5, "standby-pwr-down", NULL),
452 MPP_FUNCTION(CONFIG_PMU | 0x8, "core-pwr-good", NULL),
453 MPP_FUNCTION(CONFIG_PMU | 0xa, "bat-fault", NULL),
454 MPP_FUNCTION(CONFIG_PMU | 0xb, "ext0-wakeup", NULL),
455 MPP_FUNCTION(CONFIG_PMU | 0xc, "ext1-wakeup", NULL),
456 MPP_FUNCTION(CONFIG_PMU | 0xd, "ext2-wakeup", NULL),
457 MPP_FUNCTION(CONFIG_PMU | 0xe, "pmu-blink", NULL)),
459 MPP_FUNCTION(0x00, "gpio", NULL),
463 MPP_FUNCTION(CONFIG_PMU | 0x0, "pmu-nc", NULL),
464 MPP_FUNCTION(CONFIG_PMU | 0x1, "pmu-low", NULL),
465 MPP_FUNCTION(CONFIG_PMU | 0x2, "pmu-high", NULL),
467 MPP_FUNCTION(CONFIG_PMU | 0x4, "cpu-pwr-down", NULL),
468 MPP_FUNCTION(CONFIG_PMU | 0x5, "standby-pwr-down", NULL),
469 MPP_FUNCTION(CONFIG_PMU | 0x8, "core-pwr-good", NULL),
470 MPP_FUNCTION(CONFIG_PMU | 0xa, "bat-fault", NULL),
471 MPP_FUNCTION(CONFIG_PMU | 0xb, "ext0-wakeup", NULL),
472 MPP_FUNCTION(CONFIG_PMU | 0xc, "ext1-wakeup", NULL),
473 MPP_FUNCTION(CONFIG_PMU | 0xd, "ext2-wakeup", NULL),
474 MPP_FUNCTION(CONFIG_PMU | 0xe, "pmu-blink", NULL)),
476 MPP_FUNCTION(0x00, "gpio", NULL),
480 MPP_FUNCTION(CONFIG_PMU | 0x0, "pmu-nc", NULL),
481 MPP_FUNCTION(CONFIG_PMU | 0x1, "pmu-low", NULL),
482 MPP_FUNCTION(CONFIG_PMU | 0x2, "pmu-high", NULL),
484 MPP_FUNCTION(CONFIG_PMU | 0x4, "cpu-pwr-down", NULL),
485 MPP_FUNCTION(CONFIG_PMU | 0x5, "standby-pwr-down", NULL),
486 MPP_FUNCTION(CONFIG_PMU | 0x8, "core-pwr-good", NULL),
487 MPP_FUNCTION(CONFIG_PMU | 0xa, "bat-fault", NULL),
488 MPP_FUNCTION(CONFIG_PMU | 0xb, "ext0-wakeup", NULL),
489 MPP_FUNCTION(CONFIG_PMU | 0xc, "ext1-wakeup", NULL),
490 MPP_FUNCTION(CONFIG_PMU | 0xd, "ext2-wakeup", NULL),
491 MPP_FUNCTION(CONFIG_PMU | 0xe, "pmu-blink", NULL)),
493 MPP_FUNCTION(0x00, "gpio", NULL),
497 MPP_FUNCTION(CONFIG_PMU | 0x0, "pmu-nc", NULL),
498 MPP_FUNCTION(CONFIG_PMU | 0x1, "pmu-low", NULL),
499 MPP_FUNCTION(CONFIG_PMU | 0x2, "pmu-high", NULL),
501 MPP_FUNCTION(CONFIG_PMU | 0x4, "cpu-pwr-down", NULL),
502 MPP_FUNCTION(CONFIG_PMU | 0x5, "standby-pwr-down", NULL),
503 MPP_FUNCTION(CONFIG_PMU | 0x8, "core-pwr-good", NULL),
504 MPP_FUNCTION(CONFIG_PMU | 0xa, "bat-fault", NULL),
505 MPP_FUNCTION(CONFIG_PMU | 0xb, "ext0-wakeup", NULL),
506 MPP_FUNCTION(CONFIG_PMU | 0xc, "ext1-wakeup", NULL),
507 MPP_FUNCTION(CONFIG_PMU | 0xd, "ext2-wakeup", NULL),
508 MPP_FUNCTION(CONFIG_PMU | 0xe, "pmu-blink", NULL)),
510 MPP_FUNCTION(0x00, "gpio", NULL),
512 MPP_FUNCTION(CONFIG_PMU | 0x0, "pmu-nc", NULL),
513 MPP_FUNCTION(CONFIG_PMU | 0x1, "pmu-low", NULL),
514 MPP_FUNCTION(CONFIG_PMU | 0x2, "pmu-high", NULL),
516 MPP_FUNCTION(CONFIG_PMU | 0x4, "cpu-pwr-down", NULL),
517 MPP_FUNCTION(CONFIG_PMU | 0x5, "standby-pwr-down", NULL),
518 MPP_FUNCTION(CONFIG_PMU | 0x8, "cpu-pwr-good", NULL),
519 MPP_FUNCTION(CONFIG_PMU | 0xa, "bat-fault", NULL),
520 MPP_FUNCTION(CONFIG_PMU | 0xb, "ext0-wakeup", NULL),
521 MPP_FUNCTION(CONFIG_PMU | 0xc, "ext1-wakeup", NULL),
522 MPP_FUNCTION(CONFIG_PMU | 0xd, "ext2-wakeup", NULL),
523 MPP_FUNCTION(CONFIG_PMU | 0xe, "pmu-blink", NULL)),
525 MPP_FUNCTION(0x00, "gpio", NULL),
527 MPP_FUNCTION(CONFIG_PMU | 0x0, "pmu-nc", NULL),
528 MPP_FUNCTION(CONFIG_PMU | 0x1, "pmu-low", NULL),
529 MPP_FUNCTION(CONFIG_PMU | 0x2, "pmu-high", NULL),
531 MPP_FUNCTION(CONFIG_PMU | 0x4, "cpu-pwr-down", NULL),
532 MPP_FUNCTION(CONFIG_PMU | 0x5, "standby-pwr-down", NULL),
533 MPP_FUNCTION(CONFIG_PMU | 0x8, "cpu-pwr-good", NULL),
534 MPP_FUNCTION(CONFIG_PMU | 0xa, "bat-fault", NULL),
535 MPP_FUNCTION(CONFIG_PMU | 0xb, "ext0-wakeup", NULL),
536 MPP_FUNCTION(CONFIG_PMU | 0xc, "ext1-wakeup", NULL),
537 MPP_FUNCTION(CONFIG_PMU | 0xd, "ext2-wakeup", NULL),
538 MPP_FUNCTION(CONFIG_PMU | 0xe, "pmu-blink", NULL)),
540 MPP_FUNCTION(0x00, "gpio", NULL),
542 MPP_FUNCTION(CONFIG_PMU | 0x0, "pmu-nc", NULL),
543 MPP_FUNCTION(CONFIG_PMU | 0x1, "pmu-low", NULL),
544 MPP_FUNCTION(CONFIG_PMU | 0x2, "pmu-high", NULL),
546 MPP_FUNCTION(CONFIG_PMU | 0x4, "cpu-pwr-down", NULL),
547 MPP_FUNCTION(CONFIG_PMU | 0x5, "standby-pwr-down", NULL),
548 MPP_FUNCTION(CONFIG_PMU | 0x8, "cpu-pwr-good", NULL),
549 MPP_FUNCTION(CONFIG_PMU | 0xa, "bat-fault", NULL),
550 MPP_FUNCTION(CONFIG_PMU | 0xb, "ext0-wakeup", NULL),
551 MPP_FUNCTION(CONFIG_PMU | 0xc, "ext1-wakeup", NULL),
552 MPP_FUNCTION(CONFIG_PMU | 0xd, "ext2-wakeup", NULL),
553 MPP_FUNCTION(CONFIG_PMU | 0xe, "pmu-blink", NULL)),
555 MPP_FUNCTION(0x00, "gpio", NULL),
557 MPP_FUNCTION(0x02, "sata-1", "act"),
561 MPP_FUNCTION(CONFIG_PMU | 0x0, "pmu-nc", NULL),
562 MPP_FUNCTION(CONFIG_PMU | 0x1, "pmu-low", NULL),
563 MPP_FUNCTION(CONFIG_PMU | 0x2, "pmu-high", NULL),
565 MPP_FUNCTION(CONFIG_PMU | 0x4, "cpu-pwr-down", NULL),
566 MPP_FUNCTION(CONFIG_PMU | 0x5, "standby-pwr-down", NULL),
567 MPP_FUNCTION(CONFIG_PMU | 0x8, "cpu-pwr-good", NULL),
568 MPP_FUNCTION(CONFIG_PMU | 0xa, "bat-fault", NULL),
569 MPP_FUNCTION(CONFIG_PMU | 0xb, "ext0-wakeup", NULL),
570 MPP_FUNCTION(CONFIG_PMU | 0xc, "ext1-wakeup", NULL),
571 MPP_FUNCTION(CONFIG_PMU | 0xd, "ext2-wakeup", NULL),
572 MPP_FUNCTION(CONFIG_PMU | 0xe, "pmu-blink", NULL)),
574 MPP_FUNCTION(0x00, "gpio", NULL),
579 MPP_FUNCTION(CONFIG_PMU | 0x0, "pmu-nc", NULL),
580 MPP_FUNCTION(CONFIG_PMU | 0x1, "pmu-low", NULL),
581 MPP_FUNCTION(CONFIG_PMU | 0x2, "pmu-high", NULL),
583 MPP_FUNCTION(CONFIG_PMU | 0x4, "cpu-pwr-down", NULL),
584 MPP_FUNCTION(CONFIG_PMU | 0x5, "standby-pwr-down", NULL),
585 MPP_FUNCTION(CONFIG_PMU | 0x8, "cpu-pwr-good", NULL),
586 MPP_FUNCTION(CONFIG_PMU | 0xa, "bat-fault", NULL),
587 MPP_FUNCTION(CONFIG_PMU | 0xb, "ext0-wakeup", NULL),
588 MPP_FUNCTION(CONFIG_PMU | 0xc, "ext1-wakeup", NULL),
589 MPP_FUNCTION(CONFIG_PMU | 0xd, "ext2-wakeup", NULL),
590 MPP_FUNCTION(CONFIG_PMU | 0xe, "pmu-blink", NULL)),
592 MPP_FUNCTION(0x00, "gpio", NULL),
597 MPP_FUNCTION(CONFIG_PMU | 0x0, "pmu-nc", NULL),
598 MPP_FUNCTION(CONFIG_PMU | 0x1, "pmu-low", NULL),
599 MPP_FUNCTION(CONFIG_PMU | 0x2, "pmu-high", NULL),
601 MPP_FUNCTION(CONFIG_PMU | 0x4, "cpu-pwr-down", NULL),
602 MPP_FUNCTION(CONFIG_PMU | 0x5, "standby-pwr-down", NULL),
603 MPP_FUNCTION(CONFIG_PMU | 0x8, "cpu-pwr-good", NULL),
604 MPP_FUNCTION(CONFIG_PMU | 0xa, "bat-fault", NULL),
605 MPP_FUNCTION(CONFIG_PMU | 0xb, "ext0-wakeup", NULL),
606 MPP_FUNCTION(CONFIG_PMU | 0xc, "ext1-wakeup", NULL),
607 MPP_FUNCTION(CONFIG_PMU | 0xd, "ext2-wakeup", NULL),
608 MPP_FUNCTION(CONFIG_PMU | 0xe, "pmu-blink", NULL)),
610 MPP_FUNCTION(0x00, "gpio", NULL),
614 MPP_FUNCTION(CONFIG_PMU | 0x0, "pmu-nc", NULL),
615 MPP_FUNCTION(CONFIG_PMU | 0x1, "pmu-low", NULL),
616 MPP_FUNCTION(CONFIG_PMU | 0x2, "pmu-high", NULL),
618 MPP_FUNCTION(CONFIG_PMU | 0x4, "cpu-pwr-down", NULL),
619 MPP_FUNCTION(CONFIG_PMU | 0x5, "standby-pwr-down", NULL),
620 MPP_FUNCTION(CONFIG_PMU | 0x8, "cpu-pwr-good", NULL),
621 MPP_FUNCTION(CONFIG_PMU | 0xa, "bat-fault", NULL),
622 MPP_FUNCTION(CONFIG_PMU | 0xb, "ext0-wakeup", NULL),
623 MPP_FUNCTION(CONFIG_PMU | 0xc, "ext1-wakeup", NULL),
624 MPP_FUNCTION(CONFIG_PMU | 0xd, "ext2-wakeup", NULL),
625 MPP_FUNCTION(CONFIG_PMU | 0xe, "pmu-blink", NULL)),
627 MPP_FUNCTION(0x00, "gpio", NULL),
631 MPP_FUNCTION(CONFIG_PMU | 0x0, "pmu-nc", NULL),
632 MPP_FUNCTION(CONFIG_PMU | 0x1, "pmu-low", NULL),
633 MPP_FUNCTION(CONFIG_PMU | 0x2, "pmu-high", NULL),
635 MPP_FUNCTION(CONFIG_PMU | 0x4, "cpu-pwr-down", NULL),
636 MPP_FUNCTION(CONFIG_PMU | 0x5, "standby-pwr-down", NULL),
637 MPP_FUNCTION(CONFIG_PMU | 0x8, "cpu-pwr-good", NULL),
638 MPP_FUNCTION(CONFIG_PMU | 0xa, "bat-fault", NULL),
639 MPP_FUNCTION(CONFIG_PMU | 0xb, "ext0-wakeup", NULL),
640 MPP_FUNCTION(CONFIG_PMU | 0xc, "ext1-wakeup", NULL),
641 MPP_FUNCTION(CONFIG_PMU | 0xd, "ext2-wakeup", NULL),
642 MPP_FUNCTION(CONFIG_PMU | 0xe, "pmu-blink", NULL)),
644 MPP_FUNCTION(0x00, "gpio", NULL),
647 MPP_FUNCTION(0x04, "lcd-spi", "cs1"),
650 MPP_FUNCTION(0x00, "gpio", NULL),
651 MPP_FUNCTION(0x01, "ac97-1", "sysclko"),
657 MPP_FUNCTION(0x00, "gpio", NULL),
663 MPP_FUNCTION(0x00, "gpio", NULL),
668 MPP_FUNCTION(0x00, "gpio", NULL),
670 MPP_FUNCTION(0x02, "lcd-spi", "miso"),
675 MPP_FUNCTION(0x00, "gpio", NULL),
677 MPP_FUNCTION(0x02, "lcd-spi", "cs0"),
683 MPP_FUNCTION(0x00, "gpio", NULL),
685 MPP_FUNCTION(0x02, "lcd-spi", "mosi"),
691 MPP_FUNCTION(0x00, "gpio", NULL),
692 MPP_FUNCTION(0x02, "lcd-spi", "sck"),
699 MPP_FUNCTION(0x01, "gpio", NULL)),
702 MPP_FUNCTION(0x01, "gpio", NULL)),
705 MPP_FUNCTION(0x01, "gpio", NULL)),
710 MPP_FUNCTION(0x0a, "gpio", NULL),
717 MPP_FUNCTION(0x01, "gpio", NULL)),
720 MPP_FUNCTION(0x01, "gpio", NULL)),
728 MPP_FUNCTION(0x00, "twsi-none", NULL),
729 MPP_FUNCTION(0x01, "twsi-opt1", NULL),
730 MPP_FUNCTION(0x02, "twsi-opt2", NULL),
731 MPP_FUNCTION(0x03, "twsi-opt3", NULL)),
753 { .compatible = "marvell,dove-pinctrl", .data = &dove_pinctrl_info },
769 of_match_device(dove_pinctrl_of_match, &pdev->dev); in dove_pinctrl_probe()
774 pdev->dev.platform_data = (void *)match->data; in dove_pinctrl_probe()
780 clk = devm_clk_get(&pdev->dev, NULL); in dove_pinctrl_probe()
782 dev_err(&pdev->dev, "Unable to get pdma clock"); in dove_pinctrl_probe()
788 base = devm_ioremap_resource(&pdev->dev, mpp_res); in dove_pinctrl_probe()
792 mpp_data = devm_kcalloc(&pdev->dev, dove_pinctrl_info.ncontrols, in dove_pinctrl_probe()
795 return -ENOMEM; in dove_pinctrl_probe()
807 dev_warn(&pdev->dev, "falling back to hardcoded MPP4 resource\n"); in dove_pinctrl_probe()
809 (mpp_res->start & INT_REGS_MASK) + MPP4_REGS_OFFS, 0x4); in dove_pinctrl_probe()
813 mpp4_base = devm_ioremap_resource(&pdev->dev, res); in dove_pinctrl_probe()
819 dev_warn(&pdev->dev, "falling back to hardcoded PMU resource\n"); in dove_pinctrl_probe()
821 (mpp_res->start & INT_REGS_MASK) + PMU_REGS_OFFS, 0x8); in dove_pinctrl_probe()
825 pmu_base = devm_ioremap_resource(&pdev->dev, res); in dove_pinctrl_probe()
829 gconfmap = syscon_regmap_lookup_by_compatible("marvell,dove-global-config"); in dove_pinctrl_probe()
833 dev_warn(&pdev->dev, "falling back to hardcoded global registers\n"); in dove_pinctrl_probe()
835 (mpp_res->start & INT_REGS_MASK) + GC_REGS_OFFS, 0x14); in dove_pinctrl_probe()
836 gc_base = devm_ioremap_resource(&pdev->dev, &fb_res); in dove_pinctrl_probe()
839 gconfmap = devm_regmap_init_mmio(&pdev->dev, in dove_pinctrl_probe()
847 dev_warn(&pdev->dev, FW_BUG "Missing pinctrl regs in DTB. Please update your firmware.\n"); in dove_pinctrl_probe()
854 .name = "dove-pinctrl",