@@ -34,12 +34,6 @@ struct wand_rfkill_data {
34
34
const char * shutdown_name ;
35
35
};
36
36
37
- /*struct wand_rfkill_data {
38
- struct rfkill *wifi_rfkill_dev, *bt_rfkill_dev;
39
- int wifi_shutdown_gpio, bt_shutdown_gpio;
40
- const char *wifi_shutdown_name, bt_shutdown_name;
41
- };*/
42
-
43
37
static int wand_rfkill_set_block (void * data , bool blocked )
44
38
{
45
39
struct wand_rfkill_data * rfkill = data ;
@@ -63,13 +57,21 @@ static const struct rfkill_ops wand_rfkill_ops = {
63
57
64
58
static int wand_rfkill_wifi_probe (struct device * dev ,
65
59
struct device_node * np ,
66
- struct wand_rfkill_data * rfkill )
60
+ struct wand_rfkill_data * rfkill ,
61
+ int wand_rev )
67
62
{
68
63
int ret ;
69
64
int wl_ref_on , wl_rst_n , wl_reg_on , wl_wake , wl_host_wake ;
70
65
71
- wl_ref_on = of_get_named_gpio (np , "wifi-ref-on" , 0 );
72
- wl_rst_n = of_get_named_gpio (np , "wifi-rst-n" , 0 );
66
+ if (wand_rev ){
67
+ wl_ref_on = of_get_named_gpio (np , "wifi-ref-on-revc1" , 0 );
68
+ wl_rst_n = of_get_named_gpio (np , "wifi-rst-n-revc1" , 0 );
69
+ }
70
+ else {
71
+ wl_ref_on = of_get_named_gpio (np , "wifi-ref-on" , 0 );
72
+ wl_rst_n = of_get_named_gpio (np , "wifi-rst-n" , 0 );
73
+ }
74
+
73
75
wl_reg_on = of_get_named_gpio (np , "wifi-reg-on" , 0 );
74
76
wl_wake = of_get_named_gpio (np , "wifi-wake" , 0 );
75
77
wl_host_wake = of_get_named_gpio (np , "wifi-host-wake" , 0 );
@@ -134,14 +136,22 @@ static int wand_rfkill_wifi_probe(struct device *dev,
134
136
135
137
static int wand_rfkill_bt_probe (struct device * dev ,
136
138
struct device_node * np ,
137
- struct wand_rfkill_data * rfkill )
139
+ struct wand_rfkill_data * rfkill ,
140
+ int wand_rev )
138
141
{
139
142
int ret ;
140
143
int bt_on , bt_wake , bt_host_wake ;
141
144
142
- bt_on = of_get_named_gpio (np , "bluetooth-on" , 0 );
143
- bt_wake = of_get_named_gpio (np , "bluetooth-wake" , 0 );
144
- bt_host_wake = of_get_named_gpio (np , "bluetooth-host-wake" , 0 );
145
+ if (wand_rev ) {
146
+ bt_on = of_get_named_gpio (np , "bluetooth-on-revc1" , 0 );
147
+ bt_wake = of_get_named_gpio (np , "bluetooth-wake-revc1" , 0 );
148
+ bt_host_wake = of_get_named_gpio (np , "bluetooth-host-wake-revc1" , 0 );
149
+ }
150
+ else {
151
+ bt_on = of_get_named_gpio (np , "bluetooth-on" , 0 );
152
+ bt_wake = of_get_named_gpio (np , "bluetooth-wake" , 0 );
153
+ bt_host_wake = of_get_named_gpio (np , "bluetooth-host-wake" , 0 );
154
+ }
145
155
146
156
if (!gpio_is_valid (bt_on ) || !gpio_is_valid (bt_wake ) ||
147
157
!gpio_is_valid (bt_host_wake )) {
@@ -240,12 +250,12 @@ static int wand_rfkill_probe(struct platform_device *pdev)
240
250
dev_info (& pdev -> dev ,"wandboard is rev B0\n" );
241
251
242
252
/* setup WiFi */
243
- ret = wand_rfkill_wifi_probe (& pdev -> dev , pdev -> dev .of_node , & rfkill [0 ]);
253
+ ret = wand_rfkill_wifi_probe (& pdev -> dev , pdev -> dev .of_node , & rfkill [0 ], wand_rev );
244
254
if (ret < 0 )
245
255
goto fail_free_rfkill ;
246
256
247
257
/* setup bluetooth */
248
- ret = wand_rfkill_bt_probe (& pdev -> dev , pdev -> dev .of_node , & rfkill [1 ]);
258
+ ret = wand_rfkill_bt_probe (& pdev -> dev , pdev -> dev .of_node , & rfkill [1 ], wand_rev );
249
259
if (ret < 0 )
250
260
goto fail_unregister_wifi ;
251
261
0 commit comments