HWMON: DA9055 HWMON driver
Subsystems (3)
PATCH v4 5/7 HWMON: DA9055 HWMON driver
This is the HWMON patch for DA9055 PMIC and has got dependency on the DA9055 MFD core.
This patch monitors the DA9055 PMIC's ADC channels vddout, junction temperature and auxiliary channels.
This patch is functionally tested on Samsung SMDKV6410.
---
changes since version v4:
- add support for virtual irq
- remove unnecessary gotos
changes since version v3:
- replace msleep with usleep_range
- remove unnecessary label
- remove race condition
changes since version v2:
- corrected the junction temperature comment
- use of devm_request_threaded_irq API
- use of msleep instead of mdelay
--- Documentation/hwmon/da9055 | 47 ++++++ drivers/hwmon/Kconfig | 10 ++ drivers/hwmon/Makefile | 1 + drivers/hwmon/da9055-hwmon.c | 336 ++++++++++++++++++++++++++++++++++++++++++ 4 files changed, 394 insertions(+), 0 deletions(-) create mode 100644 Documentation/hwmon/da9055 create mode 100644 drivers/hwmon/da9055-hwmon.c
Documentation/hwmon/da9055 new file +47 -0
@@ -0,0 +1,47 @@ +Supported chips: + * Dialog Semiconductors DA9055 PMIC + Prefix: 'da9055' + Datasheet: Datasheet is not publicly available. + +Authors: David Dajun Chen <[email protected]> + +Description +----------- + +The DA9055 provides an Analogue to Digital Converter (ADC) with 10 bits +resolution and track and hold circuitry combined with an analogue input +multiplexer. The analogue input multiplexer will allow conversion of up to 5 +different inputs. The track and hold circuit ensures stable input voltages at +the input of the ADC during the conversion. + +The ADC is used to measure the following inputs: +Channel 0: VDDOUT - measurement of the system voltage +Channel 1: ADC_IN1 - high impedance input (0 - 2.5V) +Channel 2: ADC_IN2 - high impedance input (0 - 2.5V) +Channel 3: ADC_IN3 - high impedance input (0 - 2.5V) +Channel 4: Internal Tjunc. - sense (internal temp. sensor) + +By using sysfs attributes we can measure the system voltage VDDOUT, +chip junction temperature and auxiliary channels voltages. + +Voltage Monitoring +------------------ + +Voltages are sampled in a AUTO mode it can be manually sampled too and results +are stored in a 10 bit ADC. + +The system voltage is calculated as: + Milli volt = ((ADC value * 1000) / 85) + 2500 + +The voltages on ADC channels 1, 2 and 3 are calculated as: + Milli volt = (ADC value * 1000) / 102 + +Temperature Monitoring +---------------------- + +Temperatures are sampled by a 10 bit ADC. Junction temperatures +are monitored by the ADC channels. + +The junction temperature is calculated: + Degrees celsius = -0.4084 * (ADC_RES - T_OFFSET) + 307.6332 +The junction temperature attribute is supported by the driver.
drivers/hwmon/Kconfig +10 -0
@@ -334,6 +334,16 @@ config SENSORS_DA9052_ADC This driver can also be built as module. If so, the module will be called da9052-hwmon. +config SENSORS_DA9055 + tristate "Dialog Semiconductor DA9055 ADC" + depends on MFD_DA9055 + help + If you say yes here you get support for ADC on the Dialog + Semiconductor DA9055 PMIC. + + This driver can also be built as a module. If so, the module + will be called da9055-hwmon. + config SENSORS_I5K_AMB tristate "FB-DIMM AMB temperature sensor on Intel 5000 series chipsets" depends on PCI && EXPERIMENTAL
drivers/hwmon/Makefile +1 -0
@@ -44,6 +44,7 @@ obj-$(CONFIG_SENSORS_ASC7621) += asc7621.o obj-$(CONFIG_SENSORS_ATXP1) += atxp1.o obj-$(CONFIG_SENSORS_CORETEMP) += coretemp.o obj-$(CONFIG_SENSORS_DA9052_ADC)+= da9052-hwmon.o +obj-$(CONFIG_SENSORS_DA9055)+= da9055-hwmon.o obj-$(CONFIG_SENSORS_DME1737) += dme1737.o obj-$(CONFIG_SENSORS_DS620) += ds620.o obj-$(CONFIG_SENSORS_DS1621) += ds1621.o
drivers/hwmon/da9055-hwmon.c new file +336 -0
336 lines not on this page · raw message
Signature · 8 lines
1.7.0.4 _______________________________________________ lm-sensors mailing list [email protected] http://lists.lm-sensors.org/mailman/listinfo/lm-sensors
Quoted 10 lines · Ashish Jangam
This is the HWMON patch for DA9055 PMIC and has got dependency on the DA9055 MFD core.
This patch monitors the DA9055 PMIC's ADC channels vddout, junction temperature and auxiliary channels.
This patch is functionally tested on Samsung SMDKV6410.
Signed-off-by David Dajun Chen <[email protected]>Signed-off-by Ashish Jangam <[email protected]>
I assume this will be pushed upstream together with the aother patches in the series.
Guenter
_______________________________________________
lm-sensors mailing list
[email protected]
http://lists.lm-sensors.org/mailman/listinfo/lm-sensors
Quoted 17 lines · Ashish Jangam
-----Original Message-----
From: Guenter Roeck [mailto:[email protected]]
Sent: Monday, October 08, 2012 9:05 PM
To: Ashish Jangam
Cc: Samuel Ortiz; [email protected]; David Dajun Chen
Subject: Re: [Patch v4 5/7] HWMON: DA9055 HWMON driverQuoted 8 lines · Ashish Jangam
This is the HWMON patch for DA9055 PMIC and has got dependency on the DA9055 MFD core.
This patch monitors the DA9055 PMIC's ADC channels vddout, junction temperature and auxiliary channels.
This patch is functionally tested on Samsung SMDKV6410.
Quoted 8 lines
Quoted 2 lines
Signed-off-by David Dajun Chen <[email protected]>Signed-off-by Ashish Jangam <[email protected]>Acked-by Guenter Roeck <[email protected]>I assume this will be pushed upstream together with the aother patches in the series.
Its only dependent DA9055 MFD code is present in linux-next so you may have to upstream this patch.
Quoted 2 lines
Guenter
_______________________________________________
lm-sensors mailing list
[email protected]
http://lists.lm-sensors.org/mailman/listinfo/lm-sensors
Guenter Roeck
maintainerQuoted 21 lines · Ashish Jangam
Quoted 20 lines · Ashish Jangam
-----Original Message-----
From: Guenter Roeck [mailto:[email protected]]
Sent: Monday, October 08, 2012 9:05 PM
To: Ashish Jangam
Cc: Samuel Ortiz; [email protected]; David Dajun Chen
Subject: Re: [Patch v4 5/7] HWMON: DA9055 HWMON driverQuoted 10 lines · Ashish Jangam
This is the HWMON patch for DA9055 PMIC and has got dependency on the DA9055 MFD core.
This patch monitors the DA9055 PMIC's ADC channels vddout, junction temperature and auxiliary channels.
This patch is functionally tested on Samsung SMDKV6410.
Signed-off-by David Dajun Chen <[email protected]>Signed-off-by Ashish Jangam <[email protected]>
Quoted 7 lines
Quoted 5 lines
Acked-by Guenter Roeck <[email protected]>I assume this will be pushed upstream together with the aother patches in the series.
Its only dependent DA9055 MFD code is present in linux-next so you may have to upstream this patch.
Ok, I'll add it to my -next tree.
Guenter
_______________________________________________
lm-sensors mailing list
[email protected]
http://lists.lm-sensors.org/mailman/listinfo/lm-sensors