ar71xx: spi cleanup for ap121, db120, ubnt-xm and ap136
authorJohn Crispin <john@openwrt.org>
Tue, 21 Apr 2015 12:42:05 +0000 (12:42 +0000)
committerJohn Crispin <john@openwrt.org>
Tue, 21 Apr 2015 12:42:05 +0000 (12:42 +0000)
Signed-off-by: Roman Yeryomin <roman@advem.lv>
SVN-Revision: 45552

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 1cf4c2398b8be7f2520ae764e817288e7a1f4684..76c067a2ea41925d4a92e91cf8ce947f4fe36a26 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>
 ---
- 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-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(-)
 
---- 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
@@ -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 {
index b385b9e00b76176001a6956919be02854152f774..36139b09051ad232a6919a85713364bff96fdca0 100644 (file)
  
  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 spi_board_info ap121_spi_info[] = {
++};
++
 +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,
 +              .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);
index b494f9305f8311f1e7197628993a0615a0a20057..d62263fcdff368a05e3570df636786a503dc8432 100644 (file)
  };
  
  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 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,
index cbbe20b49cd6e70e057fada3121bd5711055d70e..6170a0a8683495f03f9696fd345526c6a802d5d2 100644 (file)
  
  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",
--              .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);
  
-@@ -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);
  
index ef0ae9a323107a26863c0f0e0c5a49a429defc99..af7368a4d94a60b90eccf476623b27a4e917653e 100644 (file)
                .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;
 +
 +              .txpause = 1,
 +              .rxpause = 1,
 +      },
- };
++};
++
 -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",
--              .controller_data = &ap136_spi0_data,
 -      }
 +              .bus_id = "ag71xx-mdio.0",
 +              .phy_addr = 0,