Back to home page

OSCL-LXR

 
 

    


0001 /* SPDX-License-Identifier: GPL-2.0-only */
0002 /*
0003  * Copyright (C) ST-Ericsson SA 2011
0004  *
0005  * Author: Dmitry Tarnyagin <dmitry.tarnyagin@stericsson.com>
0006  */
0007 
0008 #ifndef CW1200_PLAT_H_INCLUDED
0009 #define CW1200_PLAT_H_INCLUDED
0010 
0011 struct cw1200_platform_data_spi {
0012     u8 spi_bits_per_word;           /* REQUIRED */
0013     u16 ref_clk;                    /* REQUIRED (in KHz) */
0014 
0015     /* All others are optional */
0016     bool have_5ghz;
0017     int reset;                     /* GPIO to RSTn signal (0 disables) */
0018     int powerup;                   /* GPIO to POWERUP signal (0 disables) */
0019     int (*power_ctrl)(const struct cw1200_platform_data_spi *pdata,
0020               bool enable); /* Control 3v3 / 1v8 supply */
0021     int (*clk_ctrl)(const struct cw1200_platform_data_spi *pdata,
0022             bool enable); /* Control CLK32K */
0023     const u8 *macaddr;  /* if NULL, use cw1200_mac_template module parameter */
0024     const char *sdd_file;  /* if NULL, will use default for detected hw type */
0025 };
0026 
0027 struct cw1200_platform_data_sdio {
0028     u16 ref_clk;                    /* REQUIRED (in KHz) */
0029 
0030     /* All others are optional */
0031     bool have_5ghz;
0032     bool no_nptb;       /* SDIO hardware does not support non-power-of-2-blocksizes */
0033     int reset;          /* GPIO to RSTn signal (0 disables) */
0034     int powerup;        /* GPIO to POWERUP signal (0 disables) */
0035     int irq;            /* IRQ line or 0 to use SDIO IRQ */
0036     int (*power_ctrl)(const struct cw1200_platform_data_sdio *pdata,
0037               bool enable); /* Control 3v3 / 1v8 supply */
0038     int (*clk_ctrl)(const struct cw1200_platform_data_sdio *pdata,
0039             bool enable); /* Control CLK32K */
0040     const u8 *macaddr;  /* if NULL, use cw1200_mac_template module parameter */
0041     const char *sdd_file;  /* if NULL, will use default for detected hw type */
0042 };
0043 
0044 
0045 /* An example of SPI support in your board setup file:
0046 
0047    static struct cw1200_platform_data_spi cw1200_platform_data = {
0048        .ref_clk = 38400,
0049        .spi_bits_per_word = 16,
0050        .reset = GPIO_RF_RESET,
0051        .powerup = GPIO_RF_POWERUP,
0052        .macaddr = wifi_mac_addr,
0053        .sdd_file = "sdd_sagrad_1091_1098.bin",
0054   };
0055   static struct spi_board_info myboard_spi_devices[] __initdata = {
0056        {
0057                .modalias = "cw1200_wlan_spi",
0058                .max_speed_hz = 52000000,
0059                .bus_num = 0,
0060                .irq = WIFI_IRQ,
0061                .platform_data = &cw1200_platform_data,
0062                .chip_select = 0,
0063        },
0064   };
0065 
0066  */
0067 
0068 /* An example of SDIO support in your board setup file:
0069 
0070   static struct cw1200_platform_data_sdio my_cw1200_platform_data = {
0071     .ref_clk = 38400,
0072     .have_5ghz = false,
0073     .sdd_file = "sdd_myplatform.bin",
0074   };
0075   cw1200_sdio_set_platform_data(&my_cw1200_platform_data);
0076 
0077  */
0078 
0079 void __init cw1200_sdio_set_platform_data(struct cw1200_platform_data_sdio *pdata);
0080 
0081 #endif /* CW1200_PLAT_H_INCLUDED */