diff options
author | codeworkx <daniel.hillenbrand@codeworkx.de> | 2012-06-02 13:09:29 +0200 |
---|---|---|
committer | codeworkx <daniel.hillenbrand@codeworkx.de> | 2012-06-02 13:09:29 +0200 |
commit | c6da2cfeb05178a11c6d062a06f8078150ee492f (patch) | |
tree | f3b4021d252c52d6463a9b3c1bb7245e399b009c /arch/arm/mach-exynos/board-smdk5250-audio.c | |
parent | c6d7c4dbff353eac7919342ae6b3299a378160a6 (diff) | |
download | kernel_samsung_smdk4412-c6da2cfeb05178a11c6d062a06f8078150ee492f.zip kernel_samsung_smdk4412-c6da2cfeb05178a11c6d062a06f8078150ee492f.tar.gz kernel_samsung_smdk4412-c6da2cfeb05178a11c6d062a06f8078150ee492f.tar.bz2 |
samsung update 1
Diffstat (limited to 'arch/arm/mach-exynos/board-smdk5250-audio.c')
-rw-r--r-- | arch/arm/mach-exynos/board-smdk5250-audio.c | 177 |
1 files changed, 177 insertions, 0 deletions
diff --git a/arch/arm/mach-exynos/board-smdk5250-audio.c b/arch/arm/mach-exynos/board-smdk5250-audio.c new file mode 100644 index 0000000..6cd1405 --- /dev/null +++ b/arch/arm/mach-exynos/board-smdk5250-audio.c @@ -0,0 +1,177 @@ +/* linux/arch/arm/mach-exynos/board-smdk5250-audio.c + * + * Copyright (c) 2012 Samsung Electronics Co., Ltd. + * http://www.samsung.com + * + * 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 <linux/gpio.h> +#include <linux/i2c.h> +#include <linux/regulator/machine.h> +#include <linux/regulator/fixed.h> +#include <linux/mfd/wm8994/pdata.h> + +#include <plat/gpio-cfg.h> +#include <plat/devs.h> +#include <plat/iic.h> + +#include "board-smdk5250.h" + +static struct regulator_consumer_supply wm8994_fixed_voltage0_supplies[] = { + REGULATOR_SUPPLY("AVDD2", "1-001a"), + REGULATOR_SUPPLY("CPVDD", "1-001a"), +}; + +static struct regulator_consumer_supply wm8994_fixed_voltage1_supplies[] = { + REGULATOR_SUPPLY("SPKVDD1", "1-001a"), + REGULATOR_SUPPLY("SPKVDD2", "1-001a"), +}; + +static struct regulator_consumer_supply wm8994_fixed_voltage2_supplies = + REGULATOR_SUPPLY("DBVDD", "1-001a"); + +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 = 1, + .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 = + REGULATOR_SUPPLY("AVDD1", "1-001a"); + +static struct regulator_consumer_supply wm8994_dcvdd_supply = + REGULATOR_SUPPLY("DCVDD", "1-001a"); + +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, +}; + +static struct wm8994_pdata wm8994_platform_data = { + /* configure gpio1 function: 0x0001(Logic level input/output) */ + .gpio_defaults[0] = 0x0001, + /* If the i2s0 and i2s2 is enabled simultaneously */ + .gpio_defaults[7] = 0x8100, /* GPIO8 DACDAT3 in */ + .gpio_defaults[8] = 0x0100, /* GPIO9 ADCDAT3 out */ + .gpio_defaults[9] = 0x0100, /* GPIO10 LRCLK3 out */ + .gpio_defaults[10] = 0x0100,/* GPIO11 BCLK3 out */ + .ldo[0] = { 0, NULL, &wm8994_ldo1_data }, + .ldo[1] = { 0, NULL, &wm8994_ldo2_data }, +}; + +static struct i2c_board_info i2c_devs1[] __initdata = { + { + I2C_BOARD_INFO("wm8994", 0x1a), + .platform_data = &wm8994_platform_data, + }, +}; + +static struct platform_device *smdk5250_audio_devices[] __initdata = { + &s3c_device_i2c1, +#ifdef CONFIG_SND_SAMSUNG_AC97 + &exynos_device_ac97, +#endif +#ifdef CONFIG_SND_SAMSUNG_I2S + &exynos_device_i2s0, +#endif +#ifdef CONFIG_SND_SAMSUNG_PCM + &exynos_device_pcm0, +#endif +#ifdef CONFIG_SND_SAMSUNG_SPDIF + &exynos_device_spdif, +#endif +#if defined(CONFIG_SND_SAMSUNG_RP) || defined(CONFIG_SND_SAMSUNG_ALP) + &exynos_device_srp, +#endif + &wm8994_fixed_voltage0, + &wm8994_fixed_voltage1, + &wm8994_fixed_voltage2, + &samsung_asoc_dma, + &samsung_asoc_idma, +}; + +void __init exynos5_smdk5250_audio_init(void) +{ + s3c_i2c1_set_platdata(NULL); + i2c_register_board_info(1, i2c_devs1, ARRAY_SIZE(i2c_devs1)); + + platform_add_devices(smdk5250_audio_devices, + ARRAY_SIZE(smdk5250_audio_devices)); +} |