]> asedeno.scripts.mit.edu Git - linux.git/commitdiff
pinctrl: sh-pfc: r8a77970: Deduplicate VIN[01] pin definitions
authorGeert Uytterhoeven <geert+renesas@glider.be>
Wed, 9 Jan 2019 14:56:12 +0000 (15:56 +0100)
committerGeert Uytterhoeven <geert+renesas@glider.be>
Mon, 21 Jan 2019 12:24:52 +0000 (13:24 +0100)
Use union vin_data12 and VIN_DATA_PIN_GROUP() to reduce redundancies in
pin definitions for the VIN0 and VIN1 channels.

This reduces kernel size by 288 bytes.

Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
Reviewed-by: Jacopo Mondi <jacopo+renesas@jmondi.org>
Reviewed-by: Simon Horman <horms+renesas@verge.net.au>
Reviewed-by: Niklas Söderlund <niklas.soderlund+renesas@ragnatech.se>
drivers/pinctrl/sh-pfc/pfc-r8a77970.c

index 4a7ab84b366be9867590fa1b2efaa04e3ce28f4f..c5e67ba29f7c88cdc0024e732c7f9458146dba38 100644 (file)
@@ -1578,47 +1578,25 @@ static const unsigned int tmu_tclk2_b_mux[] = {
 };
 
 /* - VIN0 ------------------------------------------------------------------- */
