From patchwork Thu Oct 8 11:58:53 2009 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Eduardo Valentin X-Patchwork-Id: 52499 X-Patchwork-Delegate: tony@atomide.com Received: from vger.kernel.org (vger.kernel.org [209.132.176.167]) by demeter.kernel.org (8.14.2/8.14.2) with ESMTP id n98C1Qbr007026 for ; Thu, 8 Oct 2009 12:01:27 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1757865AbZJHMBN (ORCPT ); Thu, 8 Oct 2009 08:01:13 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1757854AbZJHMBM (ORCPT ); Thu, 8 Oct 2009 08:01:12 -0400 Received: from smtp.nokia.com ([192.100.122.233]:45217 "EHLO mgw-mx06.nokia.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1757759AbZJHMBI (ORCPT ); Thu, 8 Oct 2009 08:01:08 -0400 Received: from esebh105.NOE.Nokia.com (esebh105.ntc.nokia.com [172.21.138.211]) by mgw-mx06.nokia.com (Switch-3.3.3/Switch-3.3.3) with ESMTP id n98BxTKR014083; Thu, 8 Oct 2009 14:59:32 +0300 Received: from vaebh104.NOE.Nokia.com ([10.160.244.30]) by esebh105.NOE.Nokia.com with Microsoft SMTPSVC(6.0.3790.3959); Thu, 8 Oct 2009 14:59:29 +0300 Received: from vaebe101.NOE.Nokia.com ([10.160.244.11]) by vaebh104.NOE.Nokia.com with Microsoft SMTPSVC(6.0.3790.3959); Thu, 8 Oct 2009 14:59:27 +0300 Received: from localhost.localdomain ([172.21.40.103]) by vaebe101.NOE.Nokia.com with Microsoft SMTPSVC(6.0.3790.3959); Thu, 8 Oct 2009 14:59:27 +0300 From: Eduardo Valentin To: Mark Brown , ext Tony Lindgren Cc: "Ujfalusi Peter (Nokia-D/Tampere)" , "Nurkkala Eero.An (EXT-Offcode/Oulu)" , Jarkko Nikula , Linux-OMAP , ALSA-Devel , Eduardo Valentin Subject: [PATCH 4/8] OMAP: RX51: Add audio board file Date: Thu, 8 Oct 2009 14:58:53 +0300 Message-Id: <1255003137-1034-5-git-send-email-eduardo.valentin@nokia.com> X-Mailer: git-send-email 1.6.4.183.g04423 In-Reply-To: <1255003137-1034-1-git-send-email-eduardo.valentin@nokia.com> References: <1255003137-1034-1-git-send-email-eduardo.valentin@nokia.com> X-OriginalArrivalTime: 08 Oct 2009 11:59:27.0792 (UTC) FILETIME=[C9539300:01CA480E] X-Nokia-AV: Clean Sender: linux-omap-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-omap@vger.kernel.org diff --git a/arch/arm/mach-omap2/Makefile b/arch/arm/mach-omap2/Makefile index 6b7702f..50f2fbe 100644 --- a/arch/arm/mach-omap2/Makefile +++ b/arch/arm/mach-omap2/Makefile @@ -70,6 +70,7 @@ obj-$(CONFIG_MACH_OMAP_3430SDP) += board-3430sdp.o \ obj-$(CONFIG_MACH_NOKIA_N8X0) += board-n8x0.o obj-$(CONFIG_MACH_NOKIA_RX51) += board-rx51.o \ board-rx51-peripherals.o \ + board-rx51-audio.o \ mmc-twl4030.o obj-$(CONFIG_MACH_OMAP_ZOOM2) += board-zoom2.o \ mmc-twl4030.o \ diff --git a/arch/arm/mach-omap2/board-rx51-audio.c b/arch/arm/mach-omap2/board-rx51-audio.c new file mode 100644 index 0000000..cba42b5 --- /dev/null +++ b/arch/arm/mach-omap2/board-rx51-audio.c @@ -0,0 +1,132 @@ +/* + * linux/arch/arm/mach-omap2/board-rx51-audio.c + * + * Copyright (C) 2008 Nokia + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License version 2 as + * published by the Free Software Foundation. + */ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#define RX51_FMTX_RESET_GPIO 163 +#define RX51_FMTX_IRQ 53 +#define RX51_FMRX_IRQ 43 +#define RX51_HEADPHN_EN_GPIO 98 + +static int si4713_set_power(int power) +{ + if (!power) + udelay(1); + gpio_set_value(RX51_FMTX_RESET_GPIO, power); + udelay(50); + + return 0; +} + +static struct si4713_platform_data rx51_si4713_platform_data = { + .set_power = si4713_set_power, +}; + +static void __init rx51_init_si4713(void) +{ + int r; + + r = gpio_request(RX51_FMTX_RESET_GPIO, "si4713"); + if (r < 0) { + printk(KERN_ERR "Failed to request gpio for FMTx rst\n"); + return; + } + + gpio_direction_output(RX51_FMTX_RESET_GPIO, 0); +} + +static int tpa6130a2_set_power(int state) +{ + gpio_set_value(RX51_HEADPHN_EN_GPIO, !!state); + return 0; +} + +static struct tpa6130a2_platform_data rx51_tpa6130a2_platform_data = { + .set_power = tpa6130a2_set_power, +}; + +static void __init rx51_init_tpa6130a2(void) +{ + int r; + + r = gpio_request(RX51_HEADPHN_EN_GPIO, "tpa6130a2"); + if (r < 0) { + printk(KERN_ERR "Failed to request shutdown gpio " + "for TPA6130a2 chip\n"); + } + + gpio_direction_output(RX51_HEADPHN_EN_GPIO, 0); + + return; +} + +struct i2c_board_info si4713_board_info = { + I2C_BOARD_INFO("si4713", SI4713_I2C_ADDR_BUSEN_HIGH), + .irq = OMAP_GPIO_IRQ(RX51_FMTX_IRQ), + .platform_data = &rx51_si4713_platform_data, +}; + +static struct radio_si4713_platform_data rx51_radio_si4713_platform_data = { + .i2c_bus = 2, + .subdev_board_info = &si4713_board_info, +}; + +static struct platform_device radio_fmtx = { + .name = "radio-si4713", + .id = -1, + .dev = { + .platform_data = &rx51_radio_si4713_platform_data, + }, +}; + +static struct platform_device *rx51_audio_devices[] = { + &radio_fmtx, +}; + +static struct i2c_board_info __initdata rx51_audio_i2c_board_info_2[] = { + { + I2C_BOARD_INFO("aic34b_dummy", 0x19), + }, + { + I2C_BOARD_INFO("tlv320aic3x", 0x18), + }, + { + I2C_BOARD_INFO("tpa6130a2", 0x60), + .platform_data = &rx51_tpa6130a2_platform_data, + }, +}; + +static int __init rx51_audio_init(void) +{ + if (!machine_is_nokia_rx51()) + return 0; + + platform_add_devices(rx51_audio_devices, + ARRAY_SIZE(rx51_audio_devices)); + + rx51_init_tpa6130a2(); + rx51_init_si4713(); + i2c_register_board_info(2, rx51_audio_i2c_board_info_2, + ARRAY_SIZE(rx51_audio_i2c_board_info_2)); + + return 0; +} + +subsys_initcall(rx51_audio_init);