From patchwork Tue Dec 7 14:52:02 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Cyril Chemparathy X-Patchwork-Id: 383302 Received: from bear.ext.ti.com (bear.ext.ti.com [192.94.94.41]) by demeter1.kernel.org (8.14.4/8.14.3) with ESMTP id oB7EvaLW012853 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Tue, 7 Dec 2010 14:57:58 GMT Received: from dlep33.itg.ti.com ([157.170.170.112]) by bear.ext.ti.com (8.13.7/8.13.7) with ESMTP id oB7EuEY1014951 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Tue, 7 Dec 2010 08:56:14 -0600 Received: from linux.omap.com (localhost [127.0.0.1]) by dlep33.itg.ti.com (8.13.7/8.13.7) with ESMTP id oB7EuCHY017639; Tue, 7 Dec 2010 08:56:13 -0600 (CST) Received: from linux.omap.com (localhost [127.0.0.1]) by linux.omap.com (Postfix) with ESMTP id 4DE9280647; Tue, 7 Dec 2010 08:55:02 -0600 (CST) X-Original-To: davinci-linux-open-source@linux.davincidsp.com Delivered-To: davinci-linux-open-source@linux.davincidsp.com Received: from dlep33.itg.ti.com (dlep33.itg.ti.com [157.170.170.112]) by linux.omap.com (Postfix) with ESMTP id C52F480631 for ; Tue, 7 Dec 2010 08:52:11 -0600 (CST) Received: from legion.dal.design.ti.com (localhost [127.0.0.1]) by dlep33.itg.ti.com (8.13.7/8.13.7) with ESMTP id oB7EqAIV013665; Tue, 7 Dec 2010 08:52:10 -0600 (CST) Received: from gtrgwdeb (gtrgwdeb.telogy.design.ti.com [158.218.102.24]) by legion.dal.design.ti.com (8.11.7p1+Sun/8.11.7) with ESMTP id oB7Eq9f10876; Tue, 7 Dec 2010 08:52:09 -0600 (CST) Received: by gtrgwdeb (Postfix, from userid 39959) id 948701E1CFA; Tue, 7 Dec 2010 09:52:08 -0500 (EST) From: Cyril Chemparathy To: davinci-linux-open-source@linux.davincidsp.com, spi-devel-general@lists.sourceforge.net, sameo@linux.intel.com, lrg@slimlogic.co.uk, broonie@opensource.wolfsonmicro.com, rpurdie@rpsys.net, linux-arm-kernel@lists.infradead.org Subject: [PATCH v7 12/12] davinci: add tnetv107x evm i2c eeprom device Date: Tue, 7 Dec 2010 09:52:02 -0500 Message-Id: <1291733522-3626-13-git-send-email-cyril@ti.com> X-Mailer: git-send-email 1.7.1 In-Reply-To: <1291733522-3626-1-git-send-email-cyril@ti.com> References: <1291733522-3626-1-git-send-email-cyril@ti.com> Cc: dbrownell@users.sourceforge.net, linus.ml.walleij@gmail.com, grant.likely@secretlab.ca, akpm@linux-foundation.org, alan@lxorguk.ukuu.org.uk X-BeenThere: davinci-linux-open-source@linux.davincidsp.com X-Mailman-Version: 2.1.12 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: davinci-linux-open-source-bounces@linux.davincidsp.com Errors-To: davinci-linux-open-source-bounces@linux.davincidsp.com X-Greylist: Sender succeeded STARTTLS authentication, not delayed by milter-greylist-4.2.3 (demeter1.kernel.org [140.211.167.41]); Tue, 07 Dec 2010 14:57:58 +0000 (UTC) diff --git a/arch/arm/mach-davinci/board-tnetv107x-evm.c b/arch/arm/mach-davinci/board-tnetv107x-evm.c index ac62de2..869af15 100644 --- a/arch/arm/mach-davinci/board-tnetv107x-evm.c +++ b/arch/arm/mach-davinci/board-tnetv107x-evm.c @@ -29,6 +29,9 @@ #include #include #include +#include +#include +#include #include #include @@ -44,6 +47,8 @@ #define EVM_MMC_WP_GPIO 21 #define EVM_MMC_CD_GPIO 24 #define EVM_SPI_CS_GPIO 54 +#define EVM_I2C_SDA_GPIO (SSP_GPIO_START + 0) +#define EVM_I2C_SCL_GPIO (SSP_GPIO_START + 1) #define EVM_BACKLIGHT_GPIO (SSP_GPIO_START + 2) static int initialize_gpio(int gpio, char *desc) @@ -360,6 +365,29 @@ static struct platform_device backlight_device = { .dev.platform_data = (void *)EVM_BACKLIGHT_GPIO, }; +struct i2c_gpio_platform_data i2c_data = { + .sda_pin = EVM_I2C_SDA_GPIO, + .scl_pin = EVM_I2C_SCL_GPIO, +}; + +static struct platform_device i2c_device = { + .name = "i2c-gpio", + .id = 0, + .dev.platform_data = &i2c_data, +}; + +static struct at24_platform_data at24_config = { + .byte_len = SZ_16K / 8, + .page_size = 16, +}; + +static struct i2c_board_info i2c_info[] __initconst = { + { + I2C_BOARD_INFO("24c16", 0x50), + .platform_data = &at24_config, + }, +}; + static __init void tnetv107x_evm_board_init(void) { davinci_cfg_reg_list(sdio1_pins); @@ -369,11 +397,13 @@ static __init void tnetv107x_evm_board_init(void) tnetv107x_devices_init(&evm_device_info); spi_register_board_info(spi_info, ARRAY_SIZE(spi_info)); + i2c_register_board_info(0, i2c_info, ARRAY_SIZE(i2c_info)); } static int __init tnetv107x_evm_late_init(void) { platform_device_register(&backlight_device); + platform_device_register(&i2c_device); return 0; } late_initcall(tnetv107x_evm_late_init);