pinctrl: sh-pfc: r8a779[01]: Move 'union vin_data' to shared header file
[deliverable/linux.git] / drivers / pinctrl / sh-pfc / sh_pfc.h
index 15afd49fd4e33b5e72a9fe4b8c618d5ef4d2aa3a..6ab4b46583de3b51f20660c3c0e1813b8899047c 100644 (file)
@@ -52,6 +52,29 @@ struct sh_pfc_pin_group {
        unsigned int nr_pins;
 };
 
+/*
+ * Using union vin_data saves memory occupied by the VIN data pins.
+ * VIN_DATA_PIN_GROUP() is  a macro  used  to describe the VIN pin groups
+ * in this case.
+ */
+#define VIN_DATA_PIN_GROUP(n, s)                               \
+       {                                                       \
+               .name = #n#s,                                   \
+               .pins = n##_pins.data##s,                       \
+               .mux = n##_mux.data##s,                         \
+               .nr_pins = ARRAY_SIZE(n##_pins.data##s),        \
+       }
+
+union vin_data {
+       unsigned int data24[24];
+       unsigned int data20[20];
+       unsigned int data16[16];
+       unsigned int data12[12];
+       unsigned int data10[10];
+       unsigned int data8[8];
+       unsigned int data4[4];
+};
+
 #define SH_PFC_FUNCTION(n)                             \
        {                                               \
                .name = #n,                             \
@@ -98,17 +121,11 @@ struct pinmux_data_reg {
        .enum_ids = (const u16 [r_width]) \
 
 struct pinmux_irq {
-       int irq;
        const short *gpios;
 };
 
-#ifdef CONFIG_ARCH_MULTIPLATFORM
-#define PINMUX_IRQ(irq_nr, ids...)                        \
+#define PINMUX_IRQ(ids...)                        \
        { .gpios = (const short []) { ids, -1 } }
-#else
-#define PINMUX_IRQ(irq_nr, ids...)                        \
-       { .irq = irq_nr, .gpios = (const short []) { ids, -1 } }
-#endif
 
 struct pinmux_range {
        u16 begin;
@@ -143,8 +160,10 @@ struct sh_pfc_soc_info {
        const struct sh_pfc_function *functions;
        unsigned int nr_functions;
 
+#ifdef CONFIG_SUPERH
        const struct pinmux_func *func_gpios;
        unsigned int nr_func_gpios;
+#endif
 
        const struct pinmux_cfg_reg *cfg_regs;
        const struct pinmux_data_reg *data_regs;
@@ -177,8 +196,6 @@ struct sh_pfc_soc_info {
 #define PINMUX_IPSR_NOFN(ipsr, fn, ms)                                 \
        PINMUX_DATA(fn##_MARK, FN_##ipsr, FN_##ms)
 #define PINMUX_IPSR_MSEL(ipsr, fn, ms)                                 \
-       PINMUX_DATA(fn##_MARK, FN_##fn, FN_##ipsr, FN_##ms)
-#define PINMUX_IPSR_MODSEL_DATA(ipsr, fn, ms)                          \
        PINMUX_DATA(fn##_MARK, FN_##ms, FN_##ipsr, FN_##fn)
 
 /*
This page took 0.0274 seconds and 5 git commands to generate.