Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Index: linux-csi-mx6/arch/arm/mach-mx6/board-mx6q_var_som.c
- ===================================================================
- --- linux-csi-mx6.orig/arch/arm/mach-mx6/board-mx6q_var_som.c
- +++ linux-csi-mx6/arch/arm/mach-mx6/board-mx6q_var_som.c
- @@ -31,6 +31,7 @@
- #include <linux/fsl_devices.h>
- #include <linux/spi/spi.h>
- #include <linux/spi/ads7846.h>
- +#include <linux/spi/nrf24.h>
- #include <linux/i2c.h>
- #include <linux/i2c/pca953x.h>
- #include <linux/ata.h>
- @@ -85,6 +86,7 @@
- */
- //#define ANDROID_NAND_RECOVERY
- +#define VAR_SOM_ECSPI1_CS1 IMX_GPIO_NR(4, 10)
- #define VAR_SOM_ECSPI3_CS0 IMX_GPIO_NR(4, 24)
- #define VAR_SOM_ADS7846_INT IMX_GPIO_NR(4, 25)
- #define VAR_SOM_ADS7846_PD IMX_GPIO_NR(4, 25)
- @@ -111,6 +113,10 @@
- #define VAR_SOM_TSC_CTW6120_IRQ_GPIO IMX_GPIO_NR(3, 7)
- +/* Needed by nRF2424L01P module */
- +#define VAR_SOM_NRF24L01P_IRQ_GPIO IMX_GPIO_NR(5, 14)
- +#define VAR_SOM_NRF24L01P_CE_GPIO IMX_GPIO_NR(4, 9)
- +
- static struct clk *sata_clk;
- static struct clk *clko;
- static int enable_lcd_ldb;
- @@ -368,10 +374,19 @@ static struct fec_platform_data fec_data
- .phy = PHY_INTERFACE_MODE_RGMII,
- };
- +static int mx6q_var_som_ecspi1_cs[] = {
- + VAR_SOM_ECSPI1_CS1,
- +};
- +
- static int mx6q_var_som_spi_cs[] = {
- VAR_SOM_ECSPI3_CS0,
- };
- +static const struct spi_imx_master mx6q_var_som_ecspi1_data __initconst = {
- + .chipselect = mx6q_var_som_ecspi1_cs,
- + .num_chipselect = ARRAY_SIZE(mx6q_var_som_ecspi1_cs),
- +};
- +
- static const struct spi_imx_master mx6q_var_som_spi_data __initconst = {
- .chipselect = mx6q_var_som_spi_cs,
- .num_chipselect = ARRAY_SIZE(mx6q_var_som_spi_cs),
- @@ -404,12 +419,31 @@ static struct spi_board_info mx6_var_som
- },
- };
- +static struct nrf24_platform_data nrf24_config = {
- + .gpio_ce = VAR_SOM_NRF24L01P_CE_GPIO,
- + .gpio_irq = VAR_SOM_NRF24L01P_IRQ_GPIO,
- +};
- +
- +static struct spi_board_info mx6_var_som_spi_nrf24[] __initdata = {
- + {
- + .modalias = "nrf24", /* nRF24L01+ */
- + .max_speed_hz = 8000000,
- + .bus_num = 0,
- + .chip_select = 1,
- + .platform_data = &nrf24_config,
- + .mode = SPI_MODE_0,
- + },
- +};
- +
- static void spi_device_init(void)
- {
- if (var_lcd_index != VAR_LCD_CTW6120) {
- spi_register_board_info(mx6_var_som_spi_ts_device,
- ARRAY_SIZE(mx6_var_som_spi_ts_device));
- }
- +
- + spi_register_board_info(mx6_var_som_spi_nrf24,
- + ARRAY_SIZE(mx6_var_som_spi_nrf24));
- }
- /* Audio
- @@ -1150,6 +1184,7 @@ static void __init mx6_var_som_board_ini
- gpio_direction_output(VAR_SOM_BACKLIGHT_EN, 1);
- /* SPI */
- + imx6q_add_ecspi(0, &mx6q_var_som_ecspi1_data);
- imx6q_add_ecspi(2, &mx6q_var_som_spi_data);
- spi_device_init();
- Index: linux-csi-mx6/arch/arm/mach-mx6/board-mx6q_var_som.h
- ===================================================================
- --- linux-csi-mx6.orig/arch/arm/mach-mx6/board-mx6q_var_som.h
- +++ linux-csi-mx6/arch/arm/mach-mx6/board-mx6q_var_som.h
- @@ -58,6 +58,15 @@ static iomux_v3_cfg_t mx6q_var_som_pads[
- MX6Q_PAD_CSI0_DAT6__AUDMUX_AUD3_TXFS,
- MX6Q_PAD_CSI0_DAT7__AUDMUX_AUD3_RXD,
- + /* SPI1 (nRF24L01P) */
- + MX6Q_PAD_KEY_COL1__ECSPI1_MISO,
- + MX6Q_PAD_KEY_ROW0__ECSPI1_MOSI,
- + MX6Q_PAD_KEY_COL0__ECSPI1_SCLK,
- +
- + MX6Q_PAD_KEY_ROW1__GPIO_4_9, /* nRF24L01P CE */
- + MX6Q_PAD_KEY_COL2__GPIO_4_10, /* nRF24L01P SS */
- + MX6Q_PAD_DISP0_DAT20__GPIO_5_14, /* nRF24L01P IRQ */
- +
- /* SPI3 (ads7846) */
- MX6Q_PAD_DISP0_DAT2__ECSPI3_MISO,
- MX6Q_PAD_DISP0_DAT1__ECSPI3_MOSI,
- @@ -125,8 +134,8 @@ static iomux_v3_cfg_t mx6q_var_som_pads[
- MX6Q_PAD_GPIO_17__GPIO_7_12,
- /* I2C1 */
- - MX6Q_PAD_CSI0_DAT8__I2C1_SDA,
- - MX6Q_PAD_CSI0_DAT9__I2C1_SCL,
- + /* MX6Q_PAD_CSI0_DAT8__I2C1_SDA, */
- + /* MX6Q_PAD_CSI0_DAT9__I2C1_SCL, */
- /* I2C2 */
- MX6Q_PAD_KEY_COL3__I2C2_SCL,
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement