From patchwork Tue Mar 8 10:34:25 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Giridhar Maruthy X-Patchwork-Id: 421 Return-Path: Delivered-To: unknown Received: from imap.gmail.com (74.125.159.109) by localhost6.localdomain6 with IMAP4-SSL; 08 Jun 2011 14:42:35 -0000 Delivered-To: patches@linaro.org Received: by 10.224.60.68 with SMTP id o4cs23524qah; Tue, 8 Mar 2011 02:46:44 -0800 (PST) Received: by 10.236.72.200 with SMTP id t48mr5000937yhd.21.1299581204426; Tue, 08 Mar 2011 02:46:44 -0800 (PST) Received: from mailout4.samsung.com (mailout4.samsung.com [203.254.224.34]) by mx.google.com with ESMTP id 26si911938yhl.64.2011.03.08.02.46.42; Tue, 08 Mar 2011 02:46:43 -0800 (PST) Received-SPF: neutral (google.com: 203.254.224.34 is neither permitted nor denied by best guess record for domain of giridhar.maruthy@linaro.org) client-ip=203.254.224.34; Authentication-Results: mx.google.com; spf=neutral (google.com: 203.254.224.34 is neither permitted nor denied by best guess record for domain of giridhar.maruthy@linaro.org) smtp.mail=giridhar.maruthy@linaro.org Received: from epmmp2 (mailout4.samsung.com [203.254.224.34]) by mailout4.samsung.com (Oracle Communications Messaging Exchange Server 7u4-19.01 64bit (built Sep 7 2010)) with ESMTP id <0LHQ00K3DJ88AGF0@mailout4.samsung.com>; Tue, 08 Mar 2011 19:45:44 +0900 (KST) Received: from Linaro.sisodomain.com ([107.108.215.143]) by mmp2.samsung.com (iPlanet Messaging Server 5.2 Patch 2 (built Jul 14 2004)) with ESMTPA id <0LHQ00GUTJ7VRG@mmp2.samsung.com>; Tue, 08 Mar 2011 19:45:44 +0900 (KST) Date: Tue, 08 Mar 2011 16:04:25 +0530 From: Giridhar Maruthy Subject: [PATCH] SAMSUNG: S5PV310: Add I2S playback support To: angus.ainslie@linaro.org, samsung@lists.linaro.org Cc: patches@linaro.org, Giridhar Maruthy Message-id: <1299580465-21852-1-git-send-email-giridhar.maruthy@linaro.org> X-Mailer: git-send-email 1.7.1 Content-transfer-encoding: 7BIT This commit adds the platform device and data of wm8994 regulator to enable the I2S playback on S5PV310 board on linux-linaro-2.6.38. Signed-off-by: Giridhar Maruthy --- arch/arm/mach-s5pv310/mach-smdkv310.c | 159 ++++++++++++++++++++++++++++++++- 1 files changed, 158 insertions(+), 1 deletions(-) diff --git a/arch/arm/mach-s5pv310/mach-smdkv310.c b/arch/arm/mach-s5pv310/mach-smdkv310.c index dd46e5e..16653f6 100644 --- a/arch/arm/mach-s5pv310/mach-smdkv310.c +++ b/arch/arm/mach-s5pv310/mach-smdkv310.c @@ -19,6 +19,10 @@ #if defined(CONFIG_S5P_MEM_CMA) #include #endif +#include +#include +#include +#include #include #include @@ -176,8 +180,154 @@ static struct spi_board_info spi_board_info[] __initdata = { }; #endif +#if defined(CONFIG_SND_SOC_WM8994) || defined(CONFIG_SND_SOC_WM8994_MODULE) + +#ifdef CONFIG_REGULATOR_WM8994 +static struct regulator_consumer_supply wm8994_fixed_voltage0_supplies[] = { + { + .dev_name = "1-001a", + .supply = "AVDD2", + }, { + .dev_name = "1-001a", + .supply = "CPVDD", + }, +}; + +static struct regulator_consumer_supply wm8994_fixed_voltage1_supplies[] = { + { + .dev_name = "1-001a", + .supply = "SPKVDD1", + }, { + .dev_name = "1-001a", + .supply = "SPKVDD2", + }, +}; + +static struct regulator_consumer_supply wm8994_fixed_voltage2_supplies[] = { + { + .dev_name = "1-001a", + .supply = "DBVDD", + }, +}; + +static struct regulator_init_data wm8994_fixed_voltage0_init_data = { + .constraints = { + .always_on = 1, + }, + .num_consumer_supplies = ARRAY_SIZE(wm8994_fixed_voltage0_supplies), + .consumer_supplies = wm8994_fixed_voltage0_supplies, +}; + +static struct regulator_init_data wm8994_fixed_voltage1_init_data = { + .constraints = { + .always_on = 1, + }, + .num_consumer_supplies = ARRAY_SIZE(wm8994_fixed_voltage1_supplies), + .consumer_supplies = wm8994_fixed_voltage1_supplies, +}; + +static struct regulator_init_data wm8994_fixed_voltage2_init_data = { + .constraints = { + .always_on = 1, + }, + .num_consumer_supplies = ARRAY_SIZE(wm8994_fixed_voltage2_supplies), + .consumer_supplies = wm8994_fixed_voltage2_supplies, +}; + +static struct fixed_voltage_config wm8994_fixed_voltage0_config = { + .supply_name = "VDD_1.8V", + .microvolts = 1800000, + .gpio = -EINVAL, + .init_data = &wm8994_fixed_voltage0_init_data, +}; + +static struct fixed_voltage_config wm8994_fixed_voltage1_config = { + .supply_name = "DC_5V", + .microvolts = 5000000, + .gpio = -EINVAL, + .init_data = &wm8994_fixed_voltage1_init_data, +}; + +static struct fixed_voltage_config wm8994_fixed_voltage2_config = { + .supply_name = "VDD_3.3V", + .microvolts = 3300000, + .gpio = -EINVAL, + .init_data = &wm8994_fixed_voltage2_init_data, +}; + +static struct platform_device wm8994_fixed_voltage0 = { + .name = "reg-fixed-voltage", + .id = 0, + .dev = { + .platform_data = &wm8994_fixed_voltage0_config, + }, +}; + +static struct platform_device wm8994_fixed_voltage1 = { + .name = "reg-fixed-voltage", + .id = 1, + .dev = { + .platform_data = &wm8994_fixed_voltage1_config, + }, +}; + +static struct platform_device wm8994_fixed_voltage2 = { + .name = "reg-fixed-voltage", + .id = 2, + .dev = { + .platform_data = &wm8994_fixed_voltage2_config, + }, +}; + +static struct regulator_consumer_supply wm8994_avdd1_supply = { + .dev_name = "1-001a", + .supply = "AVDD1", +}; + +static struct regulator_consumer_supply wm8994_dcvdd_supply = { + .dev_name = "1-001a", + .supply = "DCVDD", +}; + +static struct regulator_init_data wm8994_ldo1_data = { + .constraints = { + .name = "AVDD1", + }, + .num_consumer_supplies = 1, + .consumer_supplies = &wm8994_avdd1_supply, +}; + +static struct regulator_init_data wm8994_ldo2_data = { + .constraints = { + .name = "DCVDD", + }, + .num_consumer_supplies = 1, + .consumer_supplies = &wm8994_dcvdd_supply, +}; +#endif + +static struct wm8994_pdata wm8994_platform_data = { + /* configure gpio1 function: 0x0001(Logic level input/output) */ + .gpio_defaults[0] = 0x0001, + /* configure gpio3/4/5/7 function for AIF2 voice */ + .gpio_defaults[2] = 0x8100,/*BCLK2 in*/ + .gpio_defaults[3] = 0x8100,/*LRCLK2 in*/ + .gpio_defaults[4] = 0x8100,/*DACDAT2 in*/ + /* configure gpio6 function: 0x0001(Logic level input/output) */ + .gpio_defaults[5] = 0x0001, + .gpio_defaults[6] = 0x0100,/*ADCDAT2 out*/ +#ifdef CONFIG_REGULATOR_WM8994 + .ldo[0] = { 0, NULL, &wm8994_ldo1_data }, + .ldo[1] = { 0, NULL, &wm8994_ldo2_data }, +#endif +}; +#endif static struct i2c_board_info i2c_devs1[] __initdata = { - {I2C_BOARD_INFO("wm8994", 0x1a),}, +#if defined(CONFIG_SND_SOC_WM8994) || defined(CONFIG_SND_SOC_WM8994_MODULE) + {I2C_BOARD_INFO("wm8994", 0x1a), + .platform_data = &wm8994_platform_data, + }, +#endif }; static struct platform_device *smdkv310_devices[] __initdata = { @@ -205,6 +355,13 @@ static struct platform_device *smdkv310_devices[] __initdata = { &s5pv310_device_pd[PD_GPS], &s5pv310_device_sysmmu, &samsung_asoc_dma, +#if (defined(CONFIG_SND_SOC_WM8994) || \ + defined(CONFIG_SND_SOC_WM8994_MODULE)) && \ + defined(CONFIG_REGULATOR_WM8994) + &wm8994_fixed_voltage0, + &wm8994_fixed_voltage1, + &wm8994_fixed_voltage2, +#endif &smdkv310_smsc911x, };