DA9058 MFD core and ADC driver
Subsystems (2)
PATCH v2 1/7 DA9058 MFD core and ADC driver
This is the MFD core driver for the Dialog DA9058 PMIC. This driver, via MFD CELLs, causes all the component drivers to be loaded, if it is a module, and initialized via their probe methods. It also provides access to the ADC functions on the PMIC. All the other component drivers depend on this one.
This core driver supplies all of the MFD cell platform data used by the other DA9058 component drivers for initialization. This core driver recieves the actual platform data from the machine driver, but that config data has the nature of overides from sensible default values. Thus it is not essential to provide any real platform data at all.
--- drivers/mfd/Kconfig | 18 ++ drivers/mfd/Makefile | 3 + drivers/mfd/da9058-core.c | 268 +++++++++++++++++++ drivers/mfd/da9058-i2c.c | 102 +++++++ drivers/mfd/da9058-irq.c | 57 ++++ include/linux/mfd/da9058/bat.h | 33 +++ include/linux/mfd/da9058/codec.h | 21 ++ include/linux/mfd/da9058/core.h | 58 ++++ include/linux/mfd/da9058/gpio.h | 19 ++ include/linux/mfd/da9058/hwmon.h | 20 ++ include/linux/mfd/da9058/irq.h | 50 ++++ include/linux/mfd/da9058/onkey.h | 17 ++ include/linux/mfd/da9058/pdata.h | 28 ++ include/linux/mfd/da9058/registers.h | 480 ++++++++++++++++++++++++++++++++++ include/linux/mfd/da9058/regulator.h | 33 +++ include/linux/mfd/da9058/rtc.h | 17 ++ 16 files changed, 1224 insertions(+), 0 deletions(-) create mode 100644 drivers/mfd/da9058-core.c create mode 100644 drivers/mfd/da9058-i2c.c create mode 100644 drivers/mfd/da9058-irq.c create mode 100644 include/linux/mfd/da9058/bat.h create mode 100644 include/linux/mfd/da9058/codec.h create mode 100644 include/linux/mfd/da9058/core.h create mode 100644 include/linux/mfd/da9058/gpio.h create mode 100644 include/linux/mfd/da9058/hwmon.h create mode 100644 include/linux/mfd/da9058/irq.h create mode 100644 include/linux/mfd/da9058/onkey.h create mode 100644 include/linux/mfd/da9058/pdata.h create mode 100644 include/linux/mfd/da9058/registers.h create mode 100644 include/linux/mfd/da9058/regulator.h create mode 100644 include/linux/mfd/da9058/rtc.h
drivers/mfd/Kconfig +18 -0
@@ -3,6 +3,7 @@ # if HAS_IOMEM + menu "Multifunction device drivers" config MFD_CORE
@@ -20,6 +21,23 @@ config MFD_88PM860X select individual components like voltage regulators, RTC and battery-charger under the corresponding menus. +config MFD_DA9058 + tristate "Dialog Semiconductor DA9058 PMIC Support" + depends on I2C + select REGMAP_I2C + select REGMAP_IRQ + select MFD_CORE + help + Say yes here for support of Dialog Semiconductor DA9058. This is + a Power Management IC. This driver provides common support for + accessing the device as well as the I2C interface to the chip itself. + Additional drivers must be enabled in order to use the functionality + of the device. + + This driver can be built as a module, but since the functionality + of the device includes regulators it probably should be built into + the kernel. If built as a module it will be called "da9058" + config MFD_SM501 tristate "Support for Silicon Motion SM501" ---help---
drivers/mfd/Makefile +3 -0
@@ -86,6 +86,9 @@ obj-$(CONFIG_MFD_MAX8998) += max8998.o max8998-irq.o pcf50633-objs := pcf50633-core.o pcf50633-irq.o obj-$(CONFIG_MFD_PCF50633) += pcf50633.o +da9058-objs = da9058-irq.o da9058-i2c.o da9058-core.o da9058-info.o +obj-$(CONFIG_MFD_DA9058) += da9058.o + obj-$(CONFIG_PCF50633_ADC) += pcf50633-adc.o obj-$(CONFIG_PCF50633_GPIO) += pcf50633-gpio.o obj-$(CONFIG_ABX500_CORE) += abx500-core.o
drivers/mfd/da9058-core.c new file +268 -0
268 lines not on this page · raw message
drivers/mfd/da9058-i2c.c new file +102 -0
102 lines not on this page · raw message
drivers/mfd/da9058-irq.c new file +57 -0
57 lines not on this page · raw message
include/linux/mfd/da9058/bat.h new file +33 -0
@@ -0,0 +1,33 @@ +/* +* Copyright (C) 2012 Dialog Semiconductor Ltd. +* +* This program is free software; you can redistribute it and/or modify +* it under the terms of the GNU General Public License as published by +* the Free Software Foundation; either version 2 of the License, or +* (at your option) any later version. +* +*/ + +#ifndef __D1982_BAT_H +#define __D1982_BAT_H + +#define DA9058_LOOK_UP_TABLE_SIZE 68 + +struct da9058_temp_capacity { +int temperature; +u32 capacity[DA9058_LOOK_UP_TABLE_SIZE ][2 ]; +}; + +struct da9058_power_table { +int temperature_points; +struct da9058_temp_capacity (*temp_tables)[]; +}; + +struct da9058_power_pdata { +int battery_type; +int bat_low_limit; +int use_automatic_adc; +struct da9058_power_table *lookup_tables; +}; + +#endif /* __D1982_BAT_H */
include/linux/mfd/da9058/codec.h new file +21 -0
@@ -0,0 +1,21 @@ +/* +* Copyright (C) 2012 Dialog Semiconductor Ltd. +* +* This program is free software; you can redistribute it and/or modify +* it under the terms of the GNU General Public License as published by +* the Free Software Foundation; either version 2 of the License, or +* (at your option) any later version. +* +*/ + +#ifndef __DA9058_CODEC_H +#define __DA9058_CODEC_H + +struct da9058_codec_pdata { +int codec_irq; +int amplifier_initially_on; +int amp_control_reg; +int amp_enable_mask; +}; + +#endif /* __DA9058_CODEC_H */
include/linux/mfd/da9058/core.h new file +58 -0
58 lines not on this page · raw message
include/linux/mfd/da9058/gpio.h new file +19 -0
@@ -0,0 +1,19 @@ +/* +* Copyright (C) 2012 Dialog Semiconductor Ltd. +* +* This program is free software; you can redistribute it and/or modify +* it under the terms of the GNU General Public License as published by +* the Free Software Foundation; either version 2 of the License, or +* (at your option) any later version. +* +*/ + +#ifndef __D1982_GPIO_H +#define __D1982_GPIO_H + +struct da9058_gpio_pdata { +int ngpio; +int gpio_base; +}; + +#endif /* __D1982_GPIO_H */
include/linux/mfd/da9058/hwmon.h new file +20 -0
@@ -0,0 +1,20 @@ +/* +* Copyright (C) 2012 Dialog Semiconductor Ltd. +* +* This program is free software; you can redistribute it and/or modify +* it under the terms of the GNU General Public License as published by +* the Free Software Foundation; either version 2 of the License, or +* (at your option) any later version. +* +*/ + +#ifndef __DA9058_HWMON_H +#define __DA9058_HWMON_H + +struct da9058_hwmon_pdata { +int use_automatic_adc; +int temp_adc_resistance; +int vf_adc_resistance; +}; + +#endif /* __DA9058_HWMON_H */
include/linux/mfd/da9058/irq.h new file +50 -0
50 lines not on this page · raw message
include/linux/mfd/da9058/onkey.h new file +17 -0
@@ -0,0 +1,17 @@ +/* +* Copyright (C) 2012 Dialog Semiconductor Ltd. +* +* This program is free software; you can redistribute it and/or modify +* it under the terms of the GNU General Public License as published by +* the Free Software Foundation; either version 2 of the License, or +* (at your option) any later version. +* +*/ + +#ifndef __DA9058_ONKEY_H +#define __DA9058_ONKEY_H + +struct da9058_onkey_pdata { +}; + +#endif /* __DA9058_ONKEY_H */
include/linux/mfd/da9058/pdata.h new file +28 -0
@@ -0,0 +1,28 @@ +/* +* Copyright (C) 2012 Dialog Semiconductor Ltd. +* +* This program is free software; you can redistribute it and/or modify +* it under the terms of the GNU General Public License as published by +* the Free Software Foundation; either version 2 of the License, or +* (at your option) any later version. +* +*/ + +#ifndef __DA9058_PDATA_H +#define __DA9058_PDATA_H + +/* +* This is the Platform Data for the DA9058 PMIC chip as a whole. +*/ +struct da9058_chip_pdata { +int (*init_board_irq)(void ); +char *platform_description; +int battery_type; +int bat_low_limit; +int use_automatic_adc; +int temp_adc_resistance; +int vf_adc_resistance; +struct da9058_power_table *lookup_tables; +}; + +#endif /* __DA9058_PDATA_H */
include/linux/mfd/da9058/registers.h new file +480 -0
480 lines not on this page · raw message
include/linux/mfd/da9058/regulator.h new file +33 -0
@@ -0,0 +1,33 @@ +/* +* Copyright (C) 2012 Dialog Semiconductor Ltd. +* +* This program is free software; you can redistribute it and/or modify +* it under the terms of the GNU General Public License as published by +* the Free Software Foundation; either version 2 of the License, or +* (at your option) any later version. +* +*/ + +#ifndef __DA9058_REGULATOR_H +#define __DA9058_REGULATOR_H + +struct da9058_regulator_pdata { +char *regulator_name; +int regulator_id; +int min_uV; +int max_uV; +int control_voltage_step; +int control_register; +int control_enable_mask; +int ramp_register; +int ramp_enable_mask; +int fixed_voltage; +unsigned int valid_ops_mask; +unsigned int valid_modes_mask; +unsigned int always_on:1 ; +unsigned int boot_on:1 ; +int num_consumer_supplies; +struct regulator_consumer_supply *consumer_supplies; +}; + +#endif /* __DA9058_REGULATOR_H */
include/linux/mfd/da9058/rtc.h new file +17 -0
@@ -0,0 +1,17 @@ +/* +* Copyright (C) 2012 Dialog Semiconductor Ltd. +* +* This program is free software; you can redistribute it and/or modify +* it under the terms of the GNU General Public License as published by +* the Free Software Foundation; either version 2 of the License, or +* (at your option) any later version. +* +*/ + +#ifndef __DA9058_RTC_H +#define __DA9058_RTC_H + +struct da9058_rtc_pdata { +}; + +#endif /* __DA9058_RTC_H */
Signature · 1 line
end-of-patch for NEW DRIVER V2
Quoted 27 lines
-----Original Message-----
From: [email protected] [mailto:linux-kernel- [email protected]] On Behalf Of Anthony Olech
Sent: Monday, August 06, 2012 2:14 AM
To: Samuel Ortiz
Cc: Mark Brown; Arnd Bergmann; Mauro Carvalho Chehab; Steven Toth; Michael Krufky; LKML; David Dajun Chen
Subject: [NEW DRIVER V2 1/7] DA9058 MFD core and ADC driverThis is the MFD core driver for the Dialog DA9058 PMIC. This driver, via MFD CELLs, causes all the component drivers to be loaded, if it is a module, and initialized via their probe methods. It also provides access to the ADC functions on the PMIC. All the other component drivers depend on this one.
include/linux/mfd/da9058/pdata.h new file +1
-0+#endif /* __DA9058_PDATA_H */ include/linux/mfd/da9058/registers.h new file +4
-0@@ -0,0 +1,480 @@ +/* +* Copyright (C) 2012 Dialog Semiconductor Ltd. +* +* This program is free software; you can redistribute it and/or modify
include/linux/mfd/da9058/registers.h line 14
Quoted 10 lines
include/linux/mfd/da9058/registers.h new file +10
-0+* it under the terms of the GNU General Public License as published by +* the Free Software Foundation; either version 2 of the License, or +* (at your option) any later version. +* +*/ + +#ifndef __DA9058_REGISTERS_H +#define __DA9058_REGISTERS_H + +#define DA9058_PAGECON0_REG 0
You can remove _REG after each register name.
include/linux/mfd/da9058/registers.h
Quoted 9 lines
include/linux/mfd/da9058/registers.h new file +6
-0+#define DA9058_STATUSA_REG 1 +#define DA9058_STATUSB_REG 2 +#define DA9058_STATUSC_REG 3 +#define DA9058_STATUSD_REG 4 +/* RTC fields */ +#define DA9058_RTC_SECS_MASK 0x3F
Usually most of the PMIC RTCs provide RTC time registers in BCD Format. Plz make sure that is not the case with your device, otherwise these masks may not be valid.
Quoted 139 lines
include/linux/mfd/da9058/registers.h new file +67
-0+#define DA9058_RTC_MINS_MASK 0x3F +#define DA9058_RTC_HRS_MASK 0x1F +#define DA9058_RTC_DAY_MASK 0x1F +#define DA9058_RTC_MTH_MASK 0x0F +#define DA9058_RTC_YRS_MASK 0x3F +#define DA9058_RTC_ALMSECS_MASK 0x3F +#define DA9058_RTC_ALMMINS_MASK 0x3F +#define DA9058_RTC_ALMHRS_MASK 0x1F +#define DA9058_RTC_ALMDAY_MASK 0x1F +#define DA9058_RTC_ALMMTH_MASK 0x0F +#define DA9058_RTC_ALMYRS_MASK 0x3F +/* RTC TIMER SECONDS REGISTER */ +#define DA9058_COUNTS_COUNTSEC (63<<0) +/* RTC TIMER MINUTES REGISTER */ +#define DA9058_COUNTMI_COUNTMIN (63<<0) +/* RTC TIMER HOUR REGISTER */ +#define DA9058_COUNTH_COUNTHOUR (31<<0) +/* RTC TIMER DAYS REGISTER */ +#define DA9058_COUNTD_COUNTDAY (31<<0) +/* RTC TIMER MONTHS REGISTER */ +#define DA9058_COUNTMO_COUNTMONTH (15<<0) +/* RTC TIMER YEARS REGISTER */ +#define DA9058_COUNTY_MONITOR (1<<6) +#define DA9058_COUNTY_COUNTYEAR (63<<0) +/* RTC ALARM SECONDS REGISTER */ +#define DA9058_ALARMMI_COUNTSEC (63<<0) +/* RTC ALARM MINUTES REGISTER */ +#define DA9058_ALARMMI_TICKTYPE (1<<7) +#define DA9058_ALARMMI_ALARMMIN (63<<0) +/* RTC ALARM HOURS REGISTER */ +#define DA9058_ALARMH_ALARMHOUR (31<<0) +/* RTC ALARM DAYS REGISTER */ +#define DA9058_ALARMD_ALARMDAY (31<<0) +/* RTC ALARM MONTHS REGISTER */ +#define DA9058_ALARMMO_ALARMMONTH (15<<0) +/* RTC ALARM YEARS REGISTER */ +#define DA9058_ALARMY_TICKON (1<<7) +#define DA9058_ALARMY_ALARMON (1<<6) +#define DA9058_ALARMY_ALARMYEAR (63<<0) +/* CHIP IDENTIFICATION REGISTER */ +#define DA9058_CHIPID_MRC (15<<4) +#define DA9058_CHIPID_TRC (15<<0) +/* CONFIGURATION IDENTIFICATION REGISTER */ +#define DA9058_CONFIGID_CONFID (7<<0) +/* OTP CONTROL REGISTER */ +#define DA9058_OTPCONT_GPWRITEDIS (1<<7) +#define DA9058_OTPCONT_OTPCONFLOCK (1<<6) +#define DA9058_OTPCONT_OTPGPLOCK (1<<5) +#define DA9058_OTPCONT_OTPCONFG (1<<3) +#define DA9058_OTPCONT_OTPGP (1<<2) +#define DA9058_OTPCONT_OTPRP (1<<1) +#define DA9058_OTPCONT_OTPTRANSFER (1<<0) +/* RTC OSCILLATOR TRIM REGISTER */ +#define DA9058_OSCTRIM_TRIM32K (255<<0) +/* GP ID REGISTERs 0 - 9 */ +#define DA9058_GPID0_GP0 (255<<0) +#define DA9058_GPID1_GP1 (255<<0) +#define DA9058_GPID2_GP2 (255<<0) +#define DA9058_GPID3_GP3 (255<<0) +#define DA9058_GPID4_GP4 (255<<0) +#define DA9058_GPID5_GP5 (255<<0) +#define DA9058_GPID6_GP6 (255<<0) +#define DA9058_GPID7_GP7 (255<<0) +#define DA9058_GPID8_GP8 (255<<0) +#define DA9058_GPID9_GP9 (255<<0) + +#endif /* __DA9058_REGISTERS_H */ include/linux/mfd/da9058/regulator.h new file +33
-0@@ -0,0 +1,33 @@ +/* +* Copyright (C) 2012 Dialog Semiconductor Ltd. +* +* This program is free software; you can redistribute it and/or modify +* it under the terms of the GNU General Public License as published by +* the Free Software Foundation; either version 2 of the License, or +* (at your option) any later version. +* +*/ + +#ifndef __DA9058_REGULATOR_H +#define __DA9058_REGULATOR_H + +struct da9058_regulator_pdata { +char *regulator_name; +int regulator_id; +int min_uV; +int max_uV; +int control_voltage_step; +int control_register; +int control_enable_mask; +int ramp_register; +int ramp_enable_mask; +int fixed_voltage; +unsigned int valid_ops_mask; +unsigned int valid_modes_mask; +unsigned int always_on:1 ; +unsigned int boot_on:1 ; +int num_consumer_supplies; +struct regulator_consumer_supply *consumer_supplies; +}; + +#endif /* __DA9058_REGULATOR_H */ include/linux/mfd/da9058/rtc.h new file +17
-1@@ -0,0 +1,17 @@ +/* +* Copyright (C) 2012 Dialog Semiconductor Ltd. +* +* This program is free software; you can redistribute it and/or modify +* it under the terms of the GNU General Public License as published by +* the Free Software Foundation; either version 2 of the License, or +* (at your option) any later version. +* +*/ + +#ifndef __DA9058_RTC_H +#define __DA9058_RTC_H + +struct da9058_rtc_pdata { +}; + +#endif /* __DA9058_RTC_H */ --end-of-patch for NEW DRIVER V2
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Thanks Venu for the two comments,
(1) the RTC values are not encoded in BCD, I am adding a comment in the header file to that effect
(2) the "*_REG" naming convention is used for MFD component drivers, see directory include/linux/mfd for numerous examples
Tony Olech
-----Original Message-----
From: Venu Byravarasu [mailto:[email protected]]
Sent: 06 August 2012 09:38
To: Opensource [Anthony Olech]; Samuel Ortiz
Cc: Mark Brown; Arnd Bergmann; Mauro Carvalho Chehab; Steven Toth; Michael Krufky; LKML; David Dajun Chen
Subject: RE: [NEW DRIVER V2 1/7] DA9058 MFD core and ADC driver
Quoted 29 lines
-----Original Message-----
From: [email protected] [mailto:linux-kernel- [email protected]] On Behalf Of Anthony Olech
Sent: Monday, August 06, 2012 2:14 AM
To: Samuel Ortiz
Cc: Mark Brown; Arnd Bergmann; Mauro Carvalho Chehab; Steven Toth; Michael Krufky; LKML; David Dajun Chen
Subject: [NEW DRIVER V2 1/7] DA9058 MFD core and ADC driverThis is the MFD core driver for the Dialog DA9058 PMIC. This driver, via MFD CELLs, causes all the component drivers to be loaded, if it is a module, and initialized via their probe methods. It also provides access to the ADC functions on the PMIC. All the other component drivers depend on this one.
include/linux/mfd/da9058/pdata.h new file +1
-0+#endif /* __DA9058_PDATA_H */ include/linux/mfd/da9058/registers.h new file +6
-0@@ -0,0 +1,480 @@ +/* +* Copyright (C) 2012 Dialog Semiconductor Ltd. +* +* This program is free software; you can redistribute it and/or +modify +* it under the terms of the GNU General Public License as published
include/linux/mfd/da9058/registers.h line 16
Quoted 10 lines
include/linux/mfd/da9058/registers.h new file +10
-0+by +* the Free Software Foundation; either version 2 of the License, or +* (at your option) any later version. +* +*/ + +#ifndef __DA9058_REGISTERS_H +#define __DA9058_REGISTERS_H + +#define DA9058_PAGECON0_REG 0
You can remove _REG after each register name.
include/linux/mfd/da9058/registers.h
Quoted 9 lines
include/linux/mfd/da9058/registers.h new file +6
-0+#define DA9058_STATUSA_REG 1 +#define DA9058_STATUSB_REG 2 +#define DA9058_STATUSC_REG 3 +#define DA9058_STATUSD_REG 4 +/* RTC fields */ +#define DA9058_RTC_SECS_MASK 0x3F
Usually most of the PMIC RTCs provide RTC time registers in BCD Format. Plz make sure that is not the case with your device, otherwise these masks may not be valid.
Quoted 141 lines
include/linux/mfd/da9058/registers.h new file +67
-0+#define DA9058_RTC_MINS_MASK 0x3F +#define DA9058_RTC_HRS_MASK 0x1F +#define DA9058_RTC_DAY_MASK 0x1F +#define DA9058_RTC_MTH_MASK 0x0F +#define DA9058_RTC_YRS_MASK 0x3F +#define DA9058_RTC_ALMSECS_MASK 0x3F +#define DA9058_RTC_ALMMINS_MASK 0x3F +#define DA9058_RTC_ALMHRS_MASK 0x1F +#define DA9058_RTC_ALMDAY_MASK 0x1F +#define DA9058_RTC_ALMMTH_MASK 0x0F +#define DA9058_RTC_ALMYRS_MASK 0x3F +/* RTC TIMER SECONDS REGISTER */ +#define DA9058_COUNTS_COUNTSEC (63<<0) +/* RTC TIMER MINUTES REGISTER */ +#define DA9058_COUNTMI_COUNTMIN (63<<0) +/* RTC TIMER HOUR REGISTER */ +#define DA9058_COUNTH_COUNTHOUR (31<<0) +/* RTC TIMER DAYS REGISTER */ +#define DA9058_COUNTD_COUNTDAY (31<<0) +/* RTC TIMER MONTHS REGISTER */ +#define DA9058_COUNTMO_COUNTMONTH (15<<0) +/* RTC TIMER YEARS REGISTER */ +#define DA9058_COUNTY_MONITOR (1<<6) +#define DA9058_COUNTY_COUNTYEAR (63<<0) +/* RTC ALARM SECONDS REGISTER */ +#define DA9058_ALARMMI_COUNTSEC (63<<0) +/* RTC ALARM MINUTES REGISTER */ +#define DA9058_ALARMMI_TICKTYPE (1<<7) +#define DA9058_ALARMMI_ALARMMIN (63<<0) +/* RTC ALARM HOURS REGISTER */ +#define DA9058_ALARMH_ALARMHOUR (31<<0) +/* RTC ALARM DAYS REGISTER */ +#define DA9058_ALARMD_ALARMDAY (31<<0) +/* RTC ALARM MONTHS REGISTER */ +#define DA9058_ALARMMO_ALARMMONTH (15<<0) +/* RTC ALARM YEARS REGISTER */ +#define DA9058_ALARMY_TICKON (1<<7) +#define DA9058_ALARMY_ALARMON (1<<6) +#define DA9058_ALARMY_ALARMYEAR (63<<0) +/* CHIP IDENTIFICATION REGISTER */ +#define DA9058_CHIPID_MRC (15<<4) +#define DA9058_CHIPID_TRC (15<<0) +/* CONFIGURATION IDENTIFICATION REGISTER */ +#define DA9058_CONFIGID_CONFID (7<<0) +/* OTP CONTROL REGISTER */ +#define DA9058_OTPCONT_GPWRITEDIS (1<<7) +#define DA9058_OTPCONT_OTPCONFLOCK (1<<6) +#define DA9058_OTPCONT_OTPGPLOCK (1<<5) +#define DA9058_OTPCONT_OTPCONFG (1<<3) +#define DA9058_OTPCONT_OTPGP (1<<2) +#define DA9058_OTPCONT_OTPRP (1<<1) +#define DA9058_OTPCONT_OTPTRANSFER (1<<0) +/* RTC OSCILLATOR TRIM REGISTER */ +#define DA9058_OSCTRIM_TRIM32K (255<<0) +/* GP ID REGISTERs 0 - 9 */ +#define DA9058_GPID0_GP0 (255<<0) +#define DA9058_GPID1_GP1 (255<<0) +#define DA9058_GPID2_GP2 (255<<0) +#define DA9058_GPID3_GP3 (255<<0) +#define DA9058_GPID4_GP4 (255<<0) +#define DA9058_GPID5_GP5 (255<<0) +#define DA9058_GPID6_GP6 (255<<0) +#define DA9058_GPID7_GP7 (255<<0) +#define DA9058_GPID8_GP8 (255<<0) +#define DA9058_GPID9_GP9 (255<<0) + +#endif /* __DA9058_REGISTERS_H */ include/linux/mfd/da9058/regulator.h new file +34
-0@@ -0,0 +1,33 @@ +/* +* Copyright (C) 2012 Dialog Semiconductor Ltd. +* +* This program is free software; you can redistribute it and/or +modify +* it under the terms of the GNU General Public License as published +by +* the Free Software Foundation; either version 2 of the License, or +* (at your option) any later version. +* +*/ + +#ifndef __DA9058_REGULATOR_H +#define __DA9058_REGULATOR_H + +struct da9058_regulator_pdata { +char *regulator_name; +int regulator_id; +int min_uV; +int max_uV; +int control_voltage_step; +int control_register; +int control_enable_mask; +int ramp_register; +int ramp_enable_mask; +int fixed_voltage; +unsigned int valid_ops_mask; +unsigned int valid_modes_mask; +unsigned int always_on:1 ; +unsigned int boot_on:1 ; +int num_consumer_supplies; +struct regulator_consumer_supply *consumer_supplies; }; + +#endif /* __DA9058_REGULATOR_H */ (quoted diff) +0
-0
b/include/linux/mfd/da9058/rtc.hnew file mode 100644 index 0000000..aa597dfinclude/linux/mfd/da9058/rtc.h new file +19
-1@@ -0,0 +1,17 @@ +/* +* Copyright (C) 2012 Dialog Semiconductor Ltd. +* +* This program is free software; you can redistribute it and/or +modify +* it under the terms of the GNU General Public License as published +by +* the Free Software Foundation; either version 2 of the License, or +* (at your option) any later version. +* +*/ + +#ifndef __DA9058_RTC_H +#define __DA9058_RTC_H + +struct da9058_rtc_pdata { +}; + +#endif /* __DA9058_RTC_H */ --end-of-patch for NEW DRIVER V2
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
drivers/mfd/Kconfig line 7
Quoted 6 lines · Anthony Olech
drivers/mfd/Kconfig +1
-0@@ -3,6 +3,7 @@ # if HAS_IOMEM + menu "Multifunction device drivers"
Hrm?
drivers/mfd/da9058-core.c line 44
Quoted 3 lines
drivers/mfd/da9058-core.c new file +3
-0+static int da9058_automatic_adc_conversion (struct da9058 *da9058, +const int channel,int *value) +{
I see you've ignored my comments about using IIO.
drivers/mfd/da9058-core.c line 222
Quoted 10 lines
drivers/mfd/da9058-core.c new file +10
-0+/* +* the init_board_irq() call-back function should be defined in +* the machine driver initialization code and is used to set up +* the actual (probably GPIO) line as an interrupt line. +*/ +if (pdata->init_board_irq) { + ret = pdata->init_board_irq (); +if (ret) + goto failed_to_setup_the_actual_i2c_hw_irq; + }
Why on earth do you need this? This should not be needed with modern kernels, especially not for the documented purpose.
drivers/mfd/da9058-i2c.c line 33
Quoted 1 line
drivers/mfd/da9058-i2c.c new file +1
-0+ regmap =devm_regmap_init_i2c (i2c, &da9058_regmap_config);
Does the device support any other control interfaces?
You've also not defined the regmap config which means that this patch will break the build. This suggests these patches haven't been tested...