Skip to content

Commit

Permalink
Update wilc3000 driver for SPI
Browse files Browse the repository at this point in the history
  • Loading branch information
globalgang committed Oct 22, 2015
1 parent 23f4e9e commit 63b7b9c
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 6 deletions.
2 changes: 1 addition & 1 deletion wilc3000/linux_wlan.c
Original file line number Diff line number Diff line change
Expand Up @@ -534,7 +534,7 @@ static int init_irq(struct linux_wlan *p_nic)
if ((gpio_request(GPIO_NUM, "WILC_INTR") == 0) &&
(gpio_direction_input(GPIO_NUM) == 0)) {
gpio_export(GPIO_NUM, 1);
nic->dev_irq_num = OMAP_GPIO_IRQ(GPIO_NUM);
nic->dev_irq_num = gpio_to_irq(GPIO_NUM);
irq_set_irq_type(nic->dev_irq_num, IRQ_TYPE_LEVEL_LOW);
} else {
ret = -1;
Expand Down
12 changes: 12 additions & 0 deletions wilc3000/linux_wlan_common.h
Original file line number Diff line number Diff line change
Expand Up @@ -89,5 +89,17 @@ enum debug_region{
#define GPIO_NUM 139
#endif /* PANDA_BOARD */

#if defined(PLAT_SAMA5D4)
#define MODALIAS "wilc_spi"
#define GPIO_NUM 46
#define MIN_SPEED 24000000
#endif

#if defined(PLAT_SAMA5D3)
#define MODALIAS "wilc_spi"
#define GPIO_NUM 68
#define MIN_SPEED 24000000
#endif

int linux_wlan_get_num_conn_ifcs(void);
#endif /* LINUX_WLAN_COMMON_H */
17 changes: 12 additions & 5 deletions wilc3000/linux_wlan_spi.c
Original file line number Diff line number Diff line change
Expand Up @@ -50,12 +50,19 @@ static int wilc_bus_remove(struct spi_device *spi)
return 0;
}

static const struct of_device_id wilc3000_of_match[] = {
{ .compatible = "atmel,wilc_spi", },
{}
};

MODULE_DEVICE_TABLE(of, wilc3000_of_match);
struct spi_driver wilc_bus __refdata = {
.driver = {
.name = MODALIAS,
},
.probe = wilc_bus_probe,
.remove = __devexit_p(wilc_bus_remove),
.driver = {
.name = MODALIAS,
.of_match_table = wilc3000_of_match,
},
.probe = wilc_bus_probe,
.remove = __exit_p(wilc_bus_remove),
};

void linux_spi_deinit(void *vp)
Expand Down

0 comments on commit 63b7b9c

Please sign in to comment.