ar71xx: spi cleanup for ap121, db120, ubnt-xm and ap136
authorblogic <blogic@3c298f89-4303-0410-b956-a3cf2f4a3e73>
Tue, 21 Apr 2015 12:42:05 +0000 (12:42 +0000)
committerblogic <blogic@3c298f89-4303-0410-b956-a3cf2f4a3e73>
Tue, 21 Apr 2015 12:42:05 +0000 (12:42 +0000)
Signed-off-by: Roman Yeryomin <roman@advem.lv>
git-svn-id: svn://svn.openwrt.org/openwrt/trunk@45552 3c298f89-4303-0410-b956-a3cf2f4a3e73

target/linux/ar71xx/patches-3.18/206-spi-ath79-make-chipselect-logic-more-flexible.patch
target/linux/ar71xx/patches-3.18/603-MIPS-ath79-ap121-fixes.patch
target/linux/ar71xx/patches-3.18/605-MIPS-ath79-db120-fixes.patch
target/linux/ar71xx/patches-3.18/607-MIPS-ath79-ubnt-xm-fixes.patch
target/linux/ar71xx/patches-3.18/609-MIPS-ath79-ap136-fixes.patch

index 1cf4c23..76c067a 100644 (file)
@@ -5,79 +5,11 @@ Subject: [PATCH 34/34] spi/ath79: make chipselect logic more flexible
 
 Signed-off-by: Gabor Juhos <juhosg@openwrt.org>
 ---
 
 Signed-off-by: Gabor Juhos <juhosg@openwrt.org>
 ---
- arch/mips/ath79/mach-ap121.c                       |    6 ++
- arch/mips/ath79/mach-ap136.c                       |    6 ++
- arch/mips/ath79/mach-ap81.c                        |    6 ++
- arch/mips/ath79/mach-db120.c                       |    6 ++
  arch/mips/ath79/mach-pb44.c                        |    6 ++
  arch/mips/ath79/mach-pb44.c                        |    6 ++
- arch/mips/ath79/mach-ubnt-xm.c                     |    6 ++
  .../include/asm/mach-ath79/ath79_spi_platform.h    |    8 ++-
  drivers/spi/spi-ath79.c                            |   67 +++++++++++++-------
  8 files changed, 88 insertions(+), 23 deletions(-)
 
  .../include/asm/mach-ath79/ath79_spi_platform.h    |    8 ++-
  drivers/spi/spi-ath79.c                            |   67 +++++++++++++-------
  8 files changed, 88 insertions(+), 23 deletions(-)
 
---- a/arch/mips/ath79/mach-ap121.c
-+++ b/arch/mips/ath79/mach-ap121.c
-@@ -58,12 +58,18 @@ static struct gpio_keys_button ap121_gpi
-       }
- };
-+static struct ath79_spi_controller_data ap121_spi0_data = {
-+      .cs_type = ATH79_SPI_CS_TYPE_INTERNAL,
-+      .cs_line = 0,
-+};
-+
- static struct spi_board_info ap121_spi_info[] = {
-       {
-               .bus_num        = 0,
-               .chip_select    = 0,
-               .max_speed_hz   = 25000000,
-               .modalias       = "mx25l1606e",
-+              .controller_data = &ap121_spi0_data,
-       }
- };
---- a/arch/mips/ath79/mach-ap136.c
-+++ b/arch/mips/ath79/mach-ap136.c
-@@ -98,12 +98,18 @@ static struct gpio_keys_button ap136_gpi
-       },
- };
-+static struct ath79_spi_controller_data ap136_spi0_data = {
-+      .cs_type = ATH79_SPI_CS_TYPE_INTERNAL,
-+      .cs_line = 0,
-+};
-+
- static struct spi_board_info ap136_spi_info[] = {
-       {
-               .bus_num        = 0,
-               .chip_select    = 0,
-               .max_speed_hz   = 25000000,
-               .modalias       = "mx25l6405d",
-+              .controller_data = &ap136_spi0_data,
-       }
- };
---- a/arch/mips/ath79/mach-db120.c
-+++ b/arch/mips/ath79/mach-db120.c
-@@ -76,12 +76,18 @@ static struct gpio_keys_button db120_gpi
-       },
- };
-+static struct ath79_spi_controller_data db120_spi0_data = {
-+      .cs_type = ATH79_SPI_CS_TYPE_INTERNAL,
-+      .cs_line = 0,
-+};
-+
- static struct spi_board_info db120_spi_info[] = {
-       {
-               .bus_num        = 0,
-               .chip_select    = 0,
-               .max_speed_hz   = 25000000,
-               .modalias       = "s25sl064a",
-+              .controller_data = &db120_spi0_data,
-       }
- };
 --- a/arch/mips/ath79/mach-pb44.c
 +++ b/arch/mips/ath79/mach-pb44.c
 @@ -87,12 +87,18 @@ static struct gpio_keys_button pb44_gpio
 --- a/arch/mips/ath79/mach-pb44.c
 +++ b/arch/mips/ath79/mach-pb44.c
 @@ -87,12 +87,18 @@ static struct gpio_keys_button pb44_gpio
