* [PATCH 1/2] at91sam9g20ek: add fixed-value regulator for wm8731
@ 2010-05-28 15:10 Dmitry Eremin-Solenikov
2010-05-28 15:10 ` [PATCH 2/2] " Dmitry Eremin-Solenikov
2010-06-02 7:46 ` [PATCH 1/2] " Dmitry Eremin-Solenikov
0 siblings, 2 replies; 4+ messages in thread
From: Dmitry Eremin-Solenikov @ 2010-05-28 15:10 UTC (permalink / raw)
To: linux-arm-kernel
If CONFIG_REGULATOR is enabled, wm8731 fails on AT91SAM9G20EK board,
since codec driver requires several voltage supplies and none are
provided currently. As requires voltages are hardwired to 3V3, use fixed
voltage regulator for this chip.
Signed-off-by: Dmitry Eremin-Solenikov <dbaryshkov@gmail.com>
---
arch/arm/mach-at91/board-sam9g20ek.c | 45 ++++++++++++++++++++++++++++++++++
1 files changed, 45 insertions(+), 0 deletions(-)
diff --git a/arch/arm/mach-at91/board-sam9g20ek.c b/arch/arm/mach-at91/board-sam9g20ek.c
index a2f00f4..9398ebc 100644
--- a/arch/arm/mach-at91/board-sam9g20ek.c
+++ b/arch/arm/mach-at91/board-sam9g20ek.c
@@ -28,6 +28,9 @@
#include <linux/gpio_keys.h>
#include <linux/input.h>
#include <linux/clk.h>
+#include <linux/regulator/machine.h>
+#include <linux/regulator/fixed.h>
+#include <linux/regulator/consumer.h>
#include <mach/hardware.h>
#include <asm/setup.h>
@@ -283,6 +286,46 @@ static void __init ek_add_device_buttons(void)
static void __init ek_add_device_buttons(void) {}
#endif
+#if defined(CONFIG_REGULATOR_FIXED_VOLTAGE) || defined(CONFIG_REGULATOR_FIXED_VOLTAGE_MODULE)
+static struct regulator_consumer_supply ek_audio_consumer_supplies[] = {
+ REGULATOR_SUPPLY("AVDD", "0-001b"),
+ REGULATOR_SUPPLY("HPVDD", "0-001b"),
+ REGULATOR_SUPPLY("DBVDD", "0-001b"),
+ REGULATOR_SUPPLY("DCVDD", "0-001b"),
+};
+
+static struct regulator_init_data ek_avdd_reg_init_data = {
+ .constraints = {
+ .name = "3V3",
+ .valid_ops_mask = REGULATOR_CHANGE_STATUS,
+ },
+ .consumer_supplies = ek_audio_consumer_supplies,
+ .num_consumer_supplies = ARRAY_SIZE(ek_audio_consumer_supplies),
+};
+
+static struct fixed_voltage_config ek_vdd_pdata = {
+ .supply_name = "board-3V3",
+ .microvolts = 3300000,
+ .gpio = -EINVAL,
+ .enabled_at_boot = 0,
+ .init_data = &ek_avdd_reg_init_data,
+};
+static struct platform_device ek_voltage_regulator = {
+ .name = "reg-fixed-voltage",
+ .id = -1,
+ .num_resources = 0,
+ .dev = {
+ .platform_data = &ek_vdd_pdata,
+ },
+};
+static void __init ek_add_regulators(void)
+{
+ platform_device_register(&ek_voltage_regulator);
+}
+#else
+static void __init ek_add_regulators(void) {}
+#endif
+
static struct i2c_board_info __initdata ek_i2c_devices[] = {
{
@@ -308,6 +351,8 @@ static void __init ek_board_init(void)
ek_add_device_nand();
/* Ethernet */
at91_add_device_eth(&ek_macb_data);
+ /* Regulators */
+ ek_add_regulators();
/* MMC */
at91_add_device_mmc(0, &ek_mmc_data);
/* I2C */
--
1.7.1
^ permalink raw reply related [flat|nested] 4+ messages in thread
* [PATCH 2/2] at91sam9g20ek: add fixed-value regulator for wm8731
2010-05-28 15:10 [PATCH 1/2] at91sam9g20ek: add fixed-value regulator for wm8731 Dmitry Eremin-Solenikov
@ 2010-05-28 15:10 ` Dmitry Eremin-Solenikov
2010-06-03 7:57 ` avictor.za at gmail.com
2010-06-02 7:46 ` [PATCH 1/2] " Dmitry Eremin-Solenikov
1 sibling, 1 reply; 4+ messages in thread
From: Dmitry Eremin-Solenikov @ 2010-05-28 15:10 UTC (permalink / raw)
To: linux-arm-kernel
If CONFIG_REGULATOR is enabled, wm8731 fails on AT91SAM9G20EK board,
since codec driver requires several voltage supplies and none are
provided currently. As requires voltages are hardwired to 3V3, use fixed
voltage regulator for this chip.
Signed-off-by: Dmitry Eremin-Solenikov <dbaryshkov@gmail.com>
---
arch/arm/mach-at91/board-sam9g20ek-2slot-mmc.c | 45 ++++++++++++++++++++++++
1 files changed, 45 insertions(+), 0 deletions(-)
diff --git a/arch/arm/mach-at91/board-sam9g20ek-2slot-mmc.c b/arch/arm/mach-at91/board-sam9g20ek-2slot-mmc.c
index a4102d7..c49f5c0 100644
--- a/arch/arm/mach-at91/board-sam9g20ek-2slot-mmc.c
+++ b/arch/arm/mach-at91/board-sam9g20ek-2slot-mmc.c
@@ -26,6 +26,9 @@
#include <linux/spi/spi.h>
#include <linux/spi/at73c213.h>
#include <linux/clk.h>
+#include <linux/regulator/machine.h>
+#include <linux/regulator/fixed.h>
+#include <linux/regulator/consumer.h>
#include <mach/hardware.h>
#include <asm/setup.h>
@@ -235,6 +238,46 @@ static struct gpio_led ek_leds[] = {
}
};
+#if defined(CONFIG_REGULATOR_FIXED_VOLTAGE) || defined(CONFIG_REGULATOR_FIXED_VOLTAGE_MODULE)
+static struct regulator_consumer_supply ek_audio_consumer_supplies[] = {
+ REGULATOR_SUPPLY("AVDD", "0-001b"),
+ REGULATOR_SUPPLY("HPVDD", "0-001b"),
+ REGULATOR_SUPPLY("DBVDD", "0-001b"),
+ REGULATOR_SUPPLY("DCVDD", "0-001b"),
+};
+
+static struct regulator_init_data ek_avdd_reg_init_data = {
+ .constraints = {
+ .name = "3V3",
+ .valid_ops_mask = REGULATOR_CHANGE_STATUS,
+ },
+ .consumer_supplies = ek_audio_consumer_supplies,
+ .num_consumer_supplies = ARRAY_SIZE(ek_audio_consumer_supplies),
+};
+
+static struct fixed_voltage_config ek_vdd_pdata = {
+ .supply_name = "board-3V3",
+ .microvolts = 3300000,
+ .gpio = -EINVAL,
+ .enabled_at_boot = 0,
+ .init_data = &ek_avdd_reg_init_data,
+};
+static struct platform_device ek_voltage_regulator = {
+ .name = "reg-fixed-voltage",
+ .id = -1,
+ .num_resources = 0,
+ .dev = {
+ .platform_data = &ek_vdd_pdata,
+ },
+};
+static void __init ek_add_regulators(void)
+{
+ platform_device_register(&ek_voltage_regulator);
+}
+#else
+static void __init ek_add_regulators(void) {}
+#endif
+
static struct i2c_board_info __initdata ek_i2c_devices[] = {
{
I2C_BOARD_INFO("24c512", 0x50),
@@ -256,6 +299,8 @@ static void __init ek_board_init(void)
ek_add_device_nand();
/* Ethernet */
at91_add_device_eth(&ek_macb_data);
+ /* Regulators */
+ ek_add_regulators();
/* MMC */
#if defined(CONFIG_MMC_ATMELMCI) || defined(CONFIG_MMC_ATMELMCI_MODULE)
at91_add_device_mci(0, &ek_mmc_data);
--
1.7.1
^ permalink raw reply related [flat|nested] 4+ messages in thread
* [PATCH 1/2] at91sam9g20ek: add fixed-value regulator for wm8731
2010-05-28 15:10 [PATCH 1/2] at91sam9g20ek: add fixed-value regulator for wm8731 Dmitry Eremin-Solenikov
2010-05-28 15:10 ` [PATCH 2/2] " Dmitry Eremin-Solenikov
@ 2010-06-02 7:46 ` Dmitry Eremin-Solenikov
1 sibling, 0 replies; 4+ messages in thread
From: Dmitry Eremin-Solenikov @ 2010-06-02 7:46 UTC (permalink / raw)
To: linux-arm-kernel
Any comments on these two patches? Can I submit them to patchsystem?
Without these patches the kernel with CONFIG_REGULATOR enabled is broken
on sam9g20ek boards (sound won't work).
On Fri, May 28, 2010 at 7:10 PM, Dmitry Eremin-Solenikov
<dbaryshkov@gmail.com> wrote:
> If CONFIG_REGULATOR is enabled, wm8731 fails on AT91SAM9G20EK board,
> since codec driver requires several voltage supplies and none are
> provided currently. As requires voltages are hardwired to 3V3, use fixed
> voltage regulator for this chip.
>
> Signed-off-by: Dmitry Eremin-Solenikov <dbaryshkov@gmail.com>
> ---
> ?arch/arm/mach-at91/board-sam9g20ek.c | ? 45 ++++++++++++++++++++++++++++++++++
> ?1 files changed, 45 insertions(+), 0 deletions(-)
--
With best wishes
Dmitry
^ permalink raw reply [flat|nested] 4+ messages in thread
* [PATCH 2/2] at91sam9g20ek: add fixed-value regulator for wm8731
2010-05-28 15:10 ` [PATCH 2/2] " Dmitry Eremin-Solenikov
@ 2010-06-03 7:57 ` avictor.za at gmail.com
0 siblings, 0 replies; 4+ messages in thread
From: avictor.za at gmail.com @ 2010-06-03 7:57 UTC (permalink / raw)
To: linux-arm-kernel
hi Dmitry,
> If CONFIG_REGULATOR is enabled, wm8731 fails on AT91SAM9G20EK board,
> since codec driver requires several voltage supplies and none are
> provided currently. As requires voltages are hardwired to 3V3, use fixed
> voltage regulator for this chip.
>
> Signed-off-by: Dmitry Eremin-Solenikov <dbaryshkov@gmail.com>
Acked-by: Andrew Victor <linux@maxim.org.za>
Please submit to the patch system.
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2010-06-03 7:57 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-05-28 15:10 [PATCH 1/2] at91sam9g20ek: add fixed-value regulator for wm8731 Dmitry Eremin-Solenikov
2010-05-28 15:10 ` [PATCH 2/2] " Dmitry Eremin-Solenikov
2010-06-03 7:57 ` avictor.za at gmail.com
2010-06-02 7:46 ` [PATCH 1/2] " Dmitry Eremin-Solenikov
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).