15 #include <linux/module.h>
16 #include <linux/bitops.h>
25 #define DOVE_SB_REGS_VIRT_BASE 0xfde00000
26 #define DOVE_MPP_VIRT_BASE (DOVE_SB_REGS_VIRT_BASE | 0xd0200)
27 #define DOVE_PMU_MPP_GENERAL_CTRL (DOVE_MPP_VIRT_BASE + 0x10)
28 #define DOVE_AU0_AC97_SEL BIT(16)
29 #define DOVE_GLOBAL_CONFIG_1 (DOVE_SB_REGS_VIRT_BASE | 0xe802C)
30 #define DOVE_TWSI_ENABLE_OPTION1 BIT(7)
31 #define DOVE_GLOBAL_CONFIG_2 (DOVE_SB_REGS_VIRT_BASE | 0xe8030)
32 #define DOVE_TWSI_ENABLE_OPTION2 BIT(20)
33 #define DOVE_TWSI_ENABLE_OPTION3 BIT(21)
34 #define DOVE_TWSI_OPTION3_GPIO BIT(22)
35 #define DOVE_SSP_CTRL_STATUS_1 (DOVE_SB_REGS_VIRT_BASE | 0xe8034)
36 #define DOVE_SSP_ON_AU1 BIT(0)
37 #define DOVE_MPP_GENERAL_VIRT_BASE (DOVE_SB_REGS_VIRT_BASE | 0xe803c)
38 #define DOVE_AU1_SPDIFO_GPIO_EN BIT(1)
39 #define DOVE_NAND_GPIO_EN BIT(0)
40 #define DOVE_GPIO_LO_VIRT_BASE (DOVE_SB_REGS_VIRT_BASE | 0xd0400)
41 #define DOVE_MPP_CTRL4_VIRT_BASE (DOVE_GPIO_LO_VIRT_BASE + 0x40)
42 #define DOVE_SPI_GPIO_SEL BIT(5)
43 #define DOVE_UART1_GPIO_SEL BIT(4)
44 #define DOVE_AU1_GPIO_SEL BIT(3)
45 #define DOVE_CAM_GPIO_SEL BIT(2)
46 #define DOVE_SD1_GPIO_SEL BIT(1)
47 #define DOVE_SD0_GPIO_SEL BIT(0)
49 #define MPPS_PER_REG 8
53 #define CONFIG_PMU BIT(4)
63 if (pmu & (1 << ctrl->
pid))
83 mpp |= config << shift;
90 unsigned long *config)
115 *config = ((mpp4 &
mask) != 0);
121 unsigned long config)
156 unsigned long *config)
166 unsigned long config)
180 unsigned long *config)
190 unsigned long config)
203 unsigned long *config)
221 if ((*config &
BIT(3)) == 0)
222 *config &= ~(
BIT(2) |
BIT(0));
224 if ((*config &
BIT(1)) == 0)
230 unsigned long config)
263 dove_audio1_ctrl_get(ctrl, &config);
295 unsigned long *config)
312 unsigned long config)
317 gcfg1 &= ~DOVE_TWSI_ENABLE_OPTION1;
556 static struct pinctrl_gpio_range dove_mpp_gpio_ranges[] = {
563 .controls = dove_mpp_controls,
565 .modes = dove_mpp_modes,
567 .gpioranges = dove_mpp_gpio_ranges,
568 .ngpioranges =
ARRAY_SIZE(dove_mpp_gpio_ranges),
575 { .compatible =
"marvell,dove-pinctrl", .data = &dove_pinctrl_info },
583 pdev->
dev.platform_data = match->
data;
591 clk_prepare_enable(clk);
602 clk_disable_unprepare(clk);
608 .name =
"dove-pinctrl",
612 .probe = dove_pinctrl_probe,