ARM: tegra: paz00: Add Wifi and second serial port support
Subsystems (3)
cover ARM: tegra: paz00: Add Wifi and second serial port support
Colin,
the following three patches add the second serial port (some solder points on the mainboard) and Wifi support (rfkill and LED) to PAZ00.
The second serial port is useful to be able to communicate with the booloader and also to see early kernel messages.
They were intended for 3.1 but if it's too late, 3.2 is also ok.
Thanks
Marc
Marc Dietrich (3):
ARM: tegra: paz00: add support serial port on JP1
ARM: tegra: paz00: export the WIFI rfkill gpio
ARM: tegra: paz00: enable wifi led
arch/arm/mach-tegra/board-paz00-pinmux.c | 2 + arch/arm/mach-tegra/board-paz00.c | 50 ++++++++++++++++++++++++++++++ arch/arm/mach-tegra/board-paz00.h | 7 ++++ 3 files changed, 59 insertions(+), 0 deletions(-)
Signature · 1 line
1.7.4.1
PATCH 1/3 ARM: tegra: paz00: add support serial port on JP1
UART-A is connected to JP1 and used by the bootloader for debugging output while UART-D is connected to the mini-pcie expansion slot.
--- arch/arm/mach-tegra/board-paz00.c | 11 +++++++++++ 1 files changed, 11 insertions(+), 0 deletions(-)
arch/arm/mach-tegra/board-paz00.c +11 -0
@@ -47,7 +47,17 @@#include "gpio-names.h" static struct plat_serial8250_port debug_uart_platform_data[] = { +/* serial port on JP1 */ { + .membase =IO_ADDRESS (TEGRA_UARTA_BASE ), + .mapbase =TEGRA_UARTA_BASE , + .irq =INT_UARTA , + .flags =UPF_BOOT_AUTOCONF , + .iotype =UPIO_MEM , + .regshift =2 , + .uartclk =216000000 , + }, { +/* serial port on mini-pcie */ .membase =IO_ADDRESS (TEGRA_UARTD_BASE ), .mapbase =TEGRA_UARTD_BASE , .irq =INT_UARTD ,
@@ -137,6 +147,7 @@ static void __init tegra_paz00_fixup(struct machine_desc *desc,static __initdata struct tegra_clk_init_table paz00_clk_init_table[] = {/* name parent rate enabled */ + {"uarta" ,"pll_p" ,216000000 , true }, {"uartd" ,"pll_p" ,216000000 , true }, {NULL ,NULL ,0 ,0 }, };
Signature · 1 line
1.7.4.1
PATCH 1/3 ARM: tegra: paz00: add support serial port on JP1
Marc Dietrich wrote at Friday, July 15, 2011 4:24 AM:
Quoted 13 lines
UART-A is connected to JP1 and used by the bootloader for debugging output while UART-D is connected to the mini-pcie expansion slot.
Signed-off-by Marc Dietrich <[email protected]>--- arch/arm/mach-tegra/board-paz00.c | 11 +++++++++++ 1 files changed, 11 insertions(+), 0 deletions(-)arch/arm/mach-tegra/board-paz00.c +0
-0
arch/arm/mach-tegra/board-paz00.c line 51
Quoted 5 lines
arch/arm/mach-tegra/board-paz00.c +1
-0@@ -47,7 +47,17 @@#include "gpio-names.h" static struct plat_serial8250_port debug_uart_platform_data[] = { +/* serial port on JP1 */ {
Shouldn't the indentation of the comment be aligned to the brace?
I'm not sure if the order of entries in the array matters. It'd presumably be safer to add the new UART entry to the end of the array so that any existing index-based number isn't changed.
Quoted 22 lines
arch/arm/mach-tegra/board-paz00.c +10
-1+ .membase = IO_ADDRESS(TEGRA_UARTA_BASE), + .mapbase = TEGRA_UARTA_BASE, + .irq = INT_UARTA, + .flags = UPF_BOOT_AUTOCONF, + .iotype = UPIO_MEM, + .regshift = 2, + .uartclk = 216000000, + }, { +/* serial port on mini-pcie */ .membase = IO_ADDRESS(TEGRA_UARTD_BASE), .mapbase = TEGRA_UARTD_BASE, .irq = INT_UARTD,@@ -137,6 +147,7 @@ static void __init tegra_paz00_fixup(struct machine_desc *desc,static __initdata struct tegra_clk_init_table paz00_clk_init_table[] = {/* name parent rate enabled */ + {"uarta" ,"pll_p" ,216000000 , true }, {"uartd" ,"pll_p" ,216000000 , true }, {NULL ,NULL ,0 ,0 }, }; --1.7.4.1
Signature · 1 line
nvpublic
PATCH 1/3 ARM: tegra: paz00: add support serial port on JP1
Am Fri, 15 Jul 2011 09:39:36 -0700
schrieb Stephen Warren <[email protected]>:
Quoted 16 lines
Marc Dietrich wrote at Friday, July 15, 2011 4:24 AM:
Quoted 15 lines
UART-A is connected to JP1 and used by the bootloader for debugging output while UART-D is connected to the mini-pcie expansion slot.
Signed-off-by Marc Dietrich <[email protected]>--- arch/arm/mach-tegra/board-paz00.c | 11 +++++++++++ 1 files changed, 11 insertions(+), 0 deletions(-)(quoted diff) +0
-0
b/arch/arm/mach-tegra/board-paz00.cindex 1b076f6..931b06e 100644arch/arm/mach-tegra/board-paz00.c +0
-0@@ -47,7 +47,17 @@#include "gpio-names.h"
Quoted 5 lines
arch/arm/mach-tegra/board-paz00.c line 51
Quoted 3 lines
arch/arm/mach-tegra/board-paz00.c +1
-0static struct plat_serial8250_port debug_uart_platform_data[] = { +/* serial port on JP1 */ {Shouldn't the indentation of the comment be aligned to the brace?
ok, seems to be the common kernel style. Will be fixed in V2.
Quoted 3 lines
I'm not sure if the order of entries in the array matters. It'd presumably be safer to add the new UART entry to the end of the array so that any existing index-based number isn't changed.
yeah, it will change the numbering, but none I know of used the serial interface of the mini-pcie and it makes some sense to have the bootloader output on number 0.
Quoted 25 lines
Quoted 24 lines
arch/arm/mach-tegra/board-paz00.c +9
-0+ .membase = IO_ADDRESS(TEGRA_UARTA_BASE), + .mapbase = TEGRA_UARTA_BASE, + .irq = INT_UARTA, + .flags = UPF_BOOT_AUTOCONF, + .iotype = UPIO_MEM, + .regshift = 2, + .uartclk = 216000000, + }, { +/* serial port on mini-pcie */ .membase = IO_ADDRESS(TEGRA_UARTD_BASE), .mapbase = TEGRA_UARTD_BASE, .irq = INT_UARTD,@@ -137,6 +147,7 @@ static void __init tegra_paz00_fixup(structmachine_desc *desc, static __initdata struct tegra_clk_init_tablepaz00_clk_init_table[] = { /* name
parent rate enabled */arch/arm/mach-tegra/board-paz00.c +1
-0+ { "uarta", "pll_p", 216000000, true }, { "uartd", "pll_p", 216000000, true }, { NULL, NULL,0, 0}, };
--
1.7.4.1
PATCH 2/3 ARM: tegra: paz00: export the WIFI rfkill gpio
In reply to Marc DietrichThis makes the WIFI rfkill gpio available to userspace. On boot, WIFI will be unblocked by default.
--- arch/arm/mach-tegra/board-paz00-pinmux.c | 1 + arch/arm/mach-tegra/board-paz00.c | 16 ++++++++++++++++ arch/arm/mach-tegra/board-paz00.h | 6 ++++++ 3 files changed, 23 insertions(+), 0 deletions(-)
arch/arm/mach-tegra/board-paz00-pinmux.c +1 -0
@@ -145,6 +145,7 @@ static struct tegra_gpio_table gpio_table[] = { { .gpio = TEGRA_GPIO_SD1_WP, .enable = true }, { .gpio = TEGRA_GPIO_SD1_POWER, .enable = true }, { .gpio = TEGRA_ULPI_RST, .enable = true }, + { .gpio = TEGRA_WIFI_PWRN, .enable = true }, };void paz00_pinmux_init (void )
arch/arm/mach-tegra/board-paz00.c +16 -0
@@ -25,6 +25,7 @@#include <linux/dma-mapping.h> #include <linux/pda_power.h> #include <linux/io.h> +#include <linux/gpio.h> #include <linux/i2c.h> #include <linux/i2c-tegra.h> #include <linux/platform_data/tegra_usb.h>
@@ -165,6 +166,20 @@ static struct tegra_sdhci_platform_data sdhci_pdata4 = { .is_8bit = 1, }; +static void __init paz00_wifi_init (void ) +{ +int ret; + +/* unlock hw rfkill */ + ret =gpio_request_one (TEGRA_WIFI_PWRN ,GPIOF_OUT_INIT_HIGH , +"wifi pwrn" ); +if (ret) { +pr_warning ("WIFI: could not requestrfkill gpio\n" ); +return ; + } +gpio_export (TEGRA_WIFI_PWRN ,0 ); +}; +static void __init tegra_paz00_init (void ) {tegra_clk_init_from_table (paz00_clk_init_table);
@@ -178,6 +193,7 @@ static void __init tegra_paz00_init(void)paz00_i2c_init ();paz00_usb_init (); +paz00_wifi_init (); }MACHINE_START (PAZ00 ,"Toshiba AC100 / Dynabook AZ" )
arch/arm/mach-tegra/board-paz00.h +6 -0
@@ -17,11 +17,17 @@#ifndef _MACH_TEGRA_BOARD_PAZ00_H#define _MACH_TEGRA_BOARD_PAZ00_H +/* SDCARD */ #define TEGRA_GPIO_SD1_CD TEGRA_GPIO_PV5#define TEGRA_GPIO_SD1_WP TEGRA_GPIO_PH1#define TEGRA_GPIO_SD1_POWER TEGRA_GPIO_PT3 + +/* ULPI */ #define TEGRA_ULPI_RST TEGRA_GPIO_PV0 +/* WIFI */ +#define TEGRA_WIFI_PWRN TEGRA_GPIO_PK5 +void paz00_pinmux_init (void );#endif
Signature · 1 line
1.7.4.1
PATCH 2/3 ARM: tegra: paz00: export the WIFI rfkill gpio
Quoted 2 lines · On Friday 15 July 2011 13:24:22 Marc Dietrich wrote:
This makes the WIFI rfkill gpio available to userspace. On boot, WIFI will be unblocked by default.
Take a look on rfkill-gpio driver.
Regards
Vasily
Quoted 82 lines
Signed-off-by Marc Dietrich <[email protected]>--- arch/arm/mach-tegra/board-paz00-pinmux.c | 1 + arch/arm/mach-tegra/board-paz00.c | 16 ++++++++++++++++ arch/arm/mach-tegra/board-paz00.h | 6 ++++++ 3 files changed, 23 insertions(+), 0 deletions(-)(quoted diff) +0
-0
b/arch/arm/mach-tegra/board-paz00-pinmux.cindex bdd2627..c02a48f 100644arch/arm/mach-tegra/board-paz00-pinmux.c +1
-0@@ -145,6 +145,7 @@ static struct tegra_gpio_table gpio_table[] = { { .gpio = TEGRA_GPIO_SD1_WP, .enable = true }, { .gpio = TEGRA_GPIO_SD1_POWER, .enable = true }, { .gpio = TEGRA_ULPI_RST, .enable = true }, + { .gpio = TEGRA_WIFI_PWRN, .enable = true }, };void paz00_pinmux_init (void )(quoted diff) +0
-0
b/arch/arm/mach-tegra/board-paz00.cindex 931b06e..0bc652b 100644arch/arm/mach-tegra/board-paz00.c +16
-0@@ -25,6 +25,7 @@#include <linux/dma-mapping.h> #include <linux/pda_power.h> #include <linux/io.h> +#include <linux/gpio.h> #include <linux/i2c.h> #include <linux/i2c-tegra.h> #include <linux/platform_data/tegra_usb.h> @@ -165,6 +166,20 @@ static struct tegra_sdhci_platform_data sdhci_pdata4 = { .is_8bit = 1, }; +static void __init paz00_wifi_init (void ) +{ +int ret; + +/* unlock hw rfkill */ + ret =gpio_request_one (TEGRA_WIFI_PWRN ,GPIOF_OUT_INIT_HIGH , +"wifi pwrn" ); +if (ret) { +pr_warning ("WIFI: could not requestrfkill gpio\n" ); +return ; + } +gpio_export (TEGRA_WIFI_PWRN ,0 ); +}; +static void __init tegra_paz00_init (void ) {tegra_clk_init_from_table (paz00_clk_init_table);@@ -178,6 +193,7 @@ static void __init tegra_paz00_init(void)paz00_i2c_init ();paz00_usb_init (); +paz00_wifi_init (); }MACHINE_START (PAZ00 ,"Toshiba AC100 / Dynabook AZ" )(quoted diff) +0
-0
b/arch/arm/mach-tegra/board-paz00.hindex d4ff39d..5d2849e 100644arch/arm/mach-tegra/board-paz00.h +6
-0@@ -17,11 +17,17 @@#ifndef _MACH_TEGRA_BOARD_PAZ00_H#define _MACH_TEGRA_BOARD_PAZ00_H +/* SDCARD */ #define TEGRA_GPIO_SD1_CD TEGRA_GPIO_PV5#define TEGRA_GPIO_SD1_WP TEGRA_GPIO_PH1#define TEGRA_GPIO_SD1_POWER TEGRA_GPIO_PT3 + +/* ULPI */ #define TEGRA_ULPI_RST TEGRA_GPIO_PV0 +/* WIFI */ +#define TEGRA_WIFI_PWRN TEGRA_GPIO_PK5 +void paz00_pinmux_init (void );#endif
PATCH 2/3 ARM: tegra: paz00: export the WIFI rfkill gpio
Hi Vasily,
Quoted 5 lines · On Friday 15 July 2011 14:17:02 Vasily Khoruzhick wrote:
Quoted 2 lines · On Friday 15 July 2011 13:24:22 Marc Dietrich wrote:
This makes the WIFI rfkill gpio available to userspace. On boot, WIFI will be unblocked by default.
Take a look on rfkill-gpio driver.
mmh, seems I don't understand that driver. I made a simple patch which roughly goes like this:
arch/arm/mach-tegra/board- renamed from arch/arm/mach-tegra/board-paz00.c +0 -0
paz00.c
index e85711f..06b3089 100644
arch/arm/mach-tegra/board-paz00.c +1 -0
@@ -27,6 +27,7 @@#include <linux/io.h> #include <linux/i2c.h> #include <linux/i2c-tegra.h> +#include <linux/rfkill-gpio.h> #include <linux/platform_data/tegra_usb.h> #include <asm/mach-types.h>
...
+static struct rfkill_gpio_platform_data rfkill_gpio_data = {
+ .name = "rfkill-gpio",
+ .reset_gpio = TEGRA_WIFI_RST,
+ .shutdown_gpio = TEGRA_WIFI_PWRN,
+ .type = RFKILL_TYPE_WLAN,
+};
+
+static struct platform_device rfkill_gpio = {
+ .name = "rfkill_gpio",
+ .id = -1,
+ .dev = {
+ .platform_data = &rfkill_gpio_data,+ },
+};
+
@@ -327,6 +343,7 @@ static struct platform_device *paz00_devices[] __initdata =
{
&tegra_spi_device3,
&tegra_spi_device4,
&leds_gpio,
+ &rfkill_gpio,
&tegra_gart_device,
&tegra_i2s_device1,
&tegra_das_device,now I get two rfkill devices:
root at ac100:/sys/devices/platform/rfkill_gpio/rfkill/rfkill0# rfkill list; echo 0
Quoted 1 line
state; sleep 5; rfkill list; echo 1 > state; sleep 5; rfkill list
0: rfkill-gpio: Wireless LAN
Soft blocked: no
Hard blocked: no
1: phy0: Wireless LAN
Soft blocked: no
Hard blocked: no
0: rfkill-gpio: Wireless LAN
Soft blocked: yes
Hard blocked: no
1: phy0: Wireless LAN
Soft blocked: no
Hard blocked: yes
0: rfkill-gpio: Wireless LAN
Soft blocked: no
Hard blocked: no
1: phy0: Wireless LAN
Soft blocked: no
Hard blocked: no
writing echo 1 > state is equal to rfkill block 0, while rfkill block 1 seems to be the softblock of phy0.
Is it possible that the gpios (rst and pwrn) are exchanged?
Why do I get two devices: rfkill-gpio from rfkill-gpio driver and phy0 from the wifi driver? I guess the latter shows the current state of the chip and the first? The state of the "switch"?
Thanks
Marc
Quoted 106 lines
Regards
VasilyQuoted 103 lines
Signed-off-by Marc Dietrich <[email protected]>---
arch/arm/mach-tegra/board-paz00-pinmux.c | 1 + arch/arm/mach-tegra/board-paz00.c | 16 ++++++++++++++++ arch/arm/mach-tegra/board-paz00.h | 6 ++++++ 3 files changed, 23 insertions(+), 0 deletions(-)(quoted diff) +0
-0
b/arch/arm/mach-tegra/board-paz00-pinmux.cindex bdd2627..c02a48f 100644arch/arm/mach-tegra/board-paz00-pinmux.c +1
-0@@ -145,6 +145,7 @@ static struct tegra_gpio_table gpio_table[] = { { .gpio = TEGRA_GPIO_SD1_WP, .enable = true }, { .gpio = TEGRA_GPIO_SD1_POWER, .enable = true }, { .gpio = TEGRA_ULPI_RST, .enable = true }, + { .gpio = TEGRA_WIFI_PWRN, .enable = true },};
void
paz00_pinmux_init(void)(quoted diff) +0
-0
b/arch/arm/mach-tegra/board-paz00.cindex 931b06e..0bc652b 100644arch/arm/mach-tegra/board-paz00.c +1
-0@@ -25,6 +25,7 @@#include <linux/dma-mapping.h> #include <linux/pda_power.h> #include <linux/io.h> +#include <linux/gpio.h> #include <
linux/i2c.h>
#include <linux/i2c-tegra.h>
#include <linux/platform_data/tegra_usb.h>arch/arm/mach-tegra/board-paz00.c +14
-0@@ -165,6 +166,20 @@ static struct tegra_sdhci_platform_data sdhci_pdata4 = { .is_8bit =1 , }; +static void __init paz00_wifi_init (void ) +{ +int ret; + +/* unlock hw rfkill */ + ret =gpio_request_one (TEGRA_WIFI_PWRN ,GPIOF_OUT_INIT_HIGH , +"wifi pwrn" ); +if (ret) { +pr_warning ("WIFI: could not requestrfkill gpio\n" ); +return ; + } +gpio_export (TEGRA_WIFI_PWRN ,0 ); +}; +static void __init tegra_paz00_init (void ){
arch/arm/mach-tegra/board-paz00.c +1
-0tegra_clk_init_from_table (paz00_clk_init_table);@@ -178,6 +193,7 @@ static void __init tegra_paz00_init(void)paz00_i2c_init ();paz00_usb_init (); +paz00_wifi_init (); }
MACHINE_START(PAZ00, "Toshiba AC100 / Dynabook AZ")(quoted diff) +0
-0
b/arch/arm/mach-tegra/board-paz00.hindex d4ff39d..5d2849e 100644arch/arm/mach-tegra/board-paz00.h +6
-0@@ -17,11 +17,17 @@#ifndef _MACH_TEGRA_BOARD_PAZ00_H#define _MACH_TEGRA_BOARD_PAZ00_H +/* SDCARD */ #define TEGRA_GPIO_SD1_CD TEGRA_GPIO_PV5#define TEGRA_GPIO_SD1_WP TEGRA_GPIO_PH1#define TEGRA_GPIO_SD1_POWER TEGRA_GPIO_PT3 + +/* ULPI */ #define TEGRA_ULPI_RST TEGRA_GPIO_PV0 +/* WIFI */ +#define TEGRA_WIFI_PWRN TEGRA_GPIO_PK5 +void paz00_pinmux_init (void );#endif
PATCH 2/3 ARM: tegra: paz00: export the WIFI rfkill gpio
In reply to Marc DietrichMarc Dietrich wrote at Friday, July 15, 2011 4:24 AM:
Quoted 2 lines
This makes the WIFI rfkill gpio available to userspace. On boot, WIFI will be unblocked by default.
...
arch/arm/mach-tegra/board-paz00.c static struct tegra_sdhci_platform_data sdhci_pdata4 = { · line 181
Quoted 13 lines
arch/arm/mach-tegra/board-paz00.c +13
-0+static void __init paz00_wifi_init (void ) +{ +int ret; + +/* unlock hw rfkill */ + ret =gpio_request_one (TEGRA_WIFI_PWRN ,GPIOF_OUT_INIT_HIGH , +"wifi pwrn" ); +if (ret) { +pr_warning ("WIFI: could not requestrfkill gpio\n" ); +return ; + } +gpio_export (TEGRA_WIFI_PWRN ,0 ); +};
Wouldn't you want to skip the gpio_export() call if the gpio_request() call failed?
Of course, this is moot since Vasily mentioned the gpio-rfkill driver. Luckily, that driver is already in Tegra's for-next, so it should be pretty easy to adapt to.
Signature · 1 line
nvpublic
PATCH 2/3 ARM: tegra: paz00: export the WIFI rfkill gpio
Hello.
Quoted 19 lines · Stephen Warren
Quoted 2 lines
This makes the WIFI rfkill gpio available to userspace. On boot, WIFI will be unblocked by default.
...
arch/arm/mach-tegra/board-paz00.c static struct tegra_sdhci_platform_data sdhci_pdata4 = { · line 181
Quoted 13 lines
arch/arm/mach-tegra/board-paz00.c +13
-0+static void __init paz00_wifi_init (void ) +{ +int ret; + +/* unlock hw rfkill */ + ret =gpio_request_one (TEGRA_WIFI_PWRN ,GPIOF_OUT_INIT_HIGH , +"wifi pwrn" ); +if (ret) { +pr_warning ("WIFI: could not requestrfkill gpio\n" ); +return ; + } +gpio_export (TEGRA_WIFI_PWRN ,0 ); +};Wouldn't you want to skip the
gpio_export()call if thegpio_request()call failed?
I think that's what he does -- there's a *return* statement.
WBR, Sergei
PATCH 2/3 ARM: tegra: paz00: export the WIFI rfkill gpio
Sergei Shtylyov wrote at Friday, July 15, 2011 11:25 AM:
Quoted 22 lines
Quoted 19 lines · Stephen Warren
Quoted 2 lines
This makes the WIFI rfkill gpio available to userspace. On boot, WIFI will be unblocked by default.
...
arch/arm/mach-tegra/board-paz00.c static struct tegra_sdhci_platform_data sdhci_pdata4 = { · line 181
Quoted 13 lines
arch/arm/mach-tegra/board-paz00.c +13
-0+static void __init paz00_wifi_init (void ) +{ +int ret; + +/* unlock hw rfkill */ + ret =gpio_request_one (TEGRA_WIFI_PWRN ,GPIOF_OUT_INIT_HIGH , +"wifi pwrn" ); +if (ret) { +pr_warning ("WIFI: could not requestrfkill gpio\n" ); +return ; + } +gpio_export (TEGRA_WIFI_PWRN ,0 ); +};Wouldn't you want to skip the
gpio_export()call if thegpio_request()call failed?
Quoted 1 line
I think that's what he does -- there's a *return* statement.
D'oh. There is indeed. For some reason I only noticed the warning call. I guess I suck at reviews:-(
Signature · 1 line
nvpublic
PATCH 3/3 ARM: tegra: paz00: enable wifi led
In reply to Marc DietrichThis adds support for the wifi led. It is automaticly triggered by the rfkill0 event.
--- arch/arm/mach-tegra/board-paz00-pinmux.c | 1 + arch/arm/mach-tegra/board-paz00.c | 23 +++++++++++++++++++++++ arch/arm/mach-tegra/board-paz00.h | 1 + 3 files changed, 25 insertions(+), 0 deletions(-)
arch/arm/mach-tegra/board-paz00-pinmux.c +1 -0
@@ -146,6 +146,7 @@ static struct tegra_gpio_table gpio_table[] = { { .gpio = TEGRA_GPIO_SD1_POWER, .enable = true }, { .gpio = TEGRA_ULPI_RST, .enable = true }, { .gpio = TEGRA_WIFI_PWRN, .enable = true }, + { .gpio = TEGRA_WIFI_LED, .enable = true }, };void paz00_pinmux_init (void )
arch/arm/mach-tegra/board-paz00.c +23 -0
@@ -26,6 +26,7 @@#include <linux/pda_power.h> #include <linux/io.h> #include <linux/gpio.h> +#include <linux/leds.h> #include <linux/i2c.h> #include <linux/i2c-tegra.h> #include <linux/platform_data/tegra_usb.h>
@@ -79,8 +80,30 @@ static struct platform_device debug_uart = { }, }; +static struct gpio_led gpio_leds[] = { + { + .name ="wifi-led" , + .default_trigger ="rfkill0" , + .gpio =TEGRA_WIFI_LED , + }, +}; + +static struct gpio_led_platform_data gpio_led_info = { + .leds = gpio_leds, + .num_leds =ARRAY_SIZE (gpio_leds), +}; + +static struct platform_device leds_gpio = { + .name ="leds-gpio" , + .id =-1 , + .dev = { + .platform_data = &gpio_led_info, + }, +}; +static struct platform_device *paz00_devices[]__initdata = { &debug_uart, + &leds_gpio, &tegra_sdhci_device1, &tegra_sdhci_device4, };
arch/arm/mach-tegra/board-paz00.h +1 -0
@@ -27,6 +27,7 @@/* WIFI */ #define TEGRA_WIFI_PWRN TEGRA_GPIO_PK5 +#define TEGRA_WIFI_LED TEGRA_GPIO_PD0void paz00_pinmux_init (void );
Signature · 1 line
1.7.4.1
PATCH 3/3 ARM: tegra: paz00: enable wifi led
Marc Dietrich wrote at Friday, July 15, 2011 4:24 AM:
Quoted 2 lines
This adds support for the wifi led. It is automaticly triggered by the rfkill0 event.
...
arch/arm/mach-tegra/board-paz00.c static struct platform_device debug_uart = { · line 89
Quoted 7 lines
arch/arm/mach-tegra/board-paz00.c +7
-0+static struct gpio_led gpio_leds[] = { + { + .name ="wifi-led" , + .default_trigger ="rfkill0" , + .gpio =TEGRA_WIFI_LED , + }, +};
How does this work given that the previous patch simply exports the actual GPIO to user-space, rather than registering it through an rfkill driver; Does the WiFi driver itself register directly with the rfkill system?
(what model of device is the AC100's WiFi? I assume it's on USB.)
Signature · 1 line
nvpublic
PATCH 3/3 ARM: tegra: paz00: enable wifi led
Am Fri, 15 Jul 2011 10:10:28 -0700
schrieb Stephen Warren <[email protected]>:
Quoted 4 lines
Marc Dietrich wrote at Friday, July 15, 2011 4:24 AM:
Quoted 2 lines
This adds support for the wifi led. It is automaticly triggered by the rfkill0 event.
...
Quoted 12 lines
arch/arm/mach-tegra/board-paz00.c static struct platform_device debug_uart = { · line 89
Quoted 7 lines
arch/arm/mach-tegra/board-paz00.c +7
-0+static struct gpio_led gpio_leds[] = { + { + .name ="wifi-led" , + .default_trigger ="rfkill0" , + .gpio =TEGRA_WIFI_LED , + }, +};How does this work given that the previous patch simply exports the actual GPIO to user-space, rather than registering it through an rfkill driver; Does the WiFi driver itself register directly with the rfkill system?
I don't know the details but the driver seems to register some rfkill poll routine which reports the hw status back to the mac layer. I guess from there the rfkill events are distributed. At least the led works fine here (and acts upon rfkill block). Problem is that the even binds to the first device registered to if you plug in some other network device which is registered first, then the led will act upon this one. Don't know how to bind it to a specific device.
Quoted 1 line
(what model of device is the AC100's WiFi? I assume it's on USB.)
yes, it's a rt3070 (check the rt2x00 driver).
Marc