Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/sage/ceph...
[firefly-linux-kernel-4.4.55.git] / drivers / pinctrl / sh-pfc / pfc-shx3.c
index e985099b777730a9e6dd15bc1dfa5e86819c9739..6594c8c48747169b867f3626f2d20d4ce80f9d54 100644 (file)
@@ -147,7 +147,7 @@ enum {
        PINMUX_MARK_END,
 };
 
-static pinmux_enum_t shx3_pinmux_data[] = {
+static const pinmux_enum_t shx3_pinmux_data[] = {
 
        /* PA GPIO */
        PINMUX_DATA(PA7_DATA, PA7_IN, PA7_OUT, PA7_IN_PU),
@@ -306,7 +306,7 @@ static pinmux_enum_t shx3_pinmux_data[] = {
        PINMUX_DATA(IRQOUT_MARK,        PH0_FN),
 };
 
-static struct pinmux_gpio shx3_pinmux_gpios[] = {
+static struct sh_pfc_pin shx3_pinmux_pins[] = {
        /* PA */
        PINMUX_GPIO(GPIO_PA7, PA7_DATA),
        PINMUX_GPIO(GPIO_PA6, PA6_DATA),
@@ -384,7 +384,11 @@ static struct pinmux_gpio shx3_pinmux_gpios[] = {
        PINMUX_GPIO(GPIO_PH2, PH2_DATA),
        PINMUX_GPIO(GPIO_PH1, PH1_DATA),
        PINMUX_GPIO(GPIO_PH0, PH0_DATA),
+};
+
+#define PINMUX_FN_BASE ARRAY_SIZE(shx3_pinmux_pins)
 
+static const struct pinmux_func shx3_pinmux_func_gpios[] = {
        /* FN */
        GPIO_FN(D31),
        GPIO_FN(D30),
@@ -450,7 +454,7 @@ static struct pinmux_gpio shx3_pinmux_gpios[] = {
        GPIO_FN(IRQOUT),
 };
 
-static struct pinmux_cfg_reg shx3_pinmux_config_regs[] = {
+static const struct pinmux_cfg_reg shx3_pinmux_config_regs[] = {
        { PINMUX_CFG_REG("PABCR", 0xffc70000, 32, 2) {
                PA7_FN, PA7_OUT, PA7_IN, PA7_IN_PU,
                PA6_FN, PA6_OUT, PA6_IN, PA6_IN_PU,
@@ -526,7 +530,7 @@ static struct pinmux_cfg_reg shx3_pinmux_config_regs[] = {
        { },
 };
 
-static struct pinmux_data_reg shx3_pinmux_data_regs[] = {
+static const struct pinmux_data_reg shx3_pinmux_data_regs[] = {
        { PINMUX_DATA_REG("PABDR", 0xffc70010, 32) {
                0, 0, 0, 0, 0, 0, 0, 0,
                PA7_DATA, PA6_DATA, PA5_DATA, PA4_DATA,
@@ -562,17 +566,17 @@ static struct pinmux_data_reg shx3_pinmux_data_regs[] = {
        { },
 };
 
-struct sh_pfc_soc_info shx3_pinmux_info = {
+const struct sh_pfc_soc_info shx3_pinmux_info = {
        .name           = "shx3_pfc",
-       .reserved_id    = PINMUX_RESERVED,
        .input          = { PINMUX_INPUT_BEGIN,    PINMUX_INPUT_END },
        .input_pu       = { PINMUX_INPUT_PULLUP_BEGIN,
                            PINMUX_INPUT_PULLUP_END },
        .output         = { PINMUX_OUTPUT_BEGIN,   PINMUX_OUTPUT_END },
        .function       = { PINMUX_FUNCTION_BEGIN, PINMUX_FUNCTION_END },
-       .gpios          = shx3_pinmux_gpios,
-       .nr_pins        = GPIO_PH0 + 1,
-       .nr_gpios       = ARRAY_SIZE(shx3_pinmux_gpios),
+       .pins           = shx3_pinmux_pins,
+       .nr_pins        = ARRAY_SIZE(shx3_pinmux_pins),
+       .func_gpios     = shx3_pinmux_func_gpios,
+       .nr_func_gpios  = ARRAY_SIZE(shx3_pinmux_func_gpios),
        .gpio_data      = shx3_pinmux_data,
        .gpio_data_size = ARRAY_SIZE(shx3_pinmux_data),
        .cfg_regs       = shx3_pinmux_config_regs,