From: John Crispin Date: Tue, 21 Apr 2015 12:42:05 +0000 (+0000) Subject: ar71xx: spi cleanup for ap121, db120, ubnt-xm and ap136 X-Git-Url: http://git.lede-project.org./?a=commitdiff_plain;h=8a777768a8fa405be605b41104cb4f2abad1829d;p=openwrt%2Fstaging%2Fluka.git ar71xx: spi cleanup for ap121, db120, ubnt-xm and ap136 Signed-off-by: Roman Yeryomin SVN-Revision: 45552 --- diff --git a/target/linux/ar71xx/patches-3.18/206-spi-ath79-make-chipselect-logic-more-flexible.patch b/target/linux/ar71xx/patches-3.18/206-spi-ath79-make-chipselect-logic-more-flexible.patch index 1cf4c2398b..76c067a2ea 100644 --- a/target/linux/ar71xx/patches-3.18/206-spi-ath79-make-chipselect-logic-more-flexible.patch +++ b/target/linux/ar71xx/patches-3.18/206-spi-ath79-make-chipselect-logic-more-flexible.patch @@ -5,79 +5,11 @@ Subject: [PATCH 34/34] spi/ath79: make chipselect logic more flexible Signed-off-by: Gabor Juhos --- - 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 }, }; ---- 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 { diff --git a/target/linux/ar71xx/patches-3.18/603-MIPS-ath79-ap121-fixes.patch b/target/linux/ar71xx/patches-3.18/603-MIPS-ath79-ap121-fixes.patch index b385b9e00b..36139b0905 100644 --- a/target/linux/ar71xx/patches-3.18/603-MIPS-ath79-ap121-fixes.patch +++ b/target/linux/ar71xx/patches-3.18/603-MIPS-ath79-ap121-fixes.patch @@ -40,29 +40,33 @@ 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, @@ -77,13 +81,9 @@ + .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); diff --git a/target/linux/ar71xx/patches-3.18/605-MIPS-ath79-db120-fixes.patch b/target/linux/ar71xx/patches-3.18/605-MIPS-ath79-db120-fixes.patch index b494f9305f..d62263fcdf 100644 --- a/target/linux/ar71xx/patches-3.18/605-MIPS-ath79-db120-fixes.patch +++ b/target/linux/ar71xx/patches-3.18/605-MIPS-ath79-db120-fixes.patch @@ -63,28 +63,24 @@ }; 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, diff --git a/target/linux/ar71xx/patches-3.18/607-MIPS-ath79-ubnt-xm-fixes.patch b/target/linux/ar71xx/patches-3.18/607-MIPS-ath79-ubnt-xm-fixes.patch index cbbe20b49c..6170a0a868 100644 --- a/target/linux/ar71xx/patches-3.18/607-MIPS-ath79-ubnt-xm-fixes.patch +++ b/target/linux/ar71xx/patches-3.18/607-MIPS-ath79-ubnt-xm-fixes.patch @@ -37,22 +37,16 @@ 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); diff --git a/target/linux/ar71xx/patches-3.18/609-MIPS-ath79-ap136-fixes.patch b/target/linux/ar71xx/patches-3.18/609-MIPS-ath79-ap136-fixes.patch index ef0ae9a323..af7368a4d9 100644 --- a/target/linux/ar71xx/patches-3.18/609-MIPS-ath79-ap136-fixes.patch +++ b/target/linux/ar71xx/patches-3.18/609-MIPS-ath79-ap136-fixes.patch @@ -86,13 +86,10 @@ .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; + @@ -113,8 +110,8 @@ + .txpause = 1, + .rxpause = 1, + }, - }; - ++}; ++ -static struct spi_board_info ap136_spi_info[] = { +static struct mdio_board_info ap136_mdio0_info[] = { { @@ -122,7 +119,6 @@ - .chip_select = 0, - .max_speed_hz = 25000000, - .modalias = "mx25l6405d", -- .controller_data = &ap136_spi0_data, - } + .bus_id = "ag71xx-mdio.0", + .phy_addr = 0,