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: 96991 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by demeter.kernel.org (8.14.3/8.14.3) with ESMTP id o4579TTu008304 for ; Wed, 5 May 2010 07:10:32 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756823Ab0EEHKc (ORCPT ); Wed, 5 May 2010 03:10:32 -0400 Received: from arroyo.ext.ti.com ([192.94.94.40]:52932 "EHLO arroyo.ext.ti.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1756431Ab0EEHKb convert rfc822-to-8bit (ORCPT ); Wed, 5 May 2010 03:10:31 -0400 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 Subject: [PATCH v1 2/3] OMAP4: Ethernet: KS8851 Board Support 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 Sender: linux-omap-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-omap@vger.kernel.org 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:10:33 +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)