-static const unsigned int vin0_data8_pins[] = {
-       RCAR_GP_PIN(2, 4), RCAR_GP_PIN(2, 5),
-       RCAR_GP_PIN(2, 6), RCAR_GP_PIN(2, 7),
-       RCAR_GP_PIN(2, 8), RCAR_GP_PIN(2, 9),
-       RCAR_GP_PIN(2, 10), RCAR_GP_PIN(2, 11),
-};
-static const unsigned int vin0_data8_mux[] = {
-       VI0_DATA0_MARK, VI0_DATA1_MARK,
-       VI0_DATA2_MARK, VI0_DATA3_MARK,
-       VI0_DATA4_MARK, VI0_DATA5_MARK,
-       VI0_DATA6_MARK, VI0_DATA7_MARK,
+static const union vin_data12 vin0_data_pins = {
+       .data12 = {
+               RCAR_GP_PIN(2, 4), RCAR_GP_PIN(2, 5),
+               RCAR_GP_PIN(2, 6), RCAR_GP_PIN(2, 7),
+               RCAR_GP_PIN(2, 8), RCAR_GP_PIN(2, 9),
+               RCAR_GP_PIN(2, 10), RCAR_GP_PIN(2, 11),
+               RCAR_GP_PIN(2, 12), RCAR_GP_PIN(2, 13),
+               RCAR_GP_PIN(2, 14), RCAR_GP_PIN(2, 15),
+       },
 };
-static const unsigned int vin0_data10_pins[] = {
-       RCAR_GP_PIN(2, 4), RCAR_GP_PIN(2, 5),
-       RCAR_GP_PIN(2, 6), RCAR_GP_PIN(2, 7),
-       RCAR_GP_PIN(2, 8), RCAR_GP_PIN(2, 9),
-       RCAR_GP_PIN(2, 10), RCAR_GP_PIN(2, 11),
-       RCAR_GP_PIN(2, 12), RCAR_GP_PIN(2, 13),
-};
-static const unsigned int vin0_data10_mux[] = {
-       VI0_DATA0_MARK, VI0_DATA1_MARK,
-       VI0_DATA2_MARK, VI0_DATA3_MARK,
-       VI0_DATA4_MARK, VI0_DATA5_MARK,
-       VI0_DATA6_MARK, VI0_DATA7_MARK,
-       VI0_DATA8_MARK,  VI0_DATA9_MARK,
-};
-static const unsigned int vin0_data12_pins[] = {
-       RCAR_GP_PIN(2, 4), RCAR_GP_PIN(2, 5),
-       RCAR_GP_PIN(2, 6), RCAR_GP_PIN(2, 7),
-       RCAR_GP_PIN(2, 8), RCAR_GP_PIN(2, 9),
-       RCAR_GP_PIN(2, 10), RCAR_GP_PIN(2, 11),
-       RCAR_GP_PIN(2, 12), RCAR_GP_PIN(2, 13),
-       RCAR_GP_PIN(2, 14), RCAR_GP_PIN(2, 15),
-};
-static const unsigned int vin0_data12_mux[] = {
-       VI0_DATA0_MARK, VI0_DATA1_MARK,
-       VI0_DATA2_MARK, VI0_DATA3_MARK,
-       VI0_DATA4_MARK, VI0_DATA5_MARK,
-       VI0_DATA6_MARK, VI0_DATA7_MARK,
-       VI0_DATA8_MARK,  VI0_DATA9_MARK,
-       VI0_DATA10_MARK, VI0_DATA11_MARK,
+static const union vin_data12 vin0_data_mux = {
+       .data12 = {
+               VI0_DATA0_MARK, VI0_DATA1_MARK,
+               VI0_DATA2_MARK, VI0_DATA3_MARK,
+               VI0_DATA4_MARK, VI0_DATA5_MARK,
+               VI0_DATA6_MARK, VI0_DATA7_MARK,
+               VI0_DATA8_MARK,  VI0_DATA9_MARK,
+               VI0_DATA10_MARK, VI0_DATA11_MARK,
+       },
 };
 static const unsigned int vin0_sync_pins[] = {
        /* HSYNC#, VSYNC# */
@@ -1650,47 +1628,25 @@ static const unsigned int vin0_clk_mux[] = {
 };
 
 /* - VIN1 ------------------------------------------------------------------- */
-static const unsigned int vin1_data8_pins[] = {
-       RCAR_GP_PIN(3, 4), RCAR_GP_PIN(3, 5),
-       RCAR_GP_PIN(3, 6), RCAR_GP_PIN(3, 7),
-       RCAR_GP_PIN(3, 8), RCAR_GP_PIN(3, 9),
-       RCAR_GP_PIN(3, 10), RCAR_GP_PIN(3, 11),
-};
-static const unsigned int vin1_data8_mux[] = {
-       VI1_DATA0_MARK, VI1_DATA1_MARK,
-       VI1_DATA2_MARK, VI1_DATA3_MARK,
-       VI1_DATA4_MARK, VI1_DATA5_MARK,
-       VI1_DATA6_MARK, VI1_DATA7_MARK,
-};
-static const unsigned int vin1_data10_pins[] = {
-       RCAR_GP_PIN(3, 4), RCAR_GP_PIN(3, 5),
-       RCAR_GP_PIN(3, 6), RCAR_GP_PIN(3, 7),
-       RCAR_GP_PIN(3, 8), RCAR_GP_PIN(3, 9),
-       RCAR_GP_PIN(3, 10), RCAR_GP_PIN(3, 11),
-       RCAR_GP_PIN(3, 12), RCAR_GP_PIN(3, 13),
-};
-static const unsigned int vin1_data10_mux[] = {
-       VI1_DATA0_MARK, VI1_DATA1_MARK,
-       VI1_DATA2_MARK, VI1_DATA3_MARK,
-       VI1_DATA4_MARK, VI1_DATA5_MARK,
-       VI1_DATA6_MARK, VI1_DATA7_MARK,
-       VI1_DATA8_MARK,  VI1_DATA9_MARK,
-};
-static const unsigned int vin1_data12_pins[] = {
-       RCAR_GP_PIN(3, 4), RCAR_GP_PIN(3, 5),
-       RCAR_GP_PIN(3, 6), RCAR_GP_PIN(3, 7),
-       RCAR_GP_PIN(3, 8), RCAR_GP_PIN(3, 9),
-       RCAR_GP_PIN(3, 10), RCAR_GP_PIN(3, 11),
-       RCAR_GP_PIN(3, 12), RCAR_GP_PIN(3, 13),
-       RCAR_GP_PIN(3, 14), RCAR_GP_PIN(3, 15),
+static const union vin_data12 vin1_data_pins = {
+       .data12 = {
+               RCAR_GP_PIN(3, 4), RCAR_GP_PIN(3, 5),
+               RCAR_GP_PIN(3, 6), RCAR_GP_PIN(3, 7),
+               RCAR_GP_PIN(3, 8), RCAR_GP_PIN(3, 9),
+               RCAR_GP_PIN(3, 10), RCAR_GP_PIN(3, 11),
+               RCAR_GP_PIN(3, 12), RCAR_GP_PIN(3, 13),
+               RCAR_GP_PIN(3, 14), RCAR_GP_PIN(3, 15),
+       },
 };
-static const unsigned int vin1_data12_mux[] = {
-       VI1_DATA0_MARK, VI1_DATA1_MARK,
-       VI1_DATA2_MARK, VI1_DATA3_MARK,
-       VI1_DATA4_MARK, VI1_DATA5_MARK,
-       VI1_DATA6_MARK, VI1_DATA7_MARK,
-       VI1_DATA8_MARK,  VI1_DATA9_MARK,
-       VI1_DATA10_MARK, VI1_DATA11_MARK,
+static const union vin_data12 vin1_data_mux = {
+       .data12 = {
+               VI1_DATA0_MARK, VI1_DATA1_MARK,
+               VI1_DATA2_MARK, VI1_DATA3_MARK,
+               VI1_DATA4_MARK, VI1_DATA5_MARK,
+               VI1_DATA6_MARK, VI1_DATA7_MARK,
+               VI1_DATA8_MARK,  VI1_DATA9_MARK,
+               VI1_DATA10_MARK, VI1_DATA11_MARK,
+       },
 };
 static const unsigned int vin1_sync_pins[] = {
        /* HSYNC#, VSYNC# */
@@ -1831,16 +1787,16 @@ static const struct sh_pfc_pin_group pinmux_groups[] = {
        SH_PFC_PIN_GROUP(tmu_tclk1_b),
        SH_PFC_PIN_GROUP(tmu_tclk2_a),
        SH_PFC_PIN_GROUP(tmu_tclk2_b),
-       SH_PFC_PIN_GROUP(vin0_data8),
-       SH_PFC_PIN_GROUP(vin0_data10),
-       SH_PFC_PIN_GROUP(vin0_data12),
+       VIN_DATA_PIN_GROUP(vin0_data, 8),
+       VIN_DATA_PIN_GROUP(vin0_data, 10),
+       VIN_DATA_PIN_GROUP(vin0_data, 12),
        SH_PFC_PIN_GROUP(vin0_sync),
        SH_PFC_PIN_GROUP(vin0_field),
        SH_PFC_PIN_GROUP(vin0_clkenb),
        SH_PFC_PIN_GROUP(vin0_clk),
-       SH_PFC_PIN_GROUP(vin1_data8),
-       SH_PFC_PIN_GROUP(vin1_data10),
-       SH_PFC_PIN_GROUP(vin1_data12),
+       VIN_DATA_PIN_GROUP(vin1_data, 8),
+       VIN_DATA_PIN_GROUP(vin1_data, 10),
+       VIN_DATA_PIN_GROUP(vin1_data, 12),
        SH_PFC_PIN_GROUP(vin1_sync),
        SH_PFC_PIN_GROUP(vin1_field),
        SH_PFC_PIN_GROUP(vin1_clkenb),