From patchwork Wed May 5 07:10:22 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Abraham Arce X-Patchwork-Id: 96993 Received: from lists.sourceforge.net (lists.sourceforge.net [216.34.181.88]) by demeter.kernel.org (8.14.3/8.14.3) with ESMTP id o457AWM6008547 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO) for ; Wed, 5 May 2010 07:11:07 GMT Received: from localhost ([127.0.0.1] helo=sfs-ml-3.v29.ch3.sourceforge.com) by sfs-ml-3.v29.ch3.sourceforge.com with esmtp (Exim 4.69) (envelope-from ) id 1O9Yka-00062S-0L; Wed, 05 May 2010 07:10:32 +0000 Received: from sfi-mx-2.v28.ch3.sourceforge.com ([172.29.28.122] helo=mx.sourceforge.net) by sfs-ml-3.v29.ch3.sourceforge.com with esmtp (Exim 4.69) (envelope-from ) id 1O9YkZ-00062K-BW for spi-devel-general@lists.sourceforge.net; Wed, 05 May 2010 07:10:31 +0000 Received-SPF: pass (sfi-mx-2.v28.ch3.sourceforge.com: domain of ti.com designates 192.94.94.40 as permitted sender) client-ip=192.94.94.40; envelope-from=x0066660@ti.com; helo=arroyo.ext.ti.com; Received: from arroyo.ext.ti.com ([192.94.94.40]) by sfi-mx-2.v28.ch3.sourceforge.com with esmtps (TLSv1:AES256-SHA:256) (Exim 4.69) id 1O9YkY-0001Op-EY for spi-devel-general@lists.sourceforge.net; Wed, 05 May 2010 07:10:31 +0000 Received: from dlep34.itg.ti.com ([157.170.170.115]) by arroyo.ext.ti.com (8.13.7/8.13.7) with ESMTP id o457APpP005310 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Wed, 5 May 2010 02:10:25 -0500 Received: from dlep26.itg.ti.com (localhost [127.0.0.1]) by dlep34.itg.ti.com (8.13.7/8.13.7) with ESMTP id o457AOQ1023763; Wed, 5 May 2010 02:10:24 -0500 (CDT) Received: from dsbe71.ent.ti.com (localhost [127.0.0.1]) by dlep26.itg.ti.com (8.13.8/8.13.8) with ESMTP id o457AO6j027040; Wed, 5 May 2010 02:10:24 -0500 (CDT) Received: from dlee03.ent.ti.com ([157.170.170.18]) by dsbe71.ent.ti.com ([156.117.232.23]) with mapi; Wed, 5 May 2010 02:10:24 -0500 From: "Arce, Abraham" To: "linux-omap@vger.kernel.org" , "spi-devel-general@lists.sourceforge.net" Date: Wed, 5 May 2010 02:10:22 -0500 Thread-Topic: [PATCH v1 2/3] OMAP4: Ethernet: KS8851 Board Support Thread-Index: AcrsIgc5QY7u915IQ9ixcPLA04LYSA== Message-ID: <27F9C60D11D683428E133F85D2BB4A53043DEEB8C1@dlee03.ent.ti.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: acceptlanguage: en-US MIME-Version: 1.0 X-Spam-Score: -1.5 (-) X-Spam-Report: Spam Filtering performed by mx.sourceforge.net. See http://spamassassin.org/tag/ for more details. -1.5 SPF_CHECK_PASS SPF reports sender host as permitted sender for sender-domain -0.0 SPF_PASS SPF: sender matches SPF record X-Headers-End: 1O9YkY-0001Op-EY Subject: [spi-devel-general] [PATCH v1 2/3] OMAP4: Ethernet: KS8851 Board Support X-BeenThere: spi-devel-general@lists.sourceforge.net X-Mailman-Version: 2.1.9 Precedence: list List-Id: Linux SPI core/device drivers discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: spi-devel-general-bounces@lists.sourceforge.net X-Greylist: IP, sender and recipient auto-whitelisted, not delayed by milter-greylist-4.2.3 (demeter.kernel.org [140.211.167.41]); Wed, 05 May 2010 07:11:08 +0000 (UTC) diff --git a/arch/arm/mach-omap2/board-4430sdp.c b/arch/arm/mach-omap2/board-4430sdp.c index b88f28c..801c2a7 100644 --- a/arch/arm/mach-omap2/board-4430sdp.c +++ b/arch/arm/mach-omap2/board-4430sdp.c @@ -18,6 +18,7 @@ #include #include #include +#include #include #include @@ -32,6 +33,30 @@ #include #include +#define ETHERNET_KS8851_IRQ 34 +#define ETHERNET_KS8851_POWER_ENABLE 48 +#define ETHERNET_KS8851_QUART 138 + +static struct spi_board_info sdp4430_spi_board_info[] __initdata = { + { + .modalias = "ks8851", + .bus_num = 1, + .chip_select = 0, + .max_speed_hz = 24000000, + .irq = ETHERNET_KS8851_IRQ, + }, +}; + +static void omap_ethernet_init(void) +{ + gpio_request(ETHERNET_KS8851_POWER_ENABLE, "ethernet"); + gpio_direction_output(ETHERNET_KS8851_POWER_ENABLE, 1); + gpio_request(ETHERNET_KS8851_QUART, "quart"); + gpio_direction_output(ETHERNET_KS8851_QUART, 1); + gpio_request(ETHERNET_KS8851_IRQ, "ks8851"); + gpio_direction_input(ETHERNET_KS8851_IRQ); +} + static struct platform_device sdp4430_lcd_device = { .name = "sdp4430_lcd", .id = -1, @@ -120,6 +145,11 @@ static void __init omap_4430sdp_init(void) /* FIXME: allow multi-omap to boot until musb is updated for omap4 */ if (!cpu_is_omap44xx()) usb_musb_init(&musb_board_data); + + omap_ethernet_init(); + sdp4430_spi_board_info[0].irq = gpio_to_irq(ETHERNET_KS8851_IRQ); + spi_register_board_info(sdp4430_spi_board_info, + ARRAY_SIZE(sdp4430_spi_board_info)); } static void __init omap_4430sdp_map_io(void)