From patchwork Thu Apr 22 14:43:37 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Abraham Arce X-Patchwork-Id: 94133 X-Patchwork-Delegate: tony@atomide.com 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 o3MEi1hI029746 for ; Thu, 22 Apr 2010 14:44:01 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755418Ab0DVOoB (ORCPT ); Thu, 22 Apr 2010 10:44:01 -0400 Received: from arroyo.ext.ti.com ([192.94.94.40]:38942 "EHLO arroyo.ext.ti.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755415Ab0DVOoA convert rfc822-to-8bit (ORCPT ); Thu, 22 Apr 2010 10:44:00 -0400 Received: from dlep35.itg.ti.com ([157.170.170.118]) by arroyo.ext.ti.com (8.13.7/8.13.7) with ESMTP id o3MEhcgd028792 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Thu, 22 Apr 2010 09:43:38 -0500 Received: from dlep26.itg.ti.com (localhost [127.0.0.1]) by dlep35.itg.ti.com (8.13.7/8.13.7) with ESMTP id o3MEhb2N014753; Thu, 22 Apr 2010 09:43:37 -0500 (CDT) Received: from dlee74.ent.ti.com (localhost [127.0.0.1]) by dlep26.itg.ti.com (8.13.8/8.13.8) with ESMTP id o3MEhbxI000697; Thu, 22 Apr 2010 09:43:37 -0500 (CDT) Received: from dlee03.ent.ti.com ([157.170.170.18]) by dlee74.ent.ti.com ([157.170.170.8]) with mapi; Thu, 22 Apr 2010 09:43:37 -0500 From: "Arce, Abraham" To: "linux-omap@vger.kernel.org" , "spi-devel-general@lists.sourceforge.net" CC: "Shilimkar, Santosh" , Tony Lindgren , Russell King - ARM Linux Date: Thu, 22 Apr 2010 09:43:37 -0500 Subject: [PATCH 3/4] OMAP4: Ethernet: KS8851 Board Support Thread-Topic: [PATCH 3/4] OMAP4: Ethernet: KS8851 Board Support Thread-Index: AcriKjEsTb6EVIQxR7ig4kXvAyyYHQ== Message-ID: <27F9C60D11D683428E133F85D2BB4A53043DC15EBD@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]); Thu, 22 Apr 2010 14:44:05 +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)