diff options
author | Sascha Hauer <s.hauer@pengutronix.de> | 2009-05-11 17:29:53 +0200 |
---|---|---|
committer | Sascha Hauer <s.hauer@pengutronix.de> | 2009-06-23 13:16:27 +0200 |
commit | 45ca9eefe2b8f8218e944c8ddbf1f1e12604d816 (patch) | |
tree | 8d4558d39e79d46c244fb4dd73bf4d6a0d63a619 | |
parent | f4c5894f890a689ec78acf586996c6fc072e175a (diff) | |
download | linux-2.6-45ca9eefe2b8f8218e944c8ddbf1f1e12604d816.tar.gz linux-2.6-45ca9eefe2b8f8218e944c8ddbf1f1e12604d816.tar.xz |
pcm043: Add SPI EEPROM
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
-rw-r--r-- | arch/arm/mach-mx3/pcm043.c | 41 |
1 files changed, 41 insertions, 0 deletions
diff --git a/arch/arm/mach-mx3/pcm043.c b/arch/arm/mach-mx3/pcm043.c index 27e8b258893..77b6e5f3b2f 100644 --- a/arch/arm/mach-mx3/pcm043.c +++ b/arch/arm/mach-mx3/pcm043.c @@ -29,6 +29,8 @@ #include <linux/i2c.h> #include <linux/i2c/at24.h> #include <linux/fsl_devices.h> +#include <linux/spi/spi.h> +#include <linux/spi/eeprom.h> #include <asm/mach-types.h> #include <asm/mach/arch.h> @@ -43,6 +45,7 @@ #include <mach/ipu.h> #include <mach/mx3fb.h> #include <mach/mxc_ehci.h> +#include <mach/spi.h> #include "devices.h" @@ -205,6 +208,11 @@ static struct pad_desc pcm043_pads[] = { /* USB host */ MX35_PAD_I2C2_CLK__USB_TOP_USBH2_PWR, MX35_PAD_I2C2_DAT__USB_TOP_USBH2_OC, + /* SPI2 */ + MX35_PAD_SCK5__CSPI2_SCLK, + MX35_PAD_STXD5__CSPI2_MOSI, + MX35_PAD_SRXD5__CSPI2_MISO, + MX35_PAD_HCKR__GPIO1_6, }; static int pcm043_usbh1_init(struct platform_device *pdev) @@ -267,6 +275,32 @@ static int __init pcm043_otg_mode(char *options) } __setup("pcm043_otg_mode=", pcm043_otg_mode); +#ifdef CONFIG_SPI +static struct spi_eeprom at25320 = { + .name = "at25320an", + .byte_len = 4096, + .page_size = 32, + .flags = EE_ADDR2, +}; + +static unsigned int pcm043_spi_cs[] = {6, }; + +static struct spi_imx_master pcm043_spi_0_data = { + .chipselect = pcm043_spi_cs, + .num_chipselect = ARRAY_SIZE(pcm043_spi_cs), +}; + +static struct spi_board_info pcm043_spi_board_info[] __initdata = { + { + .modalias = "at25", + .max_speed_hz = 300000, + .bus_num = 1, + .chip_select = 0, + .platform_data = &at25320, + } +}; +#endif /* CONFIG_SPI */ + /* * Board specific initialization. */ @@ -300,6 +334,13 @@ static void __init mxc_board_init(void) mxc_register_device(&mxc_otg, &otg_pdata); else mxc_register_device(&mxc_otg_udc_device, &usb_data); + +#ifdef CONFIG_SPI + mxc_register_device(&imx_spi_device1, &pcm043_spi_0_data); + + spi_register_board_info(pcm043_spi_board_info, + ARRAY_SIZE(pcm043_spi_board_info)); +#endif } static void __init pcm043_timer_init(void) |