@@ -99,27 +31,6 @@ Signed-off-by: Gabor Juhos <juhosg@openwrt.org>
        },
  };
  
        },
  };
  
---- a/arch/mips/ath79/mach-ubnt-xm.c
-+++ b/arch/mips/ath79/mach-ubnt-xm.c
-@@ -65,12 +65,18 @@ static struct gpio_keys_button ubnt_xm_g
-       }
- };
-+static struct ath79_spi_controller_data ubnt_xm_spi0_data = {
-+      .cs_type = ATH79_SPI_CS_TYPE_INTERNAL,
-+      .cs_line = 0,
-+};
-+
- static struct spi_board_info ubnt_xm_spi_info[] = {
-       {
-               .bus_num        = 0,
-               .chip_select    = 0,
-               .max_speed_hz   = 25000000,
-               .modalias       = "mx25l6405d",
-+              .controller_data = &ubnt_xm_spi0_data,
-       }
- };
 --- a/arch/mips/include/asm/mach-ath79/ath79_spi_platform.h
 +++ b/arch/mips/include/asm/mach-ath79/ath79_spi_platform.h
 @@ -16,8 +16,14 @@ struct ath79_spi_platform_data {
 --- a/arch/mips/include/asm/mach-ath79/ath79_spi_platform.h
 +++ b/arch/mips/include/asm/mach-ath79/ath79_spi_platform.h
 @@ -16,8 +16,14 @@ struct ath79_spi_platform_data {
index b385b9e..36139b0 100644 (file)
  
  static struct gpio_led ap121_leds_gpio[] __initdata = {
        {
  
  static struct gpio_led ap121_leds_gpio[] __initdata = {
        {
-@@ -58,41 +67,78 @@ static struct gpio_keys_button ap121_gpi
+@@ -58,35 +67,78 @@ static struct gpio_keys_button ap121_gpi
        }
  };
  
        }
  };
  
--static struct ath79_spi_controller_data ap121_spi0_data = {
--      .cs_type = ATH79_SPI_CS_TYPE_INTERNAL,
--      .cs_line = 0,
+-static struct spi_board_info ap121_spi_info[] = {
+-      {
+-              .bus_num        = 0,
+-              .chip_select    = 0,
+-              .max_speed_hz   = 25000000,
+-              .modalias       = "mx25l1606e",
+-      }
+-};
+-
+-static struct ath79_spi_platform_data ap121_spi_data = {
+-      .bus_num        = 0,
+-      .num_chipselect = 1,
+-};
 +static struct gpio_led ap121_mini_leds_gpio[] __initdata = {
 +      {
 +              .name           = "ap121:green:wlan",
 +              .gpio           = AP121_MINI_GPIO_LED_WLAN,
 +              .active_low     = 0,
 +      },
 +static struct gpio_led ap121_mini_leds_gpio[] __initdata = {
 +      {
 +              .name           = "ap121:green:wlan",
 +              .gpio           = AP121_MINI_GPIO_LED_WLAN,
 +              .active_low     = 0,
 +      },
- };
--static struct spi_board_info ap121_spi_info[] = {
++};
++
 +static struct gpio_keys_button ap121_mini_gpio_keys[] __initdata = {
 +static struct gpio_keys_button ap121_mini_gpio_keys[] __initdata = {
-       {
--              .bus_num        = 0,
--              .chip_select    = 0,
--              .max_speed_hz   = 25000000,
--              .modalias       = "mx25l1606e",
--              .controller_data = &ap121_spi0_data,
++      {
 +              .desc           = "jumpstart button",
 +              .type           = EV_KEY,
 +              .code           = KEY_WPS_BUTTON,
 +              .desc           = "jumpstart button",
 +              .type           = EV_KEY,
 +              .code           = KEY_WPS_BUTTON,
 +              .debounce_interval = AP121_KEYS_DEBOUNCE_INTERVAL,
 +              .gpio           = AP121_MINI_GPIO_BTN_RESET,
 +              .active_low     = 1,
 +              .debounce_interval = AP121_KEYS_DEBOUNCE_INTERVAL,
 +              .gpio           = AP121_MINI_GPIO_BTN_RESET,
 +              .active_low     = 1,
-       }
- };
--static struct ath79_spi_platform_data ap121_spi_data = {
--      .bus_num        = 0,
--      .num_chipselect = 1,
--};
++      }
++};
++
 +static void __init ap121_common_setup(void)
 +{
 +      u8 *art = (u8 *) KSEG1ADDR(0x1fff0000);
 +static void __init ap121_common_setup(void)
 +{
 +      u8 *art = (u8 *) KSEG1ADDR(0x1fff0000);
index b494f93..d62263f 100644 (file)
  };
  
  static struct gpio_keys_button db120_gpio_keys[] __initdata = {
  };
  
  static struct gpio_keys_button db120_gpio_keys[] __initdata = {
-@@ -76,66 +93,85 @@ static struct gpio_keys_button db120_gpi
+@@ -76,60 +93,85 @@ static struct gpio_keys_button db120_gpi
        },
  };
  
        },
  };
  
--static struct ath79_spi_controller_data db120_spi0_data = {
--      .cs_type = ATH79_SPI_CS_TYPE_INTERNAL,
--      .cs_line = 0,
 +static struct ar8327_pad_cfg db120_ar8327_pad0_cfg = {
 +      .mode = AR8327_PAD_MAC_RGMII,
 +      .txclk_delay_en = true,
 +      .rxclk_delay_en = true,
 +      .txclk_delay_sel = AR8327_CLK_DELAY_SEL1,
 +      .rxclk_delay_sel = AR8327_CLK_DELAY_SEL2,
 +static struct ar8327_pad_cfg db120_ar8327_pad0_cfg = {
 +      .mode = AR8327_PAD_MAC_RGMII,
 +      .txclk_delay_en = true,
 +      .rxclk_delay_en = true,
 +      .txclk_delay_sel = AR8327_CLK_DELAY_SEL1,
 +      .rxclk_delay_sel = AR8327_CLK_DELAY_SEL2,
- };
++};
++
 -static struct spi_board_info db120_spi_info[] = {
 -      {
 -              .bus_num        = 0,
 -              .chip_select    = 0,
 -              .max_speed_hz   = 25000000,
 -              .modalias       = "s25sl064a",
 -static struct spi_board_info db120_spi_info[] = {
 -      {
 -              .bus_num        = 0,
 -              .chip_select    = 0,
 -              .max_speed_hz   = 25000000,
 -              .modalias       = "s25sl064a",
--              .controller_data = &db120_spi0_data,
 -      }
 +static struct ar8327_led_cfg db120_ar8327_led_cfg = {
 +      .led_ctrl0 = 0x00000000,
 -      }
 +static struct ar8327_led_cfg db120_ar8327_led_cfg = {
 +      .led_ctrl0 = 0x00000000,
index cbbe20b..6170a0a 100644 (file)
  
  static struct gpio_led ubnt_xm_leds_gpio[] __initdata = {
        {
  
  static struct gpio_led ubnt_xm_leds_gpio[] __initdata = {
        {
-@@ -65,54 +66,10 @@ static struct gpio_keys_button ubnt_xm_g
+@@ -65,48 +66,10 @@ static struct gpio_keys_button ubnt_xm_g
        }
  };
  
        }
  };
  
--static struct ath79_spi_controller_data ubnt_xm_spi0_data = {
--      .cs_type = ATH79_SPI_CS_TYPE_INTERNAL,
--      .cs_line = 0,
--};
--
 -static struct spi_board_info ubnt_xm_spi_info[] = {
 -      {
 -              .bus_num        = 0,
 -              .chip_select    = 0,
 -              .max_speed_hz   = 25000000,
 -              .modalias       = "mx25l6405d",
 -static struct spi_board_info ubnt_xm_spi_info[] = {
 -      {
 -              .bus_num        = 0,
 -              .chip_select    = 0,
 -              .max_speed_hz   = 25000000,
 -              .modalias       = "mx25l6405d",
--              .controller_data = &ubnt_xm_spi0_data,
 -      }
 -};
 -
 -      }
 -};
 -
@@ -94,7 +88,7 @@
        ath79_register_leds_gpio(-1, ARRAY_SIZE(ubnt_xm_leds_gpio),
                                 ubnt_xm_leds_gpio);
  
        ath79_register_leds_gpio(-1, ARRAY_SIZE(ubnt_xm_leds_gpio),
                                 ubnt_xm_leds_gpio);
  
-@@ -120,10 +77,8 @@ static void __init ubnt_xm_init(void)
+@@ -114,10 +71,8 @@ static void __init ubnt_xm_init(void)
                                        ARRAY_SIZE(ubnt_xm_gpio_keys),
                                        ubnt_xm_gpio_keys);
  
                                        ARRAY_SIZE(ubnt_xm_gpio_keys),
                                        ubnt_xm_gpio_keys);
  
index ef0ae9a..af7368a 100644 (file)
                .gpio           = AP136_GPIO_LED_USB,
                .active_low     = 1,
        }
                .gpio           = AP136_GPIO_LED_USB,
                .active_low     = 1,
        }
-@@ -98,65 +106,151 @@ static struct gpio_keys_button ap136_gpi
+@@ -98,59 +106,151 @@ static struct gpio_keys_button ap136_gpi
        },
  };
  
        },
  };
  
--static struct ath79_spi_controller_data ap136_spi0_data = {
--      .cs_type = ATH79_SPI_CS_TYPE_INTERNAL,
--      .cs_line = 0,
 +static struct ar8327_pad_cfg ap136_ar8327_pad0_cfg;
 +static struct ar8327_pad_cfg ap136_ar8327_pad6_cfg;
 +
 +static struct ar8327_pad_cfg ap136_ar8327_pad0_cfg;
 +static struct ar8327_pad_cfg ap136_ar8327_pad6_cfg;
 +
 +              .txpause = 1,
 +              .rxpause = 1,
 +      },
 +              .txpause = 1,
 +              .rxpause = 1,
 +      },
- };
++};
++
 -static struct spi_board_info ap136_spi_info[] = {
 +static struct mdio_board_info ap136_mdio0_info[] = {
        {
 -static struct spi_board_info ap136_spi_info[] = {
 +static struct mdio_board_info ap136_mdio0_info[] = {
        {
 -              .chip_select    = 0,
 -              .max_speed_hz   = 25000000,
 -              .modalias       = "mx25l6405d",
 -              .chip_select    = 0,
 -              .max_speed_hz   = 25000000,
 -              .modalias       = "mx25l6405d",
--              .controller_data = &ap136_spi0_data,
 -      }
 +              .bus_id = "ag71xx-mdio.0",
 +              .phy_addr = 0,
 -      }
 +              .bus_id = "ag71xx-mdio.0",
 +              .phy_addr = 0,