mfd: Add TI LMU driver
PATCH 1/10 mfd: Add TI LMU driver
TI LMU (Lighting Management Unit) driver supports lighting devices such like LM3532, LM3631, LM3633, LM3695 and LM3697.
LMU devices has common features as below.
- I2C interface for accessing device registers
- Hardware enable pin control
- Backlight brightness control
- Light effect driver for backlight and LED patterns
It contains backlight, light effect, LED and regulator driver.
Backlight
---------
It's handled by TI LMU backlight common driver and chip dependent driver. Please refer to separate patches for ti-lmu-backlight.
Light effect
------------
LMU effect driver is used for setting any light effects. Each device has specific time value and register map. Backlight and LED driver can use consitent APIs for light effects.
There are two lists for effect management. LMU effect list and pending list. Light effect list is added when ti-lmu-effect driver is loaded by referencing platform resource data.
However, it can be a problem because some LMU device requests the effect in advance of loading ti-lmu-effect driver.
For example, LM3532 backlight driver requests light ramp effects before ti-lmu-effect is loaded.
Then, requested effect can not be handled because it doesn't exist in the list. To solve this situation, pending request list is used.
If requested effect is not in the list, just insert it into the pending list. And then pending request is handled as soon as the effect is added.
LED indicator
-------------
LM3633 has 6 indicator LEDs. Programmable pattern is supported.
Regulator
---------
LM3631 has 5 regulators for the display bias.
--- drivers/mfd/Kconfig | 12 + drivers/mfd/Makefile | 1 + drivers/mfd/ti-lmu-effect.c | 328 +++++++++++++++++++++++++ drivers/mfd/ti-lmu.c | 464 +++++++++++++++++++++++++++++++++++ include/linux/mfd/ti-lmu-effect.h | 109 ++++++++ include/linux/mfd/ti-lmu-register.h | 269 ++++++++++++++++++++ include/linux/mfd/ti-lmu.h | 150 +++++++++++ 7 files changed, 1333 insertions(+) create mode 100644 drivers/mfd/ti-lmu-effect.c create mode 100644 drivers/mfd/ti-lmu.c create mode 100644 include/linux/mfd/ti-lmu-effect.h create mode 100644 include/linux/mfd/ti-lmu-register.h create mode 100644 include/linux/mfd/ti-lmu.h
drivers/mfd/Kconfig +12 -0
@@ -784,6 +784,18 @@ config MFD_PALMAS If you say yes here you get support for the Palmas series of PMIC chips from Texas Instruments. +config MFD_TI_LMU + tristate "TI Lighting Management Unit driver" + depends on I2C + select MFD_CORE + select REGMAP_I2C + help + Say yes here to enable support for TI LMU chips. + + TI LMU MFD supports LM3532, LM3631, LM3633, LM3695 and LM3697. + It consists of backlight, light effect, LED and regulator driver. + It provides consistent device controls for lighting functions. + config MFD_TI_SSP tristate "TI Sequencer Serial Port support" depends on ARCH_DAVINCI_TNETV107X
drivers/mfd/Makefile +1 -0
@@ -22,6 +22,7 @@ obj-$(CONFIG_HTC_I2CPLD) += htc-i2cpld.o obj-$(CONFIG_MFD_DAVINCI_VOICECODEC) += davinci_voicecodec.o obj-$(CONFIG_MFD_DM355EVM_MSP) += dm355evm_msp.o +obj-$(CONFIG_MFD_TI_LMU) += ti-lmu.o ti-lmu-effect.o obj-$(CONFIG_MFD_TI_SSP) += ti-ssp.o obj-$(CONFIG_MFD_TI_AM335X_TSCADC) += ti_am335x_tscadc.o
drivers/mfd/ti-lmu-effect.c new file +328 -0
328 lines not on this page · raw message
drivers/mfd/ti-lmu.c new file +464 -0
464 lines not on this page · raw message
include/linux/mfd/ti-lmu-effect.h new file +109 -0
109 lines not on this page · raw message
include/linux/mfd/ti-lmu-register.h new file +269 -0
269 lines not on this page · raw message
include/linux/mfd/ti-lmu.h new file +150 -0
150 lines not on this page · raw message
Signature · 6 lines
1.7.9.5 -- To unsubscribe from this list: send the line "unsubscribe devicetree" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html
Quoted 60 lines
TI LMU (Lighting Management Unit) driver supports lighting devices such like LM3532, LM3631, LM3633, LM3695 and LM3697.
LMU devices has common features as below.
- I2C interface for accessing device registers
- Hardware enable pin control
- Backlight brightness control
- Light effect driver for backlight and LED patternsIt contains backlight, light effect, LED and regulator driver.
Backlight
---------
It's handled by TI LMU backlight common driver and chip dependent driver. Please refer to separate patches for ti-lmu-backlight.Light effect
------------
LMU effect driver is used for setting any light effects. Each device has specific time value and register map. Backlight and LED driver can use consitent APIs for light effects.There are two lists for effect management. LMU effect list and pending list. Light effect list is added when ti-lmu-effect driver is loaded by referencing platform resource data.
However, it can be a problem because some LMU device requests the effect in advance of loading ti-lmu-effect driver.For example, LM3532 backlight driver requests light ramp effects before ti-lmu-effect is loaded.
Then, requested effect can not be handled because it doesn't exist in the list. To solve this situation, pending request list is used.
If requested effect is not in the list, just insert it into the pending list. And then pending request is handled as soon as the effect is added.LED indicator
-------------
LM3633 has 6 indicator LEDs. Programmable pattern is supported.Regulator
---------
LM3631 has 5 regulators for the display bias.Cc Samuel Ortiz <sameo-VuQAYsv1563Yd54FQh9/[email protected]>Cc Lee Jones <[email protected]>Signed-off-by Milo Kim <[email protected]>--- drivers/mfd/Kconfig | 12 + drivers/mfd/Makefile | 1 + drivers/mfd/ti-lmu-effect.c | 328 +++++++++++++++++++++++++ drivers/mfd/ti-lmu.c | 464 +++++++++++++++++++++++++++++++++++ include/linux/mfd/ti-lmu-effect.h | 109 ++++++++ include/linux/mfd/ti-lmu-register.h | 269 ++++++++++++++++++++ include/linux/mfd/ti-lmu.h | 150 +++++++++++ 7 files changed, 1333 insertions(+) create mode 100644 drivers/mfd/ti-lmu-effect.c create mode 100644 drivers/mfd/ti-lmu.c create mode 100644 include/linux/mfd/ti-lmu-effect.h create mode 100644 include/linux/mfd/ti-lmu-register.h create mode 100644 include/linux/mfd/ti-lmu.h
<snip>
Quoted 19 lines
drivers/mfd/ti-lmu-effect.c new file +19
-0+static u8 ti_lmu_effect_get_ramp_index (struct ti_lmu_effect *lmu_effect, +int msec) +{ +const int *table =NULL ; +int size =0 ; +int index =0 ; +int i; + +switch (lmu_effect->lmu->id) { +case LM3532 : + table = lm3532_ramp_table; + size =ARRAY_SIZE (lm3532_ramp_table); +break ; +case LM3631 : + table = lm3631_ramp_table; + size =ARRAY_SIZE (lm3631_ramp_table); +break ; +case LM3633 : +case LM3697 :/* LM3697 has same ramp table as LM3633 */
drivers/mfd/ti-lmu-effect.c line 94
Quoted 10 lines
drivers/mfd/ti-lmu-effect.c new file +10
-0+ table = lm3633_ramp_table; + size =ARRAY_SIZE (lm3633_ramp_table); +break ; +default : +break ; + } + +if (msec <= table[0 ]) { + index =0 ; + goto out;
Just:
return 0;
drivers/mfd/ti-lmu-effect.c line 99
Quoted 5 lines
drivers/mfd/ti-lmu-effect.c new file +5
-0+ } + +if (msec >= table[size-1 ]) { + index = size -1 ; + goto out;
Just:
return index;
drivers/mfd/ti-lmu-effect.c line 106
Quoted 7 lines
drivers/mfd/ti-lmu-effect.c new file +7
-0+ } + +/* Find appropriate register index from the table */ +for (i =1 ; i < size; i++) { +if (msec >= table[i-1 ] && msec < table[i]) { + index = i -1 ; + goto out;
Same here.
drivers/mfd/ti-lmu-effect.c line 112
Quoted 6 lines
drivers/mfd/ti-lmu-effect.c new file +6
-0+ } + } + +return 0 ; +out: +return index;
Remove this.
Quoted 14 lines
drivers/mfd/ti-lmu-effect.c new file +14
-0+} + +static u8 ti_lmu_effect_get_time_index (struct ti_lmu_effect *lmu_effect, +int msec) +{ +u8 idx, offset; + +/* +* Find appropriate register index around input time value +* +* 0 <= time <= 1000 : 16ms step +* 1000 < time <= 9700 : 131ms step, base index is 61 +*/ +
drivers/mfd/ti-lmu-effect.c line 136
Quoted 10 lines
drivers/mfd/ti-lmu-effect.c new file +10
-0+ msec =min_t (int, msec,LMU_EFFECT_MAX_TIME_PERIOD ); + +if (msec >=0 && msec <=1000 ) { + idx = msec /16 ; +if (idx >1 ) + idx--; + offset =0 ; + }else { + idx = (msec -1000 ) /131 ; + offset =61 ;
What are 131 and 61? Sounds like magic, require #defines or at least a comment.
<snip>
drivers/mfd/ti-lmu-effect.c line 166
Quoted 3 lines
drivers/mfd/ti-lmu-effect.c new file +3
-0+if (lmu_effect) { +cbfunc (lmu_effect, req_id, data); + goto out;
This doesn't do anything. Just return from here.
Quoted 1 line
(quoted diff) +1
-0+ }
<snip>
Quoted 4 lines
drivers/mfd/ti-lmu-effect.c new file +4
-0+out: +return 0 ; +} +EXPORT_SYMBOL_GPL (ti_lmu_effect_request);
<snip>
Quoted 6 lines
drivers/mfd/ti-lmu.c new file +0
-0
drivers/mfd/ti-lmu.c line 10
Quoted 10 lines
drivers/mfd/ti-lmu.c new file +10
-0@@ -0,0 +1,464 @@ +/* +* TI LMU(Lighting Management Unit) Core Driver +* +* Copyright 2014 Texas Instruments +* +* Author: Milo Kim <[email protected]> +* +* 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.
Move this to the bottom of the header.
Quoted 5 lines
drivers/mfd/ti-lmu.c new file +5
-0+* LMU MFD supports LM3532, LM3631, LM3633, LM3695 and LM3697. +* +* LM3532: backlight + light effect +* LM3631: backlight + light effect + regulators +* LM3633: backlight + light effect + LED indicators
drivers/mfd/ti-lmu.c line 26
Quoted 10 lines
drivers/mfd/ti-lmu.c new file +10
-0+* LM3695: backlight +* LM3697: backlight + light effect +* +* Those devices have common features as below. +* +* - I2C interface for accessing device registers +* - Hardware enable pin control +* - Backlight brightness control with current settings +* - Light effect driver for backlight and LED patterns +*/
kernel.h?module.h?
Quoted 15 lines
drivers/mfd/ti-lmu.c new file +15
-0+#include <linux/delay.h> +#include <linux/err.h> +#include <linux/gpio.h> +#include <linux/i2c.h> +#include <linux/mfd/core.h> +#include <linux/mfd/ti-lmu.h> +#include <linux/mfd/ti-lmu-effect.h> +#include <linux/mfd/ti-lmu-register.h> +#include <linux/module.h> +#include <linux/of.h> +#include <linux/of_gpio.h> +#include <linux/slab.h> + +#define LMU_IMAX_OFFSET 6 +
<snip>
Quoted 57 lines
drivers/mfd/ti-lmu.c new file +57
-0+static const struct resource lm3633_effect_resources[] = { + { + .name =LM3633_EFFECT_BL0_RAMPUP , + .flags =IORESOURCE_REG , + .start =LM3633_EFFECT_REGISTER (BL0_RAMPUP ), + }, + { + .name =LM3633_EFFECT_BL0_RAMPDOWN , + .flags =IORESOURCE_REG , + .start =LM3633_EFFECT_REGISTER (BL0_RAMPDN ), + }, + { + .name =LM3633_EFFECT_BL1_RAMPUP , + .flags =IORESOURCE_REG , + .start =LM3633_EFFECT_REGISTER (BL1_RAMPUP ), + }, + { + .name =LM3633_EFFECT_BL1_RAMPDOWN , + .flags =IORESOURCE_REG , + .start =LM3633_EFFECT_REGISTER (BL1_RAMPDN ), + }, + { + .name =LM3633_EFFECT_PTN_DELAY , + .flags =IORESOURCE_REG , + .start =LM3633_EFFECT_REGISTER (DELAY ), + }, + { + .name =LM3633_EFFECT_PTN_HIGHTIME , + .flags =IORESOURCE_REG , + .start =LM3633_EFFECT_REGISTER (HIGHTIME ), + }, + { + .name =LM3633_EFFECT_PTN_LOWTIME , + .flags =IORESOURCE_REG , + .start =LM3633_EFFECT_REGISTER (LOWTIME ), + }, + { + .name =LM3633_EFFECT_PTN0_RAMPUP , + .flags =IORESOURCE_REG , + .start =LM3633_EFFECT_REGISTER (PTN0_RAMPUP ), + }, + { + .name =LM3633_EFFECT_PTN0_RAMPDOWN , + .flags =IORESOURCE_REG , + .start =LM3633_EFFECT_REGISTER (PTN0_RAMPDN ), + }, + { + .name =LM3633_EFFECT_PTN1_RAMPUP , + .flags =IORESOURCE_REG , + .start =LM3633_EFFECT_REGISTER (PTN1_RAMPUP ), + }, + { + .name =LM3633_EFFECT_PTN1_RAMPDOWN , + .flags =IORESOURCE_REG , + .start =LM3633_EFFECT_REGISTER (PTN1_RAMPDN ), + }, + {
drivers/mfd/ti-lmu.c line 168
Quoted 10 lines
drivers/mfd/ti-lmu.c new file +10
-0+ .name = LM3633_EFFECT_PTN_LOWBRT, + .flags = IORESOURCE_REG, + .start = LM3633_EFFECT_REGISTER(LOWBRT), + }, + { + .name = LM3633_EFFECT_PTN_HIGHBRT, + .flags = IORESOURCE_REG, + .start = LM3633_EFFECT_REGISTER(HIGHBRT), + }, +};
Can you define a MACRO to do all of these as one liners?
<snip>
Quoted 2 lines
drivers/mfd/ti-lmu.c new file +2
-0+static int ti_lmu_parse_dt (struct device *dev,struct ti_lmu *lmu) +{
<snip>
drivers/mfd/ti-lmu.c line 351
Quoted 1 line
drivers/mfd/ti-lmu.c new file +1
-0+ pdata->en_gpio =of_get_named_gpio (node,"ti,enable-gpio" ,0 );
There is a global DT property for this already.
Quoted 2 lines
drivers/mfd/ti-lmu.c new file +2
-0+static int ti_lmu_probe (struct i2c_client *cl,const struct i2c_device_id *id) +{
<snip>
Quoted 10 lines
drivers/mfd/ti-lmu.c new file +10
-0+ lmu->id = id->driver_data; +switch (lmu->id) { +case LM3532 : + lmu_regmap_config.max_register =LM3532_MAX_REGISTERS ; +break ; +case LM3631 : + lmu_regmap_config.max_register =LM3631_MAX_REGISTERS ; +break ; +case LM3633 : + lmu_regmap_config.max_register =LM3633_MAX_REGISTERS ;
drivers/mfd/ti-lmu.c line 401
Quoted 10 lines
drivers/mfd/ti-lmu.c new file +10
-0+break ; +case LM3695 : + lmu_regmap_config.max_register =LM3695_MAX_REGISTERS ; +break ; +case LM3697 : + lmu_regmap_config.max_register =LM3697_MAX_REGISTERS ; +break ; +default : +break ; + }
As there are so many of these, it might be nicer to pull these out into a seperate function.
<snip>
Signature · 8 lines
Lee Jones Linaro STMicroelectronics Landing Team Lead Linaro.org │ Open source software for ARM SoCs Follow Linaro: Facebook | Twitter | Blog -- To unsubscribe from this list: send the line "unsubscribe devicetree" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html
Hi Lee,
Quoted 61 lines · Lee Jones
Quoted 61 lines
drivers/mfd/ti-lmu.c new file +61
-0+static const struct resource lm3633_effect_resources[] = { + { + .name =LM3633_EFFECT_BL0_RAMPUP , + .flags =IORESOURCE_REG , + .start =LM3633_EFFECT_REGISTER (BL0_RAMPUP ), + }, + { + .name =LM3633_EFFECT_BL0_RAMPDOWN , + .flags =IORESOURCE_REG , + .start =LM3633_EFFECT_REGISTER (BL0_RAMPDN ), + }, + { + .name =LM3633_EFFECT_BL1_RAMPUP , + .flags =IORESOURCE_REG , + .start =LM3633_EFFECT_REGISTER (BL1_RAMPUP ), + }, + { + .name =LM3633_EFFECT_BL1_RAMPDOWN , + .flags =IORESOURCE_REG , + .start =LM3633_EFFECT_REGISTER (BL1_RAMPDN ), + }, + { + .name =LM3633_EFFECT_PTN_DELAY , + .flags =IORESOURCE_REG , + .start =LM3633_EFFECT_REGISTER (DELAY ), + }, + { + .name =LM3633_EFFECT_PTN_HIGHTIME , + .flags =IORESOURCE_REG , + .start =LM3633_EFFECT_REGISTER (HIGHTIME ), + }, + { + .name =LM3633_EFFECT_PTN_LOWTIME , + .flags =IORESOURCE_REG , + .start =LM3633_EFFECT_REGISTER (LOWTIME ), + }, + { + .name =LM3633_EFFECT_PTN0_RAMPUP , + .flags =IORESOURCE_REG , + .start =LM3633_EFFECT_REGISTER (PTN0_RAMPUP ), + }, + { + .name =LM3633_EFFECT_PTN0_RAMPDOWN , + .flags =IORESOURCE_REG , + .start =LM3633_EFFECT_REGISTER (PTN0_RAMPDN ), + }, + { + .name =LM3633_EFFECT_PTN1_RAMPUP , + .flags =IORESOURCE_REG , + .start =LM3633_EFFECT_REGISTER (PTN1_RAMPUP ), + }, + { + .name =LM3633_EFFECT_PTN1_RAMPDOWN , + .flags =IORESOURCE_REG , + .start =LM3633_EFFECT_REGISTER (PTN1_RAMPDN ), + }, + { + .name =LM3633_EFFECT_PTN_LOWBRT , + .flags =IORESOURCE_REG , + .start =LM3633_EFFECT_REGISTER (LOWBRT ), + },
Quoted 8 lines
drivers/mfd/ti-lmu.c line 168
Quoted 6 lines
drivers/mfd/ti-lmu.c new file +6
-0+ { + .name = LM3633_EFFECT_PTN_HIGHBRT, + .flags = IORESOURCE_REG, + .start = LM3633_EFFECT_REGISTER(HIGHBRT), + }, +};Can you define a MACRO to do all of these as one liners?
Yes, resource definitions will be replaced by simple macro, LMU_EFFECT_RESOURCE().
For example,
#define LMU_EFFECT_RESOURCE(chip, effect) \
{ \
.name = chip##_EFFECT_##effect, \
.flags = IORESOURCE_REG, \
.start = LMU_EFFECT_REGISTER(chip, effect), \}
static const struct resource lm3633_effect_resources[] = {
LMU_EFFECT_RESOURCE(LM3633, BL0_RAMPUP),
LMU_EFFECT_RESOURCE(LM3633, BL0_RAMPDN),
LMU_EFFECT_RESOURCE(LM3633, BL1_RAMPUP),
LMU_EFFECT_RESOURCE(LM3633, BL1_RAMPDN),
LMU_EFFECT_RESOURCE(LM3633, PTN_DELAY),
LMU_EFFECT_RESOURCE(LM3633, PTN_HIGHTIME),
LMU_EFFECT_RESOURCE(LM3633, PTN_LOWTIME),
LMU_EFFECT_RESOURCE(LM3633, PTN0_RAMPUP),
LMU_EFFECT_RESOURCE(LM3633, PTN0_RAMPDN),
LMU_EFFECT_RESOURCE(LM3633, PTN1_RAMPUP),
LMU_EFFECT_RESOURCE(LM3633, PTN1_RAMPDN),
LMU_EFFECT_RESOURCE(LM3633, PTN_LOWBRT),
LMU_EFFECT_RESOURCE(LM3633, PTN_HIGHBRT),
};static const struct resource lm3697_effect_resources[] = {
LMU_EFFECT_RESOURCE(LM3697, BL0_RAMPUP),
LMU_EFFECT_RESOURCE(LM3697, BL0_RAMPDN),
LMU_EFFECT_RESOURCE(LM3697, BL1_RAMPUP),
LMU_EFFECT_RESOURCE(LM3697, BL1_RAMPDN),
};and so on.
Quoted 10 lines
<snip>
Quoted 2 lines
drivers/mfd/ti-lmu.c new file +2
-0+static int ti_lmu_parse_dt (struct device *dev,struct ti_lmu *lmu) +{<snip>
drivers/mfd/ti-lmu.c line 351
Quoted 1 line
drivers/mfd/ti-lmu.c new file +1
-0+ pdata->en_gpio =of_get_named_gpio (node,"ti,enable-gpio" ,0 );There is a global DT property for this already.
I've not found it yet, but I agree it looks like general property. So I'll replace "ti,enable-gpio" with "ti,lmu-en-gpio".
Quoted 21 lines
Quoted 3 lines
drivers/mfd/ti-lmu.c new file +2
-0+static int ti_lmu_probe (struct i2c_client *cl,const struct i2c_device_id *id) +{<snip>
Quoted 15 lines
drivers/mfd/ti-lmu.c new file +15
-0+ lmu->id = id->driver_data; +switch (lmu->id) { +case LM3532 : + lmu_regmap_config.max_register =LM3532_MAX_REGISTERS ; +break ; +case LM3631 : + lmu_regmap_config.max_register =LM3631_MAX_REGISTERS ; +break ; +case LM3633 : + lmu_regmap_config.max_register =LM3633_MAX_REGISTERS ; +break ; +case LM3695 : + lmu_regmap_config.max_register =LM3695_MAX_REGISTERS ; +break ; +case LM3697 :
Quoted 8 lines
drivers/mfd/ti-lmu.c line 401
Quoted 5 lines
drivers/mfd/ti-lmu.c new file +5
-0+ lmu_regmap_config.max_register =LM3697_MAX_REGISTERS ; +break ; +default : +break ; + }As there are so many of these, it might be nicer to pull these out into a seperate function.
Lines of code will be moved to new function, ti_lmu_regmap_init().
Thanks for your review.
Best regards,
Milo
--
To unsubscribe from this list: send the line "unsubscribe devicetree" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html
Quoted 6 lines
Quoted 6 lines
Quoted 6 lines
drivers/mfd/ti-lmu.c new file +6
-0+static const struct resource lm3633_effect_resources[] = { + { + .name =LM3633_EFFECT_BL0_RAMPUP , + .flags =IORESOURCE_REG , + .start =LM3633_EFFECT_REGISTER (BL0_RAMPUP ), + },
<snip>
Quoted 23 lines
Quoted 8 lines
drivers/mfd/ti-lmu.c line 168
Quoted 6 lines
drivers/mfd/ti-lmu.c new file +6
-0+ { + .name = LM3633_EFFECT_PTN_HIGHBRT, + .flags = IORESOURCE_REG, + .start = LM3633_EFFECT_REGISTER(HIGHBRT), + }, +};Can you define a MACRO to do all of these as one liners?
Yes, resource definitions will be replaced by simple macro,
LMU_EFFECT_RESOURCE().For example,
#define LMU_EFFECT_RESOURCE(chip, effect) \ { \ .name = chip##_EFFECT_##effect, \ .flags = IORESOURCE_REG, \ .start = LMU_EFFECT_REGISTER(chip, effect), \}
static const struct resource lm3633_effect_resources[] = { LMU_EFFECT_RESOURCE(LM3633, BL0_RAMPUP),
<snip>
Quoted 4 lines
LMU_EFFECT_RESOURCE(LM3633, PTN_HIGHBRT), };and so on.
Yes, this is what I had in mind.
Quoted 6 lines
Quoted 3 lines
drivers/mfd/ti-lmu.c line 351
Quoted 1 line
drivers/mfd/ti-lmu.c new file +1
-0+ pdata->en_gpio =of_get_named_gpio (node,"ti,enable-gpio" ,0 );There is a global DT property for this already.
I've not found it yet, but I agree it looks like general property. So I'll replace "ti,enable-gpio" with "ti,lmu-en-gpio".
Just re-use "gpio-enable". No need for it to be vendor specific.
Signature · 8 lines
Lee Jones Linaro STMicroelectronics Landing Team Lead Linaro.org │ Open source software for ARM SoCs Follow Linaro: Facebook | Twitter | Blog -- To unsubscribe from this list: send the line "unsubscribe devicetree" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html
Hi Lee,
Quoted 9 lines · Lee Jones
Quoted 6 lines
Quoted 3 lines
drivers/mfd/ti-lmu.c line 351
Quoted 1 line
drivers/mfd/ti-lmu.c new file +1
-0+ pdata->en_gpio =of_get_named_gpio (node,"ti,enable-gpio" ,0 );There is a global DT property for this already.
I've not found it yet, but I agree it looks like general property. So I'll replace "ti,enable-gpio" with "ti,lmu-en-gpio".
Just re-use "gpio-enable". No need for it to be vendor specific.
Got it. Thanks!
This GPIO is used for enabling the device. So, "enable-gpio" is more appropriate name, isn't it?
Best regards,
Milo
--
To unsubscribe from this list: send the line "unsubscribe devicetree" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html
Quoted 7 lines
Quoted 7 lines
Quoted 6 lines
Quoted 3 lines
drivers/mfd/ti-lmu.c line 351
Quoted 1 line
drivers/mfd/ti-lmu.c new file +1
-0+ pdata->en_gpio =of_get_named_gpio (node,"ti,enable-gpio" ,0 );There is a global DT property for this already.
I've not found it yet, but I agree it looks like general property. So I'll replace "ti,enable-gpio" with "ti,lmu-en-gpio".
Quoted 7 lines
Quoted 2 lines
Just re-use "gpio-enable". No need for it to be vendor specific.
Got it. Thanks!
This GPIO is used for enabling the device. So, "enable-gpio" is more appropriate name, isn't it?
Yes, I wrote it the wrong way round (typo).
Just grep for both, you will see which one to use.
Signature · 4 lines
Lee Jones Linaro STMicroelectronics Landing Team Lead Linaro.org │ Open source software for ARM SoCs Follow Linaro: Facebook | Twitter | Blog