Skip to contentSkip to conversation

regulator: new drivers for AD5398 and AD5821

PATCH Applied sonic zhang 4 participants 5 messages Jun 4, 2010 – Jun 7, 2010

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH v6 1/1 regulator: new drivers for AD5398 and AD5821

Quoted 1 line

From 32646efc2e7fb19945a10ad3f1172d6f751186b8 Mon Sep 17 00:00:00 2001

From: Sonic Zhang <[email protected]>
Date: Fri, 4 Jun 2010 11:46:04 +0800
Subject: [PATCH v6] regulator: new drivers for AD5398 and AD5821

The AD5398 and AD5821 are single 10-bit DAC with 120 mA output current sink capability. They feature an internal reference and operates from a single 2.7 V to 5.5 V supply.

This driver supports both the AD5398 and the AD5821. It adapts into the voltage and current framework.

---
 drivers/regulator/Kconfig  |    6 +
 drivers/regulator/Makefile |    1 +
 drivers/regulator/ad5398.c |  288 ++++++++++++++++++++++++++++++++++++++++++++
 3 files changed, 295 insertions(+), 0 deletions(-)
 create mode 100644 drivers/regulator/ad5398.c
drivers/regulator/Kconfig +6 -0
index 04f2e08..679ea37 100644
@@ -201,5 +201,11 @@ config REGULATOR_88PM8607
 	help
 	  This driver supports 88PM8607 voltage regulator chips.
 
+config REGULATOR_AD5398
+	tristate "Analog Devices AD5398/AD5821 regulators"
+	depends on I2C
+	help
+	  This driver supports AD5398 and AD5821 current regulator chips.
+	  If building into module, its name is ad5398.ko.
 endif
 
drivers/regulator/Makefile +1 -0
index 4e7feec..c256668 100644
@@ -8,6 +8,7 @@ obj-$(CONFIG_REGULATOR_FIXED_VOLTAGE) += fixed.o
 obj-$(CONFIG_REGULATOR_VIRTUAL_CONSUMER) += virtual.o
 obj-$(CONFIG_REGULATOR_USERSPACE_CONSUMER) += userspace-consumer.o
 
+obj-$(CONFIG_REGULATOR_AD5398) += ad5398.o
 obj-$(CONFIG_REGULATOR_BQ24022) += bq24022.o
 obj-$(CONFIG_REGULATOR_DUMMY) += dummy.o
 obj-$(CONFIG_REGULATOR_LP3971) += lp3971.o
drivers/regulator/ad5398.c new file +288 -0

288 lines not on this page · raw message

Signature · 1 line
1.6.0
Acked-by on v6 1/1
#1 lore raw
Quoted 9 lines · sonic zhang

The AD5398 and AD5821 are single 10-bit DAC with 120 mA output current sink capability. They feature an internal reference and operates from a single 2.7 V to 5.5 V supply.

This driver supports both the AD5398 and the AD5821. It adapts into the voltage and current framework.

but

drivers/regulator/ad5398.c line 277

Quoted 5 lines
drivers/regulator/ad5398.c new file +5 -0
+static int __init ad5398_init(void)
+{
+	return i2c_add_driver(&ad5398_driver);
+}
+module_init(ad5398_init);

at least some systems are likely to want this to be subsys_initcall() to make sure the regulator is available prior to the consumers. Please send an incremental change for this rather than repostnig the full thing.

#2 lore raw
Quoted 11 lines · Mark Brown

drivers/regulator/ad5398.c line 277

Quoted 5 lines · sonic zhang
drivers/regulator/ad5398.c new file +5 -0
+static int __init ad5398_init(void)
+{
+     return i2c_add_driver(&ad5398_driver);
+}
+module_init(ad5398_init);

at least some systems are likely to want this to be subsys_initcall() to make sure the regulator is available prior to the consumers.  Please send an incremental change for this rather than repostnig the full thing.

i guess the Blackfin I2C driver should have its initcall bumped up as well -mike

#3 lore raw
Quoted 1 line · Mike Frysinger

i guess the Blackfin I2C driver should have its initcall bumped up as well

Yes, probably. SPI might be worth it also.

#4 lore raw
In reply to sonic zhang
Quoted 12 lines · sonic zhang
Quoted 1 line

From 32646efc2e7fb19945a10ad3f1172d6f751186b8 Mon Sep 17 00:00:00 2001

From: Sonic Zhang <[email protected]>
Date: Fri, 4 Jun 2010 11:46:04 +0800
Subject: [PATCH v6] regulator: new drivers for AD5398 and AD5821

The AD5398 and AD5821 are single 10-bit DAC with 120 mA output current sink capability. They feature an internal reference and operates from a single 2.7 V to 5.5 V supply.

This driver supports both the AD5398 and the AD5821. It adapts into the voltage and current framework.

Quoted 9 lines
---
 drivers/regulator/Kconfig  |    6 +
 drivers/regulator/Makefile |    1 +
 drivers/regulator/ad5398.c |  288 ++++++++++++++++++++++++++++++++++++++++++++
 3 files changed, 295 insertions(+), 0 deletions(-)
 create mode 100644 drivers/regulator/ad5398.c

Applied.

Thanks

Liam

Signature · 3 lines
Freelance Developer, SlimLogic Ltd
ASoC and Voltage Regulator Maintainer.
http://www.slimlogic.co.uk