2 * Platform glue data for ST-Ericsson CW1200 driver
4 * Copyright (c) 2013, Sagrad, Inc
5 * Author: Solomon Peachy <speachy@sagrad.com>
7 * This program is free software; you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License version 2 as
9 * published by the Free Software Foundation.
12 #include <linux/module.h>
13 #include <linux/cw1200_platform.h>
15 MODULE_AUTHOR("Solomon Peachy <speachy@sagrad.com>");
16 MODULE_DESCRIPTION("ST-Ericsson CW1200 Platform glue driver");
17 MODULE_LICENSE("GPL");
19 /* Define just one of these. Feel free to customize as needed */
20 #define SAGRAD_1091_1098_EVK_SDIO
21 /* #define SAGRAD_1091_1098_EVK_SPI */
23 #ifdef SAGRAD_1091_1098_EVK_SDIO
25 static struct resource cw1200_href_resources
[] = {
27 .start
= 215, /* fix me as appropriate */
28 .end
= 215, /* ditto */
29 .flags
= IORESOURCE_IO
,
30 .name
= "cw1200_wlan_reset",
33 .start
= 216, /* fix me as appropriate */
34 .end
= 216, /* ditto */
35 .flags
= IORESOURCE_IO
,
36 .name
= "cw1200_wlan_powerup",
39 .start
= NOMADIK_GPIO_TO_IRQ(216), /* fix me as appropriate */
40 .end
= NOMADIK_GPIO_TO_IRQ(216), /* ditto */
41 .flags
= IORESOURCE_IRQ
,
42 .name
= "cw1200_wlan_irq",
47 static int cw1200_power_ctrl(const struct cw1200_platform_data_sdio
*pdata
,
50 /* Control 3v3 and 1v8 to hardware as appropriate */
51 /* Note this is not needed if it's controlled elsewhere or always on */
53 /* May require delay for power to stabilize */
57 static int cw1200_clk_ctrl(const struct cw1200_platform_data_sdio
*pdata
,
60 /* Turn CLK_32K off and on as appropriate. */
61 /* Note this is not needed if it's always on */
63 /* May require delay for clock to stabilize */
67 static struct cw1200_platform_data_sdio cw1200_platform_data
= {
71 .reset
= &cw1200_href_resources
[0],
72 .powerup
= &cw1200_href_resources
[1],
73 .irq
= &cw1200_href_resources
[2],
75 .power_ctrl
= cw1200_power_ctrl
,
76 .clk_ctrl
= cw1200_clk_ctrl
,
78 .sdd_file
= "sdd_sagrad_1091_1098.bin",
82 #ifdef SAGRAD_1091_1098_EVK_SPI
83 /* Note that this is an example of integrating into your board support file */
84 static struct resource cw1200_href_resources
[] = {
86 .start
= GPIO_RF_RESET
,
88 .flags
= IORESOURCE_IO
,
89 .name
= "cw1200_wlan_reset",
92 .start
= GPIO_RF_POWERUP
,
93 .end
= GPIO_RF_POWERUP
,
94 .flags
= IORESOURCE_IO
,
95 .name
= "cw1200_wlan_powerup",
99 static int cw1200_power_ctrl(const struct cw1200_platform_data_spi
*pdata
,
102 /* Control 3v3 and 1v8 to hardware as appropriate */
103 /* Note this is not needed if it's controlled elsewhere or always on */
105 /* May require delay for power to stabilize */
108 static int cw1200_clk_ctrl(const struct cw1200_platform_data_spi
*pdata
,
111 /* Turn CLK_32K off and on as appropriate. */
112 /* Note this is not needed if it's always on */
114 /* May require delay for clock to stabilize */
118 static struct cw1200_platform_data_spi cw1200_platform_data
= {
120 .spi_bits_per_word
= 16,
121 .reset
= &cw1200_href_resources
[0],
122 .powerup
= &cw1200_href_resources
[1],
123 .power_ctrl
= cw1200_power_ctrl
,
124 .clk_ctrl
= cw1200_clk_ctrl
,
126 .sdd_file
= "sdd_sagrad_1091_1098.bin",
128 static struct spi_board_info myboard_spi_devices
[] __initdata
= {
130 .modalias
= "cw1200_wlan_spi",
131 .max_speed_hz
= 10000000, /* 52MHz Max */
134 .platform_data
= &cw1200_platform_data
,
141 const void *cw1200_get_platform_data(void)
143 return &cw1200_platform_data
;
145 EXPORT_SYMBOL_GPL(cw1200_get_platform_data
);