Re: [PATCH v11 0/6] Add Skyworks SKY81452 device drivers
On Fri, Feb 27, 2015 at 08:39:38PM +, Lee Jones wrote: > On Fri, 27 Feb 2015, gyun...@gmail.com wrote: > > > From: Gyungoh Yoo > > > > This patch set includes regulator and backlight driver for SKY81452. > > Also it includes documents for device tree and module. > > sky81452-regulator was already applied. So this series doesn't > > include it. > > > > v11: > > Renamed 'skyworks,en-channels' property to led-sources. > > Removed unused property 'skyworks,ovp-level'. > > > > v10: > > Removed trivial get_brightness implementations for sky81452-backlight > > > > v9: > > Removed the change to remove MODULE_VERSION() for sky81452-regulator > > > > v8: > > Renamed property names for backlight with vendor prefix > > Modified gpio-enable property to generic property for GPIO > > Made up the example for backlight DT > > Changed the DT parsing of regulator using regulator_node and of_match > > > > v7: > > Modified licensing text to GPLv2 > > Split Kconfig renaming from DT patch > > > > v6: > > Added new line character at the end of line of dev_err() > > > > v5: > > Changed DT for regulator : 'lout' node should be defined under 'regulator' > > Removed compatible string from sky81452-regulator driver > > Modified sky81452-regulator to return EINVAL when of_node is NULL > > Move sky81452-backlight.h to include/linux/platform_data > > > > v4: > > Removed MODULE_VERSION() > > Modified license to GPLv2 > > Removed calling to backlight_device_unregister() in sky81452-backlight > > > > v3: > > Cleaned-up DBG messages > > Cleaned-up DT > > Fixed the backlight name from 'sky81452-bl' to 'sky81452-backlight' > > Assigned mfd_cell.of_compatible for binding device node > > Modified error messages > > Modified sky81452-regulator to return ENODATA when of_node is NULL > > > > v2: > > Split the patches for each sub-system > > Added 'reg' attribute for I2C address in device tree documents > > Added 'compatible' attribute in child drivers > > Renamed CONFIG_SKY81452 to CONFIG_MFD_SKY81452 > > Changed the dependency from I2C=y to I2C, for CONFIG_MFD_SKY81452 > > Added message for exception or errors. > > Added vendor prefix for Skyworks Solutions, Inc. > > Add SKY81452 to the Trivial Devices list > > > > Gyungoh Yoo (6): > > mfd: Add support for Skyworks SKY81452 driver > > backlight: Add support Skyworks SKY81452 backlight driver > > devicetree: Add new SKY81452 mfd binding > > devicetree: Add new SKY81452 backlight binding > > devicetree: Add vendor prefix for Skyworks Solutions, Inc. > > devicetree: Add SKY81452 to the Trivial Devices list > > > > .../devicetree/bindings/i2c/trivial-devices.txt| 1 + > > Documentation/devicetree/bindings/mfd/sky81452.txt | 35 ++ > > .../devicetree/bindings/vendor-prefixes.txt| 1 + > > .../video/backlight/sky81452-backlight.txt | 29 ++ > > drivers/mfd/Kconfig| 12 + > > drivers/mfd/Makefile | 1 + > > drivers/mfd/sky81452.c | 108 +++ > > drivers/video/backlight/Kconfig| 10 + > > drivers/video/backlight/Makefile | 1 + > > drivers/video/backlight/sky81452-backlight.c | 353 > > + > > include/linux/mfd/sky81452.h | 31 ++ > > include/linux/platform_data/sky81452-backlight.h | 46 +++ > > 12 files changed, 628 insertions(+) > > create mode 100644 Documentation/devicetree/bindings/mfd/sky81452.txt > > create mode 100644 > > Documentation/devicetree/bindings/video/backlight/sky81452-backlight.txt > > create mode 100644 drivers/mfd/sky81452.c > > create mode 100644 drivers/video/backlight/sky81452-backlight.c > > create mode 100644 include/linux/mfd/sky81452.h > > create mode 100644 include/linux/platform_data/sky81452-backlight.h > > Correct me if I'm wrong, but I believe you have all of the relevant > Acks now. If so, I plan to pick this up next week and take it > through the MFD tree. I had got all Acks except DT on v10. Rob from DT reviewed, and v11 includes what he asked. > > -- > 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 linux-kernel" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
Re: [PATCH v11 0/6] Add Skyworks SKY81452 device drivers
On Fri, Feb 27, 2015 at 08:39:38PM +, Lee Jones wrote: On Fri, 27 Feb 2015, gyun...@gmail.com wrote: From: Gyungoh Yoo jack@skyworksinc.com This patch set includes regulator and backlight driver for SKY81452. Also it includes documents for device tree and module. sky81452-regulator was already applied. So this series doesn't include it. v11: Renamed 'skyworks,en-channels' property to led-sources. Removed unused property 'skyworks,ovp-level'. v10: Removed trivial get_brightness implementations for sky81452-backlight v9: Removed the change to remove MODULE_VERSION() for sky81452-regulator v8: Renamed property names for backlight with vendor prefix Modified gpio-enable property to generic property for GPIO Made up the example for backlight DT Changed the DT parsing of regulator using regulator_node and of_match v7: Modified licensing text to GPLv2 Split Kconfig renaming from DT patch v6: Added new line character at the end of line of dev_err() v5: Changed DT for regulator : 'lout' node should be defined under 'regulator' Removed compatible string from sky81452-regulator driver Modified sky81452-regulator to return EINVAL when of_node is NULL Move sky81452-backlight.h to include/linux/platform_data v4: Removed MODULE_VERSION() Modified license to GPLv2 Removed calling to backlight_device_unregister() in sky81452-backlight v3: Cleaned-up DBG messages Cleaned-up DT Fixed the backlight name from 'sky81452-bl' to 'sky81452-backlight' Assigned mfd_cell.of_compatible for binding device node Modified error messages Modified sky81452-regulator to return ENODATA when of_node is NULL v2: Split the patches for each sub-system Added 'reg' attribute for I2C address in device tree documents Added 'compatible' attribute in child drivers Renamed CONFIG_SKY81452 to CONFIG_MFD_SKY81452 Changed the dependency from I2C=y to I2C, for CONFIG_MFD_SKY81452 Added message for exception or errors. Added vendor prefix for Skyworks Solutions, Inc. Add SKY81452 to the Trivial Devices list Gyungoh Yoo (6): mfd: Add support for Skyworks SKY81452 driver backlight: Add support Skyworks SKY81452 backlight driver devicetree: Add new SKY81452 mfd binding devicetree: Add new SKY81452 backlight binding devicetree: Add vendor prefix for Skyworks Solutions, Inc. devicetree: Add SKY81452 to the Trivial Devices list .../devicetree/bindings/i2c/trivial-devices.txt| 1 + Documentation/devicetree/bindings/mfd/sky81452.txt | 35 ++ .../devicetree/bindings/vendor-prefixes.txt| 1 + .../video/backlight/sky81452-backlight.txt | 29 ++ drivers/mfd/Kconfig| 12 + drivers/mfd/Makefile | 1 + drivers/mfd/sky81452.c | 108 +++ drivers/video/backlight/Kconfig| 10 + drivers/video/backlight/Makefile | 1 + drivers/video/backlight/sky81452-backlight.c | 353 + include/linux/mfd/sky81452.h | 31 ++ include/linux/platform_data/sky81452-backlight.h | 46 +++ 12 files changed, 628 insertions(+) create mode 100644 Documentation/devicetree/bindings/mfd/sky81452.txt create mode 100644 Documentation/devicetree/bindings/video/backlight/sky81452-backlight.txt create mode 100644 drivers/mfd/sky81452.c create mode 100644 drivers/video/backlight/sky81452-backlight.c create mode 100644 include/linux/mfd/sky81452.h create mode 100644 include/linux/platform_data/sky81452-backlight.h Correct me if I'm wrong, but I believe you have all of the relevant Acks now. If so, I plan to pick this up next week and take it through the MFD tree. I had got all Acks except DT on v10. Rob from DT reviewed, and v11 includes what he asked. -- 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 linux-kernel in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
Re: [PATCH v11 2/6] backlight: Add support Skyworks SKY81452 backlight driver
On Fri, Feb 27, 2015 at 09:58:38AM +0100, Oliver Neukum wrote: > On Fri, 2015-02-27 at 15:42 +0900, gyun...@gmail.com wrote: > > +static ssize_t sky81452_bl_store_enable(struct device *dev, > > + struct device_attribute *attr, const char *buf, size_t > > count) > > +{ > > + struct regmap *regmap = bl_get_data(to_backlight_device(dev)); > > + unsigned long value; > > + int ret; > > + > > + ret = kstrtoul(buf, 16, ); > > + if (IS_ERR_VALUE(ret)) > > + return ret; > > No range checking? It doesn't need it. below regmap_update_bits() is masking the value. > > > + > > + ret = regmap_update_bits(regmap, SKY81452_REG1, SKY81452_EN, > > + value << CTZ(SKY81452_EN)); > > + if (IS_ERR_VALUE(ret)) > > + return ret; > > + > > + return count; > > +} > > Regards > Oliver > > > -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
Re: [PATCH v11 2/6] backlight: Add support Skyworks SKY81452 backlight driver
On Fri, Feb 27, 2015 at 09:58:38AM +0100, Oliver Neukum wrote: On Fri, 2015-02-27 at 15:42 +0900, gyun...@gmail.com wrote: +static ssize_t sky81452_bl_store_enable(struct device *dev, + struct device_attribute *attr, const char *buf, size_t count) +{ + struct regmap *regmap = bl_get_data(to_backlight_device(dev)); + unsigned long value; + int ret; + + ret = kstrtoul(buf, 16, value); + if (IS_ERR_VALUE(ret)) + return ret; No range checking? It doesn't need it. below regmap_update_bits() is masking the value. + + ret = regmap_update_bits(regmap, SKY81452_REG1, SKY81452_EN, + value CTZ(SKY81452_EN)); + if (IS_ERR_VALUE(ret)) + return ret; + + return count; +} Regards Oliver -- To unsubscribe from this list: send the line unsubscribe linux-kernel in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
[PATCH v11 4/6] devicetree: Add new SKY81452 backlight binding
From: Gyungoh Yoo Signed-off-by: Gyungoh Yoo Acked-by: Bryan Wu --- Changes v11: Renamed 'skyworks,en-channels' property to led-sources. Removed unused property 'skyworks,ovp-level'. Changes v10: Nothing Changes v9: Nothing Changes v8: Renamed property names for backlight with vendor prefix Modified gpio-enable property to generic property for GPIO Made up the example for backlight DT Changes v7: Nothing Changes v6: Nothing Changes v5: Nothing Changes v4: Nothing Changes v3: Nothing Changes v2: Added reg attribute for I2C slave address .../video/backlight/sky81452-backlight.txt | 29 ++ 1 file changed, 29 insertions(+) create mode 100644 Documentation/devicetree/bindings/video/backlight/sky81452-backlight.txt diff --git a/Documentation/devicetree/bindings/video/backlight/sky81452-backlight.txt b/Documentation/devicetree/bindings/video/backlight/sky81452-backlight.txt new file mode 100644 index 000..8bf2940 --- /dev/null +++ b/Documentation/devicetree/bindings/video/backlight/sky81452-backlight.txt @@ -0,0 +1,29 @@ +SKY81452-backlight bindings + +Required properties: +- compatible : Must be "skyworks,sky81452-backlight" + +Optional properties: +- name : Name of backlight device. Default is 'lcd-backlight'. +- gpios: GPIO to use to EN pin. + See Documentation/devicetree/bindings/gpio/gpio.txt +- led-sources : List of enabled channels from 0 to 5. + See Documentation/devicetree/bindings/leds/common.txt +- skyworks,ignore-pwm : Ignore both PWM input +- skyworks,dpwm-mode : Enable DPWM dimming mode, otherwise Analog dimming. +- skyworks,phase-shift : Enable phase shift mode +- skyworks,short-detection-threshold-volt + : It should be one of 4, 5, 6 and 7V. +- skyworks,current-limit-mA + : It should be 2300mA or 2750mA. + +Example: + + backlight { + compatible = "skyworks,sky81452-backlight"; + name = "pwm-backlight"; + led-sources = <0 1 2 5>; + skyworks,ignore-pwm; + skyworks,phase-shift; + skyworks,current-limit-mA = <2300>; + }; -- 1.9.1 -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
[PATCH v11 5/6] devicetree: Add vendor prefix for Skyworks Solutions, Inc.
From: Gyungoh Yoo Signed-off-by: Gyungoh Yoo Acked-by: Lee Jones --- Changes v11: Nothing Changes v10: Nothing Changes v9: Nothing Changes v8: Nothing Changes v7: Nothing Changes v6: Nothing Changes v5: Nothing Changes v4: Nothing Changes v3: Nothing Changes v2: Added vendor prefix for Skyworks Solutions, Inc. Documentation/devicetree/bindings/vendor-prefixes.txt | 1 + 1 file changed, 1 insertion(+) diff --git a/Documentation/devicetree/bindings/vendor-prefixes.txt b/Documentation/devicetree/bindings/vendor-prefixes.txt index 389ca13..c4fe9cc 100644 --- a/Documentation/devicetree/bindings/vendor-prefixes.txt +++ b/Documentation/devicetree/bindings/vendor-prefixes.txt @@ -165,6 +165,7 @@ sii Seiko Instruments, Inc. silergySilergy Corp. sirf SiRF Technology, Inc. sitronix Sitronix Technology Corporation +skyworks Skyworks Solutions, Inc. smsc Standard Microsystems Corporation snps Synopsys, Inc. solidrun SolidRun -- 1.9.1 -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
[PATCH v11 2/6] backlight: Add support Skyworks SKY81452 backlight driver
From: Gyungoh Yoo Signed-off-by: Gyungoh Yoo Acked-by: Jingoo Han Acked-by: Bryan Wu --- Changes v11: Renamed 'skyworks,en-channels' property to led-sources. Changes v10: Removed trivial get_brightness implementations Changes v9: Nothing Changes v8: Renamed property names for backlight with vendor prefix Modified gpio-enable property to generic property for GPIO Changes v7: Modified licensing text to GPLv2 Changes v6: Added new line character at the end of line of dev_err() Changes v5: Move sky81452-backlight.h to include/linux/platform_data Changes v4: Reordering header files for readability Removed calling to backlight_device_unregister() Removed MODULE_VERSION() Modified license to GPLv2 Changes v3: Modified DBG messages Changes v2: Added 'compatible' attribute in the driver Added message for exception or errors drivers/video/backlight/Kconfig | 10 + drivers/video/backlight/Makefile | 1 + drivers/video/backlight/sky81452-backlight.c | 353 +++ include/linux/platform_data/sky81452-backlight.h | 46 +++ 4 files changed, 410 insertions(+) create mode 100644 drivers/video/backlight/sky81452-backlight.c create mode 100644 include/linux/platform_data/sky81452-backlight.h diff --git a/drivers/video/backlight/Kconfig b/drivers/video/backlight/Kconfig index efb0904..2d9923a 100644 --- a/drivers/video/backlight/Kconfig +++ b/drivers/video/backlight/Kconfig @@ -408,6 +408,16 @@ config BACKLIGHT_PANDORA If you have a Pandora console, say Y to enable the backlight driver. +config BACKLIGHT_SKY81452 + tristate "Backlight driver for SKY81452" + depends on BACKLIGHT_CLASS_DEVICE && MFD_SKY81452 + help + If you have a Skyworks SKY81452, say Y to enable the + backlight driver. + + To compile this driver as a module, choose M here: the module will + be called sky81452-backlight + config BACKLIGHT_TPS65217 tristate "TPS65217 Backlight" depends on BACKLIGHT_CLASS_DEVICE && MFD_TPS65217 diff --git a/drivers/video/backlight/Makefile b/drivers/video/backlight/Makefile index fcd50b73..d67073f 100644 --- a/drivers/video/backlight/Makefile +++ b/drivers/video/backlight/Makefile @@ -50,6 +50,7 @@ obj-$(CONFIG_BACKLIGHT_PANDORA) += pandora_bl.o obj-$(CONFIG_BACKLIGHT_PCF50633) += pcf50633-backlight.o obj-$(CONFIG_BACKLIGHT_PWM)+= pwm_bl.o obj-$(CONFIG_BACKLIGHT_SAHARA) += kb3886_bl.o +obj-$(CONFIG_BACKLIGHT_SKY81452) += sky81452-backlight.o obj-$(CONFIG_BACKLIGHT_TOSA) += tosa_bl.o obj-$(CONFIG_BACKLIGHT_TPS65217) += tps65217_bl.o obj-$(CONFIG_BACKLIGHT_WM831X) += wm831x_bl.o diff --git a/drivers/video/backlight/sky81452-backlight.c b/drivers/video/backlight/sky81452-backlight.c new file mode 100644 index 000..052fa1b --- /dev/null +++ b/drivers/video/backlight/sky81452-backlight.c @@ -0,0 +1,353 @@ +/* + * sky81452-backlight.cSKY81452 backlight driver + * + * Copyright 2014 Skyworks Solutions Inc. + * Author : Gyungoh Yoo + * + * 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. + * + * This program is distributed in the hope that it will be useful, but + * WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, see <http://www.gnu.org/licenses/>. + */ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +/* registers */ +#define SKY81452_REG0 0x00 +#define SKY81452_REG1 0x01 +#define SKY81452_REG2 0x02 +#define SKY81452_REG4 0x04 +#define SKY81452_REG5 0x05 + +/* bit mask */ +#define SKY81452_CS0xFF +#define SKY81452_EN0x3F +#define SKY81452_IGPW 0x20 +#define SKY81452_PWMMD 0x10 +#define SKY81452_PHASE 0x08 +#define SKY81452_ILIM 0x04 +#define SKY81452_VSHRT 0x03 +#define SKY81452_OCP 0x80 +#define SKY81452_OTMP 0x40 +#define SKY81452_SHRT 0x3F +#define SKY81452_OPN 0x3F + +#define SKY81452_DEFAULT_NAME "lcd-backlight" +#define SKY81452_MAX_BRIGHTNESS(SKY81452_CS + 1) + +#define CTZ(b) __builtin_ctz(b) + +static int sky81452_bl_update_status(struct backlight_device *bd) +{ + const struct sky81452_bl_platform_data *pdata = + dev_get_platdata(bd->dev.parent); + const unsigned int brightness = (unsigned int)bd->props.brightness; + struct regmap *regmap = bl_get_data(bd); + int ret; + + if (brightness > 0) { + ret = regmap_write(regmap, SKY81452_REG0, brightness - 1); +
[PATCH v11 6/6] devicetree: Add SKY81452 to the Trivial Devices list
From: Gyungoh Yoo Signed-off-by: Gyungoh Yoo --- Changes v11: Nothing Changes v10: Nothing Changes v9: Nothing Changes v8: Nothing Changes v7: Nothing Changes v6: Nothing Changes v5: Nothing Changes v4: Nothing Changes v3: Nothing Changes v2: Add SKY81452 to the Trivial Devices list Documentation/devicetree/bindings/i2c/trivial-devices.txt | 1 + 1 file changed, 1 insertion(+) diff --git a/Documentation/devicetree/bindings/i2c/trivial-devices.txt b/Documentation/devicetree/bindings/i2c/trivial-devices.txt index aaa8325..003bd77 100644 --- a/Documentation/devicetree/bindings/i2c/trivial-devices.txt +++ b/Documentation/devicetree/bindings/i2c/trivial-devices.txt @@ -89,6 +89,7 @@ ricoh,rv5c386 I2C bus SERIAL INTERFACE REAL-TIME CLOCK IC ricoh,rv5c387a I2C bus SERIAL INTERFACE REAL-TIME CLOCK IC samsung,24ad0xd1 S524AD0XF1 (128K/256K-bit Serial EEPROM for Low Power) sii,s35390a2-wire CMOS real-time clock +skyworks,sky81452 Skyworks SKY81452: Six-Channel White LED Driver with Touch Panel Bias Supply st-micro,24c256i2c serial eeprom (24cxx) stm,m41t00 Serial Access TIMEKEEPER stm,m41t62 Serial real-time clock (RTC) with alarm -- 1.9.1 -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
[PATCH v11 3/6] devicetree: Add new SKY81452 mfd binding
From: Gyungoh Yoo Signed-off-by: Gyungoh Yoo Acked-by: Lee Jones --- Changes v11: Renamed 'skyworks,en-channels' property to led-sources. Removed unused property 'skyworks,ovp-level'. Changes v10: Nothing Changes v9: Nothing Changes v8: Made up the example for backlight DT Changes v7: Nothing Changes v6: Nothing Changes v5: Changed DT for regulator : 'lout' node should be defined under 'regulator' Removed compatible string from sky81452-regulator driver Changes v4: Nothing Changes v3: Nothing Changes v2: Added reg attribute for I2C slave address Documentation/devicetree/bindings/mfd/sky81452.txt | 35 ++ 1 file changed, 35 insertions(+) create mode 100644 Documentation/devicetree/bindings/mfd/sky81452.txt diff --git a/Documentation/devicetree/bindings/mfd/sky81452.txt b/Documentation/devicetree/bindings/mfd/sky81452.txt new file mode 100644 index 000..3518179 --- /dev/null +++ b/Documentation/devicetree/bindings/mfd/sky81452.txt @@ -0,0 +1,35 @@ +SKY81452 bindings + +Required properties: +- compatible : Must be "skyworks,sky81452" +- reg : I2C slave address + +Required child nodes: +- backlight: container node for backlight following the binding + in video/backlight/sky81452-backlight.txt +- regulator: container node for regulators following the binding + in regulator/sky81452-regulator.txt + +Example: + + sky81452@2c { + compatible = "skyworks,sky81452"; + reg = <0x2c>; + + backlight { + compatible = "skyworks,sky81452-backlight"; + name = "pwm-backlight"; + led-sources = <0 1 2 3 6>; + skyworks,ignore-pwm; + skyworks,phase-shift; + skyworks,current-limit = <2300>; + }; + + regulator { + lout { + regulator-name = "sky81452-lout"; + regulator-min-microvolt = <450>; + regulator-max-microvolt = <800>; + }; + }; + }; -- 1.9.1 -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
[PATCH v11 1/6] mfd: Add support for Skyworks SKY81452 driver
From: Gyungoh Yoo Signed-off-by: Gyungoh Yoo Acked-by: Lee Jones --- Changes v11: Nothing Changes v10: Nothing Changes v9: Nothing Changes v8: Nothing Changes v7: Modified licensing text to GPLv2 Changes v6: Added new line character at the end of line of dev_err() Changes v5: Move sky81452-backlight.h to include/linux/platform_data Changes v4: Removed MODULE_VERSION() Modified license to GPLv2 Changes v3: Fixed the backlight name from 'sky81452-bl' to 'sky81452-backlight' Assigned mfd_cell.of_compatible for binding device node Modified error messages Changes v2: Renamed CONFIG_SKY81452 to CONFIG_MFD_SKY81452 Changed the dependency from I2C=y to I2C, for CONFIG_MFD_SKY81452 Added message for exception or errors drivers/mfd/Kconfig | 12 + drivers/mfd/Makefile | 1 + drivers/mfd/sky81452.c | 108 +++ include/linux/mfd/sky81452.h | 31 + 4 files changed, 152 insertions(+) create mode 100644 drivers/mfd/sky81452.c create mode 100644 include/linux/mfd/sky81452.h diff --git a/drivers/mfd/Kconfig b/drivers/mfd/Kconfig index 38356e3..bc3b540 100644 --- a/drivers/mfd/Kconfig +++ b/drivers/mfd/Kconfig @@ -753,6 +753,18 @@ config MFD_SM501_GPIO lines on the SM501. The platform data is used to supply the base number for the first GPIO line to register. +config MFD_SKY81452 + tristate "Skyworks Solutions SKY81452" + select MFD_CORE + select REGMAP_I2C + depends on I2C + help + This is the core driver for the Skyworks SKY81452 backlight and + voltage regulator device. + + This driver can also be built as a module. If so, the module + will be called sky81452. + config MFD_SMSC bool "SMSC ECE1099 series chips" depends on I2C=y diff --git a/drivers/mfd/Makefile b/drivers/mfd/Makefile index 19f3d74..75b3ffb 100644 --- a/drivers/mfd/Makefile +++ b/drivers/mfd/Makefile @@ -178,6 +178,7 @@ obj-$(CONFIG_MFD_MENF21BMC) += menf21bmc.o obj-$(CONFIG_MFD_HI6421_PMIC) += hi6421-pmic-core.o obj-$(CONFIG_MFD_DLN2) += dln2.o obj-$(CONFIG_MFD_RT5033) += rt5033.o +obj-$(CONFIG_MFD_SKY81452) += sky81452.o intel-soc-pmic-objs:= intel_soc_pmic_core.o intel_soc_pmic_crc.o obj-$(CONFIG_INTEL_SOC_PMIC) += intel-soc-pmic.o diff --git a/drivers/mfd/sky81452.c b/drivers/mfd/sky81452.c new file mode 100644 index 000..b0c9b04 --- /dev/null +++ b/drivers/mfd/sky81452.c @@ -0,0 +1,108 @@ +/* + * sky81452.c SKY81452 MFD driver + * + * Copyright 2014 Skyworks Solutions Inc. + * Author : Gyungoh Yoo + * + * 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. + * + * This program is distributed in the hope that it will be useful, but + * WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, see <http://www.gnu.org/licenses/>. + */ + +#include +#include +#include +#include +#include +#include +#include +#include +#include + +static const struct regmap_config sky81452_config = { + .reg_bits = 8, + .val_bits = 8, +}; + +static int sky81452_probe(struct i2c_client *client, + const struct i2c_device_id *id) +{ + struct device *dev = >dev; + const struct sky81452_platform_data *pdata = dev_get_platdata(dev); + struct mfd_cell cells[2]; + struct regmap *regmap; + int ret; + + if (!pdata) { + pdata = devm_kzalloc(dev, sizeof(*pdata), GFP_KERNEL); + if (!pdata) + return -ENOMEM; + } + + regmap = devm_regmap_init_i2c(client, _config); + if (IS_ERR(regmap)) { + dev_err(dev, "failed to initialize.err=%ld\n", PTR_ERR(regmap)); + return PTR_ERR(regmap); + } + + i2c_set_clientdata(client, regmap); + + memset(cells, 0, sizeof(cells)); + cells[0].name = "sky81452-backlight"; + cells[0].of_compatible = "skyworks,sky81452-backlight"; + cells[0].platform_data = pdata->bl_pdata; + cells[0].pdata_size = sizeof(*pdata->bl_pdata); + cells[1].name = "sky81452-regulator"; + cells[1].platform_data = pdata->regulator_init_data; + cells[1].pdata_size = sizeof(*pdata->regulator_init_data); + + ret = mfd_add_devices(dev, -1, cells, ARRAY_SIZE(cells), NULL, 0, NULL); + if (ret) + dev_err(dev, "failed to add child devices. err=%d\n", ret); + + return ret; +} + +static int sky81452_remove(struct i2c_client *client) +{
[PATCH v11 0/6] Add Skyworks SKY81452 device drivers
From: Gyungoh Yoo This patch set includes regulator and backlight driver for SKY81452. Also it includes documents for device tree and module. sky81452-regulator was already applied. So this series doesn't include it. v11: Renamed 'skyworks,en-channels' property to led-sources. Removed unused property 'skyworks,ovp-level'. v10: Removed trivial get_brightness implementations for sky81452-backlight v9: Removed the change to remove MODULE_VERSION() for sky81452-regulator v8: Renamed property names for backlight with vendor prefix Modified gpio-enable property to generic property for GPIO Made up the example for backlight DT Changed the DT parsing of regulator using regulator_node and of_match v7: Modified licensing text to GPLv2 Split Kconfig renaming from DT patch v6: Added new line character at the end of line of dev_err() v5: Changed DT for regulator : 'lout' node should be defined under 'regulator' Removed compatible string from sky81452-regulator driver Modified sky81452-regulator to return EINVAL when of_node is NULL Move sky81452-backlight.h to include/linux/platform_data v4: Removed MODULE_VERSION() Modified license to GPLv2 Removed calling to backlight_device_unregister() in sky81452-backlight v3: Cleaned-up DBG messages Cleaned-up DT Fixed the backlight name from 'sky81452-bl' to 'sky81452-backlight' Assigned mfd_cell.of_compatible for binding device node Modified error messages Modified sky81452-regulator to return ENODATA when of_node is NULL v2: Split the patches for each sub-system Added 'reg' attribute for I2C address in device tree documents Added 'compatible' attribute in child drivers Renamed CONFIG_SKY81452 to CONFIG_MFD_SKY81452 Changed the dependency from I2C=y to I2C, for CONFIG_MFD_SKY81452 Added message for exception or errors. Added vendor prefix for Skyworks Solutions, Inc. Add SKY81452 to the Trivial Devices list Gyungoh Yoo (6): mfd: Add support for Skyworks SKY81452 driver backlight: Add support Skyworks SKY81452 backlight driver devicetree: Add new SKY81452 mfd binding devicetree: Add new SKY81452 backlight binding devicetree: Add vendor prefix for Skyworks Solutions, Inc. devicetree: Add SKY81452 to the Trivial Devices list .../devicetree/bindings/i2c/trivial-devices.txt| 1 + Documentation/devicetree/bindings/mfd/sky81452.txt | 35 ++ .../devicetree/bindings/vendor-prefixes.txt| 1 + .../video/backlight/sky81452-backlight.txt | 29 ++ drivers/mfd/Kconfig| 12 + drivers/mfd/Makefile | 1 + drivers/mfd/sky81452.c | 108 +++ drivers/video/backlight/Kconfig| 10 + drivers/video/backlight/Makefile | 1 + drivers/video/backlight/sky81452-backlight.c | 353 + include/linux/mfd/sky81452.h | 31 ++ include/linux/platform_data/sky81452-backlight.h | 46 +++ 12 files changed, 628 insertions(+) create mode 100644 Documentation/devicetree/bindings/mfd/sky81452.txt create mode 100644 Documentation/devicetree/bindings/video/backlight/sky81452-backlight.txt create mode 100644 drivers/mfd/sky81452.c create mode 100644 drivers/video/backlight/sky81452-backlight.c create mode 100644 include/linux/mfd/sky81452.h create mode 100644 include/linux/platform_data/sky81452-backlight.h -- 1.9.1 -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
[PATCH v11 1/6] mfd: Add support for Skyworks SKY81452 driver
From: Gyungoh Yoo jack@skyworksinc.com Signed-off-by: Gyungoh Yoo jack@skyworksinc.com Acked-by: Lee Jones lee.jo...@linaro.org --- Changes v11: Nothing Changes v10: Nothing Changes v9: Nothing Changes v8: Nothing Changes v7: Modified licensing text to GPLv2 Changes v6: Added new line character at the end of line of dev_err() Changes v5: Move sky81452-backlight.h to include/linux/platform_data Changes v4: Removed MODULE_VERSION() Modified license to GPLv2 Changes v3: Fixed the backlight name from 'sky81452-bl' to 'sky81452-backlight' Assigned mfd_cell.of_compatible for binding device node Modified error messages Changes v2: Renamed CONFIG_SKY81452 to CONFIG_MFD_SKY81452 Changed the dependency from I2C=y to I2C, for CONFIG_MFD_SKY81452 Added message for exception or errors drivers/mfd/Kconfig | 12 + drivers/mfd/Makefile | 1 + drivers/mfd/sky81452.c | 108 +++ include/linux/mfd/sky81452.h | 31 + 4 files changed, 152 insertions(+) create mode 100644 drivers/mfd/sky81452.c create mode 100644 include/linux/mfd/sky81452.h diff --git a/drivers/mfd/Kconfig b/drivers/mfd/Kconfig index 38356e3..bc3b540 100644 --- a/drivers/mfd/Kconfig +++ b/drivers/mfd/Kconfig @@ -753,6 +753,18 @@ config MFD_SM501_GPIO lines on the SM501. The platform data is used to supply the base number for the first GPIO line to register. +config MFD_SKY81452 + tristate Skyworks Solutions SKY81452 + select MFD_CORE + select REGMAP_I2C + depends on I2C + help + This is the core driver for the Skyworks SKY81452 backlight and + voltage regulator device. + + This driver can also be built as a module. If so, the module + will be called sky81452. + config MFD_SMSC bool SMSC ECE1099 series chips depends on I2C=y diff --git a/drivers/mfd/Makefile b/drivers/mfd/Makefile index 19f3d74..75b3ffb 100644 --- a/drivers/mfd/Makefile +++ b/drivers/mfd/Makefile @@ -178,6 +178,7 @@ obj-$(CONFIG_MFD_MENF21BMC) += menf21bmc.o obj-$(CONFIG_MFD_HI6421_PMIC) += hi6421-pmic-core.o obj-$(CONFIG_MFD_DLN2) += dln2.o obj-$(CONFIG_MFD_RT5033) += rt5033.o +obj-$(CONFIG_MFD_SKY81452) += sky81452.o intel-soc-pmic-objs:= intel_soc_pmic_core.o intel_soc_pmic_crc.o obj-$(CONFIG_INTEL_SOC_PMIC) += intel-soc-pmic.o diff --git a/drivers/mfd/sky81452.c b/drivers/mfd/sky81452.c new file mode 100644 index 000..b0c9b04 --- /dev/null +++ b/drivers/mfd/sky81452.c @@ -0,0 +1,108 @@ +/* + * sky81452.c SKY81452 MFD driver + * + * Copyright 2014 Skyworks Solutions Inc. + * Author : Gyungoh Yoo jack@skyworksinc.com + * + * 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. + * + * This program is distributed in the hope that it will be useful, but + * WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, see http://www.gnu.org/licenses/. + */ + +#include linux/kernel.h +#include linux/module.h +#include linux/init.h +#include linux/err.h +#include linux/slab.h +#include linux/i2c.h +#include linux/regmap.h +#include linux/mfd/core.h +#include linux/mfd/sky81452.h + +static const struct regmap_config sky81452_config = { + .reg_bits = 8, + .val_bits = 8, +}; + +static int sky81452_probe(struct i2c_client *client, + const struct i2c_device_id *id) +{ + struct device *dev = client-dev; + const struct sky81452_platform_data *pdata = dev_get_platdata(dev); + struct mfd_cell cells[2]; + struct regmap *regmap; + int ret; + + if (!pdata) { + pdata = devm_kzalloc(dev, sizeof(*pdata), GFP_KERNEL); + if (!pdata) + return -ENOMEM; + } + + regmap = devm_regmap_init_i2c(client, sky81452_config); + if (IS_ERR(regmap)) { + dev_err(dev, failed to initialize.err=%ld\n, PTR_ERR(regmap)); + return PTR_ERR(regmap); + } + + i2c_set_clientdata(client, regmap); + + memset(cells, 0, sizeof(cells)); + cells[0].name = sky81452-backlight; + cells[0].of_compatible = skyworks,sky81452-backlight; + cells[0].platform_data = pdata-bl_pdata; + cells[0].pdata_size = sizeof(*pdata-bl_pdata); + cells[1].name = sky81452-regulator; + cells[1].platform_data = pdata-regulator_init_data; + cells[1].pdata_size = sizeof(*pdata-regulator_init_data); + + ret = mfd_add_devices(dev, -1, cells, ARRAY_SIZE(cells), NULL, 0, NULL); + if (ret) + dev_err(dev, failed to add child
[PATCH v11 0/6] Add Skyworks SKY81452 device drivers
From: Gyungoh Yoo jack@skyworksinc.com This patch set includes regulator and backlight driver for SKY81452. Also it includes documents for device tree and module. sky81452-regulator was already applied. So this series doesn't include it. v11: Renamed 'skyworks,en-channels' property to led-sources. Removed unused property 'skyworks,ovp-level'. v10: Removed trivial get_brightness implementations for sky81452-backlight v9: Removed the change to remove MODULE_VERSION() for sky81452-regulator v8: Renamed property names for backlight with vendor prefix Modified gpio-enable property to generic property for GPIO Made up the example for backlight DT Changed the DT parsing of regulator using regulator_node and of_match v7: Modified licensing text to GPLv2 Split Kconfig renaming from DT patch v6: Added new line character at the end of line of dev_err() v5: Changed DT for regulator : 'lout' node should be defined under 'regulator' Removed compatible string from sky81452-regulator driver Modified sky81452-regulator to return EINVAL when of_node is NULL Move sky81452-backlight.h to include/linux/platform_data v4: Removed MODULE_VERSION() Modified license to GPLv2 Removed calling to backlight_device_unregister() in sky81452-backlight v3: Cleaned-up DBG messages Cleaned-up DT Fixed the backlight name from 'sky81452-bl' to 'sky81452-backlight' Assigned mfd_cell.of_compatible for binding device node Modified error messages Modified sky81452-regulator to return ENODATA when of_node is NULL v2: Split the patches for each sub-system Added 'reg' attribute for I2C address in device tree documents Added 'compatible' attribute in child drivers Renamed CONFIG_SKY81452 to CONFIG_MFD_SKY81452 Changed the dependency from I2C=y to I2C, for CONFIG_MFD_SKY81452 Added message for exception or errors. Added vendor prefix for Skyworks Solutions, Inc. Add SKY81452 to the Trivial Devices list Gyungoh Yoo (6): mfd: Add support for Skyworks SKY81452 driver backlight: Add support Skyworks SKY81452 backlight driver devicetree: Add new SKY81452 mfd binding devicetree: Add new SKY81452 backlight binding devicetree: Add vendor prefix for Skyworks Solutions, Inc. devicetree: Add SKY81452 to the Trivial Devices list .../devicetree/bindings/i2c/trivial-devices.txt| 1 + Documentation/devicetree/bindings/mfd/sky81452.txt | 35 ++ .../devicetree/bindings/vendor-prefixes.txt| 1 + .../video/backlight/sky81452-backlight.txt | 29 ++ drivers/mfd/Kconfig| 12 + drivers/mfd/Makefile | 1 + drivers/mfd/sky81452.c | 108 +++ drivers/video/backlight/Kconfig| 10 + drivers/video/backlight/Makefile | 1 + drivers/video/backlight/sky81452-backlight.c | 353 + include/linux/mfd/sky81452.h | 31 ++ include/linux/platform_data/sky81452-backlight.h | 46 +++ 12 files changed, 628 insertions(+) create mode 100644 Documentation/devicetree/bindings/mfd/sky81452.txt create mode 100644 Documentation/devicetree/bindings/video/backlight/sky81452-backlight.txt create mode 100644 drivers/mfd/sky81452.c create mode 100644 drivers/video/backlight/sky81452-backlight.c create mode 100644 include/linux/mfd/sky81452.h create mode 100644 include/linux/platform_data/sky81452-backlight.h -- 1.9.1 -- To unsubscribe from this list: send the line unsubscribe linux-kernel in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
[PATCH v11 3/6] devicetree: Add new SKY81452 mfd binding
From: Gyungoh Yoo jack@skyworksinc.com Signed-off-by: Gyungoh Yoo jack@skyworksinc.com Acked-by: Lee Jones lee.jo...@linaro.org --- Changes v11: Renamed 'skyworks,en-channels' property to led-sources. Removed unused property 'skyworks,ovp-level'. Changes v10: Nothing Changes v9: Nothing Changes v8: Made up the example for backlight DT Changes v7: Nothing Changes v6: Nothing Changes v5: Changed DT for regulator : 'lout' node should be defined under 'regulator' Removed compatible string from sky81452-regulator driver Changes v4: Nothing Changes v3: Nothing Changes v2: Added reg attribute for I2C slave address Documentation/devicetree/bindings/mfd/sky81452.txt | 35 ++ 1 file changed, 35 insertions(+) create mode 100644 Documentation/devicetree/bindings/mfd/sky81452.txt diff --git a/Documentation/devicetree/bindings/mfd/sky81452.txt b/Documentation/devicetree/bindings/mfd/sky81452.txt new file mode 100644 index 000..3518179 --- /dev/null +++ b/Documentation/devicetree/bindings/mfd/sky81452.txt @@ -0,0 +1,35 @@ +SKY81452 bindings + +Required properties: +- compatible : Must be skyworks,sky81452 +- reg : I2C slave address + +Required child nodes: +- backlight: container node for backlight following the binding + in video/backlight/sky81452-backlight.txt +- regulator: container node for regulators following the binding + in regulator/sky81452-regulator.txt + +Example: + + sky81452@2c { + compatible = skyworks,sky81452; + reg = 0x2c; + + backlight { + compatible = skyworks,sky81452-backlight; + name = pwm-backlight; + led-sources = 0 1 2 3 6; + skyworks,ignore-pwm; + skyworks,phase-shift; + skyworks,current-limit = 2300; + }; + + regulator { + lout { + regulator-name = sky81452-lout; + regulator-min-microvolt = 450; + regulator-max-microvolt = 800; + }; + }; + }; -- 1.9.1 -- To unsubscribe from this list: send the line unsubscribe linux-kernel in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
[PATCH v11 2/6] backlight: Add support Skyworks SKY81452 backlight driver
From: Gyungoh Yoo jack@skyworksinc.com Signed-off-by: Gyungoh Yoo jack@skyworksinc.com Acked-by: Jingoo Han jg1@samsung.com Acked-by: Bryan Wu coolo...@gmail.com --- Changes v11: Renamed 'skyworks,en-channels' property to led-sources. Changes v10: Removed trivial get_brightness implementations Changes v9: Nothing Changes v8: Renamed property names for backlight with vendor prefix Modified gpio-enable property to generic property for GPIO Changes v7: Modified licensing text to GPLv2 Changes v6: Added new line character at the end of line of dev_err() Changes v5: Move sky81452-backlight.h to include/linux/platform_data Changes v4: Reordering header files for readability Removed calling to backlight_device_unregister() Removed MODULE_VERSION() Modified license to GPLv2 Changes v3: Modified DBG messages Changes v2: Added 'compatible' attribute in the driver Added message for exception or errors drivers/video/backlight/Kconfig | 10 + drivers/video/backlight/Makefile | 1 + drivers/video/backlight/sky81452-backlight.c | 353 +++ include/linux/platform_data/sky81452-backlight.h | 46 +++ 4 files changed, 410 insertions(+) create mode 100644 drivers/video/backlight/sky81452-backlight.c create mode 100644 include/linux/platform_data/sky81452-backlight.h diff --git a/drivers/video/backlight/Kconfig b/drivers/video/backlight/Kconfig index efb0904..2d9923a 100644 --- a/drivers/video/backlight/Kconfig +++ b/drivers/video/backlight/Kconfig @@ -408,6 +408,16 @@ config BACKLIGHT_PANDORA If you have a Pandora console, say Y to enable the backlight driver. +config BACKLIGHT_SKY81452 + tristate Backlight driver for SKY81452 + depends on BACKLIGHT_CLASS_DEVICE MFD_SKY81452 + help + If you have a Skyworks SKY81452, say Y to enable the + backlight driver. + + To compile this driver as a module, choose M here: the module will + be called sky81452-backlight + config BACKLIGHT_TPS65217 tristate TPS65217 Backlight depends on BACKLIGHT_CLASS_DEVICE MFD_TPS65217 diff --git a/drivers/video/backlight/Makefile b/drivers/video/backlight/Makefile index fcd50b73..d67073f 100644 --- a/drivers/video/backlight/Makefile +++ b/drivers/video/backlight/Makefile @@ -50,6 +50,7 @@ obj-$(CONFIG_BACKLIGHT_PANDORA) += pandora_bl.o obj-$(CONFIG_BACKLIGHT_PCF50633) += pcf50633-backlight.o obj-$(CONFIG_BACKLIGHT_PWM)+= pwm_bl.o obj-$(CONFIG_BACKLIGHT_SAHARA) += kb3886_bl.o +obj-$(CONFIG_BACKLIGHT_SKY81452) += sky81452-backlight.o obj-$(CONFIG_BACKLIGHT_TOSA) += tosa_bl.o obj-$(CONFIG_BACKLIGHT_TPS65217) += tps65217_bl.o obj-$(CONFIG_BACKLIGHT_WM831X) += wm831x_bl.o diff --git a/drivers/video/backlight/sky81452-backlight.c b/drivers/video/backlight/sky81452-backlight.c new file mode 100644 index 000..052fa1b --- /dev/null +++ b/drivers/video/backlight/sky81452-backlight.c @@ -0,0 +1,353 @@ +/* + * sky81452-backlight.cSKY81452 backlight driver + * + * Copyright 2014 Skyworks Solutions Inc. + * Author : Gyungoh Yoo jack@skyworksinc.com + * + * 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. + * + * This program is distributed in the hope that it will be useful, but + * WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, see http://www.gnu.org/licenses/. + */ + +#include linux/backlight.h +#include linux/err.h +#include linux/gpio.h +#include linux/init.h +#include linux/kernel.h +#include linux/module.h +#include linux/of.h +#include linux/of_gpio.h +#include linux/platform_device.h +#include linux/regmap.h +#include linux/platform_data/sky81452-backlight.h +#include linux/slab.h + +/* registers */ +#define SKY81452_REG0 0x00 +#define SKY81452_REG1 0x01 +#define SKY81452_REG2 0x02 +#define SKY81452_REG4 0x04 +#define SKY81452_REG5 0x05 + +/* bit mask */ +#define SKY81452_CS0xFF +#define SKY81452_EN0x3F +#define SKY81452_IGPW 0x20 +#define SKY81452_PWMMD 0x10 +#define SKY81452_PHASE 0x08 +#define SKY81452_ILIM 0x04 +#define SKY81452_VSHRT 0x03 +#define SKY81452_OCP 0x80 +#define SKY81452_OTMP 0x40 +#define SKY81452_SHRT 0x3F +#define SKY81452_OPN 0x3F + +#define SKY81452_DEFAULT_NAME lcd-backlight +#define SKY81452_MAX_BRIGHTNESS(SKY81452_CS + 1) + +#define CTZ(b) __builtin_ctz(b) + +static int sky81452_bl_update_status(struct backlight_device *bd) +{ + const struct sky81452_bl_platform_data *pdata = + dev_get_platdata(bd-dev.parent); + const unsigned int
[PATCH v11 4/6] devicetree: Add new SKY81452 backlight binding
From: Gyungoh Yoo jack@skyworksinc.com Signed-off-by: Gyungoh Yoo jack@skyworksinc.com Acked-by: Bryan Wu coolo...@gmail.com --- Changes v11: Renamed 'skyworks,en-channels' property to led-sources. Removed unused property 'skyworks,ovp-level'. Changes v10: Nothing Changes v9: Nothing Changes v8: Renamed property names for backlight with vendor prefix Modified gpio-enable property to generic property for GPIO Made up the example for backlight DT Changes v7: Nothing Changes v6: Nothing Changes v5: Nothing Changes v4: Nothing Changes v3: Nothing Changes v2: Added reg attribute for I2C slave address .../video/backlight/sky81452-backlight.txt | 29 ++ 1 file changed, 29 insertions(+) create mode 100644 Documentation/devicetree/bindings/video/backlight/sky81452-backlight.txt diff --git a/Documentation/devicetree/bindings/video/backlight/sky81452-backlight.txt b/Documentation/devicetree/bindings/video/backlight/sky81452-backlight.txt new file mode 100644 index 000..8bf2940 --- /dev/null +++ b/Documentation/devicetree/bindings/video/backlight/sky81452-backlight.txt @@ -0,0 +1,29 @@ +SKY81452-backlight bindings + +Required properties: +- compatible : Must be skyworks,sky81452-backlight + +Optional properties: +- name : Name of backlight device. Default is 'lcd-backlight'. +- gpios: GPIO to use to EN pin. + See Documentation/devicetree/bindings/gpio/gpio.txt +- led-sources : List of enabled channels from 0 to 5. + See Documentation/devicetree/bindings/leds/common.txt +- skyworks,ignore-pwm : Ignore both PWM input +- skyworks,dpwm-mode : Enable DPWM dimming mode, otherwise Analog dimming. +- skyworks,phase-shift : Enable phase shift mode +- skyworks,short-detection-threshold-volt + : It should be one of 4, 5, 6 and 7V. +- skyworks,current-limit-mA + : It should be 2300mA or 2750mA. + +Example: + + backlight { + compatible = skyworks,sky81452-backlight; + name = pwm-backlight; + led-sources = 0 1 2 5; + skyworks,ignore-pwm; + skyworks,phase-shift; + skyworks,current-limit-mA = 2300; + }; -- 1.9.1 -- To unsubscribe from this list: send the line unsubscribe linux-kernel in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
[PATCH v11 5/6] devicetree: Add vendor prefix for Skyworks Solutions, Inc.
From: Gyungoh Yoo jack@skyworksinc.com Signed-off-by: Gyungoh Yoo jack@skyworksinc.com Acked-by: Lee Jones lee.jo...@linaro.org --- Changes v11: Nothing Changes v10: Nothing Changes v9: Nothing Changes v8: Nothing Changes v7: Nothing Changes v6: Nothing Changes v5: Nothing Changes v4: Nothing Changes v3: Nothing Changes v2: Added vendor prefix for Skyworks Solutions, Inc. Documentation/devicetree/bindings/vendor-prefixes.txt | 1 + 1 file changed, 1 insertion(+) diff --git a/Documentation/devicetree/bindings/vendor-prefixes.txt b/Documentation/devicetree/bindings/vendor-prefixes.txt index 389ca13..c4fe9cc 100644 --- a/Documentation/devicetree/bindings/vendor-prefixes.txt +++ b/Documentation/devicetree/bindings/vendor-prefixes.txt @@ -165,6 +165,7 @@ sii Seiko Instruments, Inc. silergySilergy Corp. sirf SiRF Technology, Inc. sitronix Sitronix Technology Corporation +skyworks Skyworks Solutions, Inc. smsc Standard Microsystems Corporation snps Synopsys, Inc. solidrun SolidRun -- 1.9.1 -- To unsubscribe from this list: send the line unsubscribe linux-kernel in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
[PATCH v11 6/6] devicetree: Add SKY81452 to the Trivial Devices list
From: Gyungoh Yoo jack@skyworksinc.com Signed-off-by: Gyungoh Yoo jack@skyworksinc.com --- Changes v11: Nothing Changes v10: Nothing Changes v9: Nothing Changes v8: Nothing Changes v7: Nothing Changes v6: Nothing Changes v5: Nothing Changes v4: Nothing Changes v3: Nothing Changes v2: Add SKY81452 to the Trivial Devices list Documentation/devicetree/bindings/i2c/trivial-devices.txt | 1 + 1 file changed, 1 insertion(+) diff --git a/Documentation/devicetree/bindings/i2c/trivial-devices.txt b/Documentation/devicetree/bindings/i2c/trivial-devices.txt index aaa8325..003bd77 100644 --- a/Documentation/devicetree/bindings/i2c/trivial-devices.txt +++ b/Documentation/devicetree/bindings/i2c/trivial-devices.txt @@ -89,6 +89,7 @@ ricoh,rv5c386 I2C bus SERIAL INTERFACE REAL-TIME CLOCK IC ricoh,rv5c387a I2C bus SERIAL INTERFACE REAL-TIME CLOCK IC samsung,24ad0xd1 S524AD0XF1 (128K/256K-bit Serial EEPROM for Low Power) sii,s35390a2-wire CMOS real-time clock +skyworks,sky81452 Skyworks SKY81452: Six-Channel White LED Driver with Touch Panel Bias Supply st-micro,24c256i2c serial eeprom (24cxx) stm,m41t00 Serial Access TIMEKEEPER stm,m41t62 Serial real-time clock (RTC) with alarm -- 1.9.1 -- To unsubscribe from this list: send the line unsubscribe linux-kernel in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
Re: [PATCH v10 0/6] Add Skyworks SKY81452 device drivers
On Thu, Feb 05, 2015 at 03:29:40PM +0900, gyun...@gmail.com wrote: Please ignore this patch serial v10. Sorry for my mistake > From: Gyungoh Yoo > > This patch set includes regulator and backlight driver for SKY81452. > Also it includes documents for device tree and module. > sky81452-regulator was already applied. So this series doesn't > include it. > > v10: > Removed trivial get_brightness implementations for sky81452-backlight > > v9: > Removed the change to remove MODULE_VERSION() for sky81452-regulator > > v8: > Renamed property names for backlight with vendor prefix > Modified gpio-enable property to generic property for GPIO > Made up the example for backlight DT > Changed the DT parsing of regulator using regulator_node and of_match > > v7: > Modified licensing text to GPLv2 > Splitted Kconfig renaming from DT patch > > v6: > Added new line character at the end of line of dev_err() > > v5: > Changed DT for regulator : 'lout' node should be defined under 'regulator' > Removed compatible string from sky81452-regulator driver > Modified sky81452-regulator to return EINVAL when of_node is NULL > Move sky81452-backlight.h to include/linux/platform_data > > v4: > Removed MODULE_VERSION() > Modified license to GPLv2 > Removed calling to backlight_device_unregister() in sky81452-backlight > > v3: > Cleaned-up DBG messages > Cleaned-up DT > Fixed the backlight name from 'sky81452-bl' to 'sky81452-backlight' > Assigned mfd_cell.of_compatible for binding device node > Modified error messages > Modified sky81452-regulator to return ENODATA when of_node is NULL > > v2: > Split the patches for each sub-system > Added 'reg' attribute for I2C address in device tree documents > Added 'compatible' attribute in child drivers > Renamed CONFIG_SKY81452 to CONFIG_MFD_SKY81452 > Changed the dependency from I2C=y to I2C, for CONFIG_MFD_SKY81452 > Added message for exception or errors. > Added vendor prefix for Skyworks Solutions, Inc. > Add SKY81452 to the Trivial Devices list > > Gyungoh Yoo (6): > mfd: Add support for Skyworks SKY81452 driver > backlight: Add support Skyworks SKY81452 backlight driver > devicetree: mfd: Add new SKY81452 mfd binding > devicetree: backlight: Add new SKY81452 backlight binding > devicetree: Add vendor prefix for Skyworks Solutions, Inc. > devicetree: i2c: Add SKY81452 to the Trivial Devices list > > .../devicetree/bindings/i2c/trivial-devices.txt| 1 + > Documentation/devicetree/bindings/mfd/sky81452.txt | 36 +++ > .../devicetree/bindings/vendor-prefixes.txt| 1 + > .../video/backlight/sky81452-backlight.txt | 29 ++ > drivers/mfd/Kconfig| 12 + > drivers/mfd/Makefile | 1 + > drivers/mfd/sky81452.c | 108 +++ > drivers/video/backlight/Kconfig| 10 + > drivers/video/backlight/Makefile | 1 + > drivers/video/backlight/sky81452-backlight.c | 334 > + > include/linux/mfd/sky81452.h | 31 ++ > include/linux/platform_data/sky81452-backlight.h | 46 +++ > 12 files changed, 610 insertions(+) > create mode 100644 Documentation/devicetree/bindings/mfd/sky81452.txt > create mode 100644 > Documentation/devicetree/bindings/video/backlight/sky81452-backlight.txt > create mode 100644 drivers/mfd/sky81452.c > create mode 100644 drivers/video/backlight/sky81452-backlight.c > create mode 100644 include/linux/mfd/sky81452.h > create mode 100644 include/linux/platform_data/sky81452-backlight.h > > -- > 1.9.1 > -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
[PATCH v11 3/6] devicetree: Add new SKY81452 mfd binding
From: Gyungoh Yoo Signed-off-by: Gyungoh Yoo Acked-by: Lee Jones --- Changes v11: Renamed 'skyworks,en-channels' property to led-sources. Removed unused property 'skyworks,ovp-level'. Changes v10: Nothing Changes v9: Nothing Changes v8: Made up the example for backlight DT Changes v7: Nothing Changes v6: Nothing Changes v5: Changed DT for regulator : 'lout' node should be defined under 'regulator' Removed compatible string from sky81452-regulator driver Changes v4: Nothing Changes v3: Nothing Changes v2: Added reg attribute for I2C slave address Documentation/devicetree/bindings/mfd/sky81452.txt | 35 ++ 1 file changed, 35 insertions(+) create mode 100644 Documentation/devicetree/bindings/mfd/sky81452.txt diff --git a/Documentation/devicetree/bindings/mfd/sky81452.txt b/Documentation/devicetree/bindings/mfd/sky81452.txt new file mode 100644 index 000..3518179 --- /dev/null +++ b/Documentation/devicetree/bindings/mfd/sky81452.txt @@ -0,0 +1,35 @@ +SKY81452 bindings + +Required properties: +- compatible : Must be "skyworks,sky81452" +- reg : I2C slave address + +Required child nodes: +- backlight: container node for backlight following the binding + in video/backlight/sky81452-backlight.txt +- regulator: container node for regulators following the binding + in regulator/sky81452-regulator.txt + +Example: + + sky81452@2c { + compatible = "skyworks,sky81452"; + reg = <0x2c>; + + backlight { + compatible = "skyworks,sky81452-backlight"; + name = "pwm-backlight"; + led-sources = <0 1 2 3 6>; + skyworks,ignore-pwm; + skyworks,phase-shift; + skyworks,current-limit = <2300>; + }; + + regulator { + lout { + regulator-name = "sky81452-lout"; + regulator-min-microvolt = <450>; + regulator-max-microvolt = <800>; + }; + }; + }; -- 1.9.1 -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
[PATCH v11 6/6] devicetree: Add SKY81452 to the Trivial Devices list
From: Gyungoh Yoo Signed-off-by: Gyungoh Yoo --- Changes v11: Nothing Changes v10: Nothing Changes v9: Nothing Changes v8: Nothing Changes v7: Nothing Changes v6: Nothing Changes v5: Nothing Changes v4: Nothing Changes v3: Nothing Changes v2: Add SKY81452 to the Trivial Devices list Documentation/devicetree/bindings/i2c/trivial-devices.txt | 1 + 1 file changed, 1 insertion(+) diff --git a/Documentation/devicetree/bindings/i2c/trivial-devices.txt b/Documentation/devicetree/bindings/i2c/trivial-devices.txt index 9f41d05..b026167 100644 --- a/Documentation/devicetree/bindings/i2c/trivial-devices.txt +++ b/Documentation/devicetree/bindings/i2c/trivial-devices.txt @@ -88,6 +88,7 @@ ricoh,rv5c386 I2C bus SERIAL INTERFACE REAL-TIME CLOCK IC ricoh,rv5c387a I2C bus SERIAL INTERFACE REAL-TIME CLOCK IC samsung,24ad0xd1 S524AD0XF1 (128K/256K-bit Serial EEPROM for Low Power) sii,s35390a2-wire CMOS real-time clock +skyworks,sky81452 Skyworks SKY81452: Six-Channel White LED Driver with Touch Panel Bias Supply st-micro,24c256i2c serial eeprom (24cxx) stm,m41t00 Serial Access TIMEKEEPER stm,m41t62 Serial real-time clock (RTC) with alarm -- 1.9.1 -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
[PATCH v11 5/6] devicetree: Add vendor prefix for Skyworks Solutions, Inc.
From: Gyungoh Yoo Signed-off-by: Gyungoh Yoo Acked-by: Lee Jones --- Changes v11: Nothing Changes v10: Nothing Changes v9: Nothing Changes v8: Nothing Changes v7: Nothing Changes v6: Nothing Changes v5: Nothing Changes v4: Nothing Changes v3: Nothing Changes v2: Added vendor prefix for Skyworks Solutions, Inc. Documentation/devicetree/bindings/vendor-prefixes.txt | 1 + 1 file changed, 1 insertion(+) diff --git a/Documentation/devicetree/bindings/vendor-prefixes.txt b/Documentation/devicetree/bindings/vendor-prefixes.txt index d443279..02f182d9 100644 --- a/Documentation/devicetree/bindings/vendor-prefixes.txt +++ b/Documentation/devicetree/bindings/vendor-prefixes.txt @@ -149,6 +149,7 @@ sii Seiko Instruments, Inc. silergySilergy Corp. sirf SiRF Technology, Inc. sitronix Sitronix Technology Corporation +skyworks Skyworks Solutions, Inc. smsc Standard Microsystems Corporation snps Synopsys, Inc. solidrun SolidRun -- 1.9.1 -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
[PATCH v11 4/6] devicetree: Add new SKY81452 backlight binding
From: Gyungoh Yoo Signed-off-by: Gyungoh Yoo Acked-by: Bryan Wu --- Changes v11: Renamed 'skyworks,en-channels' property to led-sources. Removed unused property 'skyworks,ovp-level'. Changes v10: Nothing Changes v9: Nothing Changes v8: Renamed property names for backlight with vendor prefix Modified gpio-enable property to generic property for GPIO Made up the example for backlight DT Changes v7: Nothing Changes v6: Nothing Changes v5: Nothing Changes v4: Nothing Changes v3: Nothing Changes v2: Added reg attribute for I2C slave address .../video/backlight/sky81452-backlight.txt | 29 ++ 1 file changed, 29 insertions(+) create mode 100644 Documentation/devicetree/bindings/video/backlight/sky81452-backlight.txt diff --git a/Documentation/devicetree/bindings/video/backlight/sky81452-backlight.txt b/Documentation/devicetree/bindings/video/backlight/sky81452-backlight.txt new file mode 100644 index 000..8bf2940 --- /dev/null +++ b/Documentation/devicetree/bindings/video/backlight/sky81452-backlight.txt @@ -0,0 +1,29 @@ +SKY81452-backlight bindings + +Required properties: +- compatible : Must be "skyworks,sky81452-backlight" + +Optional properties: +- name : Name of backlight device. Default is 'lcd-backlight'. +- gpios: GPIO to use to EN pin. + See Documentation/devicetree/bindings/gpio/gpio.txt +- led-sources : List of enabled channels from 0 to 5. + See Documentation/devicetree/bindings/leds/common.txt +- skyworks,ignore-pwm : Ignore both PWM input +- skyworks,dpwm-mode : Enable DPWM dimming mode, otherwise Analog dimming. +- skyworks,phase-shift : Enable phase shift mode +- skyworks,short-detection-threshold-volt + : It should be one of 4, 5, 6 and 7V. +- skyworks,current-limit-mA + : It should be 2300mA or 2750mA. + +Example: + + backlight { + compatible = "skyworks,sky81452-backlight"; + name = "pwm-backlight"; + led-sources = <0 1 2 5>; + skyworks,ignore-pwm; + skyworks,phase-shift; + skyworks,current-limit-mA = <2300>; + }; -- 1.9.1 -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
[PATCH v11 2/6] backlight: Add support Skyworks SKY81452 backlight driver
From: Gyungoh Yoo Signed-off-by: Gyungoh Yoo Acked-by: Jingoo Han Acked-by: Bryan Wu --- Changes v11: Renamed 'skyworks,en-channels' property to led-sources. Changes v10: Removed trivial get_brightness implementations Changes v9: Nothing Changes v8: Renamed property names for backlight with vendor prefix Modified gpio-enable property to generic property for GPIO Changes v7: Modified licensing text to GPLv2 Changes v6: Added new line character at the end of line of dev_err() Changes v5: Move sky81452-backlight.h to include/linux/platform_data Changes v4: Reordering header files for readability Removed calling to backlight_device_unregister() Removed MODULE_VERSION() Modified license to GPLv2 Changes v3: Modified DBG messages Changes v2: Added 'compatible' attribute in the driver Added message for exception or errors drivers/video/backlight/Kconfig | 10 + drivers/video/backlight/Makefile | 1 + drivers/video/backlight/sky81452-backlight.c | 353 +++ include/linux/platform_data/sky81452-backlight.h | 46 +++ 4 files changed, 410 insertions(+) create mode 100644 drivers/video/backlight/sky81452-backlight.c create mode 100644 include/linux/platform_data/sky81452-backlight.h diff --git a/drivers/video/backlight/Kconfig b/drivers/video/backlight/Kconfig index efb0904..2d9923a 100644 --- a/drivers/video/backlight/Kconfig +++ b/drivers/video/backlight/Kconfig @@ -408,6 +408,16 @@ config BACKLIGHT_PANDORA If you have a Pandora console, say Y to enable the backlight driver. +config BACKLIGHT_SKY81452 + tristate "Backlight driver for SKY81452" + depends on BACKLIGHT_CLASS_DEVICE && MFD_SKY81452 + help + If you have a Skyworks SKY81452, say Y to enable the + backlight driver. + + To compile this driver as a module, choose M here: the module will + be called sky81452-backlight + config BACKLIGHT_TPS65217 tristate "TPS65217 Backlight" depends on BACKLIGHT_CLASS_DEVICE && MFD_TPS65217 diff --git a/drivers/video/backlight/Makefile b/drivers/video/backlight/Makefile index fcd50b73..d67073f 100644 --- a/drivers/video/backlight/Makefile +++ b/drivers/video/backlight/Makefile @@ -50,6 +50,7 @@ obj-$(CONFIG_BACKLIGHT_PANDORA) += pandora_bl.o obj-$(CONFIG_BACKLIGHT_PCF50633) += pcf50633-backlight.o obj-$(CONFIG_BACKLIGHT_PWM)+= pwm_bl.o obj-$(CONFIG_BACKLIGHT_SAHARA) += kb3886_bl.o +obj-$(CONFIG_BACKLIGHT_SKY81452) += sky81452-backlight.o obj-$(CONFIG_BACKLIGHT_TOSA) += tosa_bl.o obj-$(CONFIG_BACKLIGHT_TPS65217) += tps65217_bl.o obj-$(CONFIG_BACKLIGHT_WM831X) += wm831x_bl.o diff --git a/drivers/video/backlight/sky81452-backlight.c b/drivers/video/backlight/sky81452-backlight.c new file mode 100644 index 000..052fa1b --- /dev/null +++ b/drivers/video/backlight/sky81452-backlight.c @@ -0,0 +1,353 @@ +/* + * sky81452-backlight.cSKY81452 backlight driver + * + * Copyright 2014 Skyworks Solutions Inc. + * Author : Gyungoh Yoo + * + * 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. + * + * This program is distributed in the hope that it will be useful, but + * WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, see <http://www.gnu.org/licenses/>. + */ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +/* registers */ +#define SKY81452_REG0 0x00 +#define SKY81452_REG1 0x01 +#define SKY81452_REG2 0x02 +#define SKY81452_REG4 0x04 +#define SKY81452_REG5 0x05 + +/* bit mask */ +#define SKY81452_CS0xFF +#define SKY81452_EN0x3F +#define SKY81452_IGPW 0x20 +#define SKY81452_PWMMD 0x10 +#define SKY81452_PHASE 0x08 +#define SKY81452_ILIM 0x04 +#define SKY81452_VSHRT 0x03 +#define SKY81452_OCP 0x80 +#define SKY81452_OTMP 0x40 +#define SKY81452_SHRT 0x3F +#define SKY81452_OPN 0x3F + +#define SKY81452_DEFAULT_NAME "lcd-backlight" +#define SKY81452_MAX_BRIGHTNESS(SKY81452_CS + 1) + +#define CTZ(b) __builtin_ctz(b) + +static int sky81452_bl_update_status(struct backlight_device *bd) +{ + const struct sky81452_bl_platform_data *pdata = + dev_get_platdata(bd->dev.parent); + const unsigned int brightness = (unsigned int)bd->props.brightness; + struct regmap *regmap = bl_get_data(bd); + int ret; + + if (brightness > 0) { + ret = regmap_write(regmap, SKY81452_REG0, brightness - 1); +
[PATCH v11 1/6] mfd: Add support for Skyworks SKY81452 driver
From: Gyungoh Yoo Signed-off-by: Gyungoh Yoo Acked-by: Lee Jones --- Changes v11: Nothing Changes v10: Nothing Changes v9: Nothing Changes v8: Nothing Changes v7: Modified licensing text to GPLv2 Changes v6: Added new line character at the end of line of dev_err() Changes v5: Move sky81452-backlight.h to include/linux/platform_data Changes v4: Removed MODULE_VERSION() Modified license to GPLv2 Changes v3: Fixed the backlight name from 'sky81452-bl' to 'sky81452-backlight' Assigned mfd_cell.of_compatible for binding device node Modified error messages Changes v2: Renamed CONFIG_SKY81452 to CONFIG_MFD_SKY81452 Changed the dependency from I2C=y to I2C, for CONFIG_MFD_SKY81452 Added message for exception or errors drivers/mfd/Kconfig | 12 + drivers/mfd/Makefile | 1 + drivers/mfd/sky81452.c | 108 +++ include/linux/mfd/sky81452.h | 31 + 4 files changed, 152 insertions(+) create mode 100644 drivers/mfd/sky81452.c create mode 100644 include/linux/mfd/sky81452.h diff --git a/drivers/mfd/Kconfig b/drivers/mfd/Kconfig index 2e6b731..368f650 100644 --- a/drivers/mfd/Kconfig +++ b/drivers/mfd/Kconfig @@ -714,6 +714,18 @@ config MFD_SM501_GPIO lines on the SM501. The platform data is used to supply the base number for the first GPIO line to register. +config MFD_SKY81452 + tristate "Skyworks Solutions SKY81452" + select MFD_CORE + select REGMAP_I2C + depends on I2C + help + This is the core driver for the Skyworks SKY81452 backlight and + voltage regulator device. + + This driver can also be built as a module. If so, the module + will be called sky81452. + config MFD_SMSC bool "SMSC ECE1099 series chips" depends on I2C=y diff --git a/drivers/mfd/Makefile b/drivers/mfd/Makefile index 53467e2..afae3ca 100644 --- a/drivers/mfd/Makefile +++ b/drivers/mfd/Makefile @@ -176,6 +176,7 @@ obj-$(CONFIG_MFD_IPAQ_MICRO)+= ipaq-micro.o obj-$(CONFIG_MFD_MENF21BMC)+= menf21bmc.o obj-$(CONFIG_MFD_HI6421_PMIC) += hi6421-pmic-core.o obj-$(CONFIG_MFD_DLN2) += dln2.o +obj-$(CONFIG_MFD_SKY81452) += sky81452.o intel-soc-pmic-objs:= intel_soc_pmic_core.o intel_soc_pmic_crc.o obj-$(CONFIG_INTEL_SOC_PMIC) += intel-soc-pmic.o diff --git a/drivers/mfd/sky81452.c b/drivers/mfd/sky81452.c new file mode 100644 index 000..b0c9b04 --- /dev/null +++ b/drivers/mfd/sky81452.c @@ -0,0 +1,108 @@ +/* + * sky81452.c SKY81452 MFD driver + * + * Copyright 2014 Skyworks Solutions Inc. + * Author : Gyungoh Yoo + * + * 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. + * + * This program is distributed in the hope that it will be useful, but + * WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, see <http://www.gnu.org/licenses/>. + */ + +#include +#include +#include +#include +#include +#include +#include +#include +#include + +static const struct regmap_config sky81452_config = { + .reg_bits = 8, + .val_bits = 8, +}; + +static int sky81452_probe(struct i2c_client *client, + const struct i2c_device_id *id) +{ + struct device *dev = >dev; + const struct sky81452_platform_data *pdata = dev_get_platdata(dev); + struct mfd_cell cells[2]; + struct regmap *regmap; + int ret; + + if (!pdata) { + pdata = devm_kzalloc(dev, sizeof(*pdata), GFP_KERNEL); + if (!pdata) + return -ENOMEM; + } + + regmap = devm_regmap_init_i2c(client, _config); + if (IS_ERR(regmap)) { + dev_err(dev, "failed to initialize.err=%ld\n", PTR_ERR(regmap)); + return PTR_ERR(regmap); + } + + i2c_set_clientdata(client, regmap); + + memset(cells, 0, sizeof(cells)); + cells[0].name = "sky81452-backlight"; + cells[0].of_compatible = "skyworks,sky81452-backlight"; + cells[0].platform_data = pdata->bl_pdata; + cells[0].pdata_size = sizeof(*pdata->bl_pdata); + cells[1].name = "sky81452-regulator"; + cells[1].platform_data = pdata->regulator_init_data; + cells[1].pdata_size = sizeof(*pdata->regulator_init_data); + + ret = mfd_add_devices(dev, -1, cells, ARRAY_SIZE(cells), NULL, 0, NULL); + if (ret) + dev_err(dev, "failed to add child devices. err=%d\n", ret); + + return ret; +} + +static int sky81452_remove(struct i2c_clien
[PATCH v11 0/6] Add Skyworks SKY81452 device drivers
From: Gyungoh Yoo This patch set includes regulator and backlight driver for SKY81452. Also it includes documents for device tree and module. sky81452-regulator was already applied. So this series doesn't include it. v11: Renamed 'skyworks,en-channels' property to led-sources. Removed unused property 'skyworks,ovp-level'. v10: Removed trivial get_brightness implementations for sky81452-backlight v9: Removed the change to remove MODULE_VERSION() for sky81452-regulator v8: Renamed property names for backlight with vendor prefix Modified gpio-enable property to generic property for GPIO Made up the example for backlight DT Changed the DT parsing of regulator using regulator_node and of_match v7: Modified licensing text to GPLv2 Splitted Kconfig renaming from DT patch v6: Added new line character at the end of line of dev_err() v5: Changed DT for regulator : 'lout' node should be defined under 'regulator' Removed compatible string from sky81452-regulator driver Modified sky81452-regulator to return EINVAL when of_node is NULL Move sky81452-backlight.h to include/linux/platform_data v4: Removed MODULE_VERSION() Modified license to GPLv2 Removed calling to backlight_device_unregister() in sky81452-backlight v3: Cleaned-up DBG messages Cleaned-up DT Fixed the backlight name from 'sky81452-bl' to 'sky81452-backlight' Assigned mfd_cell.of_compatible for binding device node Modified error messages Modified sky81452-regulator to return ENODATA when of_node is NULL v2: Split the patches for each sub-system Added 'reg' attribute for I2C address in device tree documents Added 'compatible' attribute in child drivers Renamed CONFIG_SKY81452 to CONFIG_MFD_SKY81452 Changed the dependency from I2C=y to I2C, for CONFIG_MFD_SKY81452 Added message for exception or errors. Added vendor prefix for Skyworks Solutions, Inc. Add SKY81452 to the Trivial Devices list Gyungoh Yoo (6): mfd: Add support for Skyworks SKY81452 driver backlight: Add support Skyworks SKY81452 backlight driver devicetree: Add new SKY81452 mfd binding devicetree: Add new SKY81452 backlight binding devicetree: Add vendor prefix for Skyworks Solutions, Inc. devicetree: Add SKY81452 to the Trivial Devices list .../devicetree/bindings/i2c/trivial-devices.txt| 1 + Documentation/devicetree/bindings/mfd/sky81452.txt | 35 ++ .../devicetree/bindings/vendor-prefixes.txt| 1 + .../video/backlight/sky81452-backlight.txt | 29 ++ drivers/mfd/Kconfig| 12 + drivers/mfd/Makefile | 1 + drivers/mfd/sky81452.c | 108 +++ drivers/video/backlight/Kconfig| 10 + drivers/video/backlight/Makefile | 1 + drivers/video/backlight/sky81452-backlight.c | 352 + include/linux/mfd/sky81452.h | 31 ++ include/linux/platform_data/sky81452-backlight.h | 46 +++ 12 files changed, 627 insertions(+) create mode 100644 Documentation/devicetree/bindings/mfd/sky81452.txt create mode 100644 Documentation/devicetree/bindings/video/backlight/sky81452-backlight.txt create mode 100644 drivers/mfd/sky81452.c create mode 100644 drivers/video/backlight/sky81452-backlight.c create mode 100644 include/linux/mfd/sky81452.h create mode 100644 include/linux/platform_data/sky81452-backlight.h -- 1.9.1 -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
[PATCH v10 0/6] Add Skyworks SKY81452 device drivers
From: Gyungoh Yoo This patch set includes regulator and backlight driver for SKY81452. Also it includes documents for device tree and module. sky81452-regulator was already applied. So this series doesn't include it. v10: Removed trivial get_brightness implementations for sky81452-backlight v9: Removed the change to remove MODULE_VERSION() for sky81452-regulator v8: Renamed property names for backlight with vendor prefix Modified gpio-enable property to generic property for GPIO Made up the example for backlight DT Changed the DT parsing of regulator using regulator_node and of_match v7: Modified licensing text to GPLv2 Splitted Kconfig renaming from DT patch v6: Added new line character at the end of line of dev_err() v5: Changed DT for regulator : 'lout' node should be defined under 'regulator' Removed compatible string from sky81452-regulator driver Modified sky81452-regulator to return EINVAL when of_node is NULL Move sky81452-backlight.h to include/linux/platform_data v4: Removed MODULE_VERSION() Modified license to GPLv2 Removed calling to backlight_device_unregister() in sky81452-backlight v3: Cleaned-up DBG messages Cleaned-up DT Fixed the backlight name from 'sky81452-bl' to 'sky81452-backlight' Assigned mfd_cell.of_compatible for binding device node Modified error messages Modified sky81452-regulator to return ENODATA when of_node is NULL v2: Split the patches for each sub-system Added 'reg' attribute for I2C address in device tree documents Added 'compatible' attribute in child drivers Renamed CONFIG_SKY81452 to CONFIG_MFD_SKY81452 Changed the dependency from I2C=y to I2C, for CONFIG_MFD_SKY81452 Added message for exception or errors. Added vendor prefix for Skyworks Solutions, Inc. Add SKY81452 to the Trivial Devices list Gyungoh Yoo (6): mfd: Add support for Skyworks SKY81452 driver backlight: Add support Skyworks SKY81452 backlight driver devicetree: mfd: Add new SKY81452 mfd binding devicetree: backlight: Add new SKY81452 backlight binding devicetree: Add vendor prefix for Skyworks Solutions, Inc. devicetree: i2c: Add SKY81452 to the Trivial Devices list .../devicetree/bindings/i2c/trivial-devices.txt| 1 + Documentation/devicetree/bindings/mfd/sky81452.txt | 36 +++ .../devicetree/bindings/vendor-prefixes.txt| 1 + .../video/backlight/sky81452-backlight.txt | 29 ++ drivers/mfd/Kconfig| 12 + drivers/mfd/Makefile | 1 + drivers/mfd/sky81452.c | 108 +++ drivers/video/backlight/Kconfig| 10 + drivers/video/backlight/Makefile | 1 + drivers/video/backlight/sky81452-backlight.c | 334 + include/linux/mfd/sky81452.h | 31 ++ include/linux/platform_data/sky81452-backlight.h | 46 +++ 12 files changed, 610 insertions(+) create mode 100644 Documentation/devicetree/bindings/mfd/sky81452.txt create mode 100644 Documentation/devicetree/bindings/video/backlight/sky81452-backlight.txt create mode 100644 drivers/mfd/sky81452.c create mode 100644 drivers/video/backlight/sky81452-backlight.c create mode 100644 include/linux/mfd/sky81452.h create mode 100644 include/linux/platform_data/sky81452-backlight.h -- 1.9.1 -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
[PATCH v10 1/6] mfd: Add support for Skyworks SKY81452 driver
From: Gyungoh Yoo Signed-off-by: Gyungoh Yoo Acked-by: Lee Jones --- Changes v10: Nothing Changes v9: Nothing Changes v8: Nothing Changes v7: Modified licensing text to GPLv2 Changes v6: Added new line character at the end of line of dev_err() Changes v5: Move sky81452-backlight.h to include/linux/platform_data Changes v4: Removed MODULE_VERSION() Modified license to GPLv2 Changes v3: Fixed the backlight name from 'sky81452-bl' to 'sky81452-backlight' Assigned mfd_cell.of_compatible for binding device node Modified error messages Changes v2: Renamed CONFIG_SKY81452 to CONFIG_MFD_SKY81452 Changed the dependency from I2C=y to I2C, for CONFIG_MFD_SKY81452 Added message for exception or errors drivers/mfd/Kconfig | 12 + drivers/mfd/Makefile | 1 + drivers/mfd/sky81452.c | 108 +++ include/linux/mfd/sky81452.h | 31 + 4 files changed, 152 insertions(+) create mode 100644 drivers/mfd/sky81452.c create mode 100644 include/linux/mfd/sky81452.h diff --git a/drivers/mfd/Kconfig b/drivers/mfd/Kconfig index 1456ea7..a54244c 100644 --- a/drivers/mfd/Kconfig +++ b/drivers/mfd/Kconfig @@ -693,6 +693,18 @@ config MFD_SM501_GPIO lines on the SM501. The platform data is used to supply the base number for the first GPIO line to register. +config MFD_SKY81452 + tristate "Skyworks Solutions SKY81452" + select MFD_CORE + select REGMAP_I2C + depends on I2C + help + This is the core driver for the Skyworks SKY81452 backlight and + voltage regulator device. + + This driver can also be built as a module. If so, the module + will be called sky81452. + config MFD_SMSC bool "SMSC ECE1099 series chips" depends on I2C=y diff --git a/drivers/mfd/Makefile b/drivers/mfd/Makefile index 8bd54b1..d9683ea 100644 --- a/drivers/mfd/Makefile +++ b/drivers/mfd/Makefile @@ -174,6 +174,7 @@ obj-$(CONFIG_MFD_STW481X) += stw481x.o obj-$(CONFIG_MFD_IPAQ_MICRO) += ipaq-micro.o obj-$(CONFIG_MFD_MENF21BMC)+= menf21bmc.o obj-$(CONFIG_MFD_HI6421_PMIC) += hi6421-pmic-core.o +obj-$(CONFIG_MFD_SKY81452) += sky81452.o intel-soc-pmic-objs:= intel_soc_pmic_core.o intel_soc_pmic_crc.o obj-$(CONFIG_INTEL_SOC_PMIC) += intel-soc-pmic.o diff --git a/drivers/mfd/sky81452.c b/drivers/mfd/sky81452.c new file mode 100644 index 000..b0c9b04 --- /dev/null +++ b/drivers/mfd/sky81452.c @@ -0,0 +1,108 @@ +/* + * sky81452.c SKY81452 MFD driver + * + * Copyright 2014 Skyworks Solutions Inc. + * Author : Gyungoh Yoo + * + * 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. + * + * This program is distributed in the hope that it will be useful, but + * WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, see <http://www.gnu.org/licenses/>. + */ + +#include +#include +#include +#include +#include +#include +#include +#include +#include + +static const struct regmap_config sky81452_config = { + .reg_bits = 8, + .val_bits = 8, +}; + +static int sky81452_probe(struct i2c_client *client, + const struct i2c_device_id *id) +{ + struct device *dev = >dev; + const struct sky81452_platform_data *pdata = dev_get_platdata(dev); + struct mfd_cell cells[2]; + struct regmap *regmap; + int ret; + + if (!pdata) { + pdata = devm_kzalloc(dev, sizeof(*pdata), GFP_KERNEL); + if (!pdata) + return -ENOMEM; + } + + regmap = devm_regmap_init_i2c(client, _config); + if (IS_ERR(regmap)) { + dev_err(dev, "failed to initialize.err=%ld\n", PTR_ERR(regmap)); + return PTR_ERR(regmap); + } + + i2c_set_clientdata(client, regmap); + + memset(cells, 0, sizeof(cells)); + cells[0].name = "sky81452-backlight"; + cells[0].of_compatible = "skyworks,sky81452-backlight"; + cells[0].platform_data = pdata->bl_pdata; + cells[0].pdata_size = sizeof(*pdata->bl_pdata); + cells[1].name = "sky81452-regulator"; + cells[1].platform_data = pdata->regulator_init_data; + cells[1].pdata_size = sizeof(*pdata->regulator_init_data); + + ret = mfd_add_devices(dev, -1, cells, ARRAY_SIZE(cells), NULL, 0, NULL); + if (ret) + dev_err(dev, "failed to add child devices. err=%d\n", ret); + + return ret; +} + +static int sky81452_remove(struct i2c_client *client) +{ + mfd_r
Re: [PATCH v10 4/6] devicetree: Add new SKY81452 backlight binding
On Wed, Feb 04, 2015 at 09:11:22AM -0600, Rob Herring wrote: > On Fri, Jan 23, 2015 at 12:28 AM, wrote: > > From: Gyungoh Yoo > > > > Signed-off-by: Gyungoh Yoo > > Acked-by: Bryan Wu > > --- > > Changes v10: > > Nothing > > > > Changes v9: > > Nothing > > > > Changes v8: > > Renamed property names for backlight with vendor prefix > > Modified gpio-enable property to generic property for GPIO > > Made up the example for backlight DT > > > > Changes v7: > > Nothing > > > > Changes v6: > > Nothing > > > > Changes v5: > > Nothing > > > > Changes v4: > > Nothing > > > > Changes v3: > > Nothing > > > > Changes v2: > > Added reg attribute for I2C slave address > > You did? Where is it? It was just changes on version 2. Since that version, the patch series was separted. > > > .../video/backlight/sky81452-backlight.txt | 29 > > ++ > > 1 file changed, 29 insertions(+) > > create mode 100644 > > Documentation/devicetree/bindings/video/backlight/sky81452-backlight.txt > > > > diff --git > > a/Documentation/devicetree/bindings/video/backlight/sky81452-backlight.txt > > b/Documentation/devicetree/bindings/video/backlight/sky81452-backlight.txt > > new file mode 100644 > > index 000..8daebf5 > > --- /dev/null > > +++ > > b/Documentation/devicetree/bindings/video/backlight/sky81452-backlight.txt > > @@ -0,0 +1,29 @@ > > +SKY81452-backlight bindings > > + > > +Required properties: > > +- compatible : Must be "skyworks,sky81452-backlight" > > + > > +Optional properties: > > +- name : Name of backlight device. Default is > > 'lcd-backlight'. > > +- gpios: GPIO to use to EN pin. > > + See Documentation/devicetree/bindings/gpio/gpio.txt > > +- skyworks,en-channels : Enable mask for current sink channel 1 to 6. > > Does led-sources property being added in 3.20 work for this? I think so. I will modify it. > > > +- skyworks,ignore-pwm : Ignore both PWM input > > +- skyworks,dpwm-mode : Enable DPWM dimming mode, otherwise Analog > > dimming. > > +- skyworks,phase-shift : Enable phase shift mode > > +- skyworks,ovp-level : Over-voltage protection level. > > + Should be between 14 or 28V. > > Please append units (-volt) I will append it and resubmit the patch. Thanks. > > > +- skyworks,short-detection-threshold : It should be one of 4, 5, 6 and > > 7V. > > Please append units (-volt) > > > +- skyworks,current-limit : It should be 2300mA or 2750mA. > > Please append units (-mA) > > > + > > +Example: > > + > > + backlight { > > + compatible = "skyworks,sky81452-backlight"; > > + name = "pwm-backlight"; > > + skyworks,en-channels = <0x3f>; > > + skyworks,ignore-pwm; > > + skyworks,phase-shift; > > + skyworks,ovp-level = <20>; > > + skyworks,current-limit = <2300>; > > + }; > > -- > > 1.9.1 > > -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
Re: [PATCH v10 4/6] devicetree: Add new SKY81452 backlight binding
On Wed, Feb 04, 2015 at 09:11:22AM -0600, Rob Herring wrote: On Fri, Jan 23, 2015 at 12:28 AM, gyun...@gmail.com wrote: From: Gyungoh Yoo jack@skyworksinc.com Signed-off-by: Gyungoh Yoo jack@skyworksinc.com Acked-by: Bryan Wu coolo...@gmail.com --- Changes v10: Nothing Changes v9: Nothing Changes v8: Renamed property names for backlight with vendor prefix Modified gpio-enable property to generic property for GPIO Made up the example for backlight DT Changes v7: Nothing Changes v6: Nothing Changes v5: Nothing Changes v4: Nothing Changes v3: Nothing Changes v2: Added reg attribute for I2C slave address You did? Where is it? It was just changes on version 2. Since that version, the patch series was separted. .../video/backlight/sky81452-backlight.txt | 29 ++ 1 file changed, 29 insertions(+) create mode 100644 Documentation/devicetree/bindings/video/backlight/sky81452-backlight.txt diff --git a/Documentation/devicetree/bindings/video/backlight/sky81452-backlight.txt b/Documentation/devicetree/bindings/video/backlight/sky81452-backlight.txt new file mode 100644 index 000..8daebf5 --- /dev/null +++ b/Documentation/devicetree/bindings/video/backlight/sky81452-backlight.txt @@ -0,0 +1,29 @@ +SKY81452-backlight bindings + +Required properties: +- compatible : Must be skyworks,sky81452-backlight + +Optional properties: +- name : Name of backlight device. Default is 'lcd-backlight'. +- gpios: GPIO to use to EN pin. + See Documentation/devicetree/bindings/gpio/gpio.txt +- skyworks,en-channels : Enable mask for current sink channel 1 to 6. Does led-sources property being added in 3.20 work for this? I think so. I will modify it. +- skyworks,ignore-pwm : Ignore both PWM input +- skyworks,dpwm-mode : Enable DPWM dimming mode, otherwise Analog dimming. +- skyworks,phase-shift : Enable phase shift mode +- skyworks,ovp-level : Over-voltage protection level. + Should be between 14 or 28V. Please append units (-volt) I will append it and resubmit the patch. Thanks. +- skyworks,short-detection-threshold : It should be one of 4, 5, 6 and 7V. Please append units (-volt) +- skyworks,current-limit : It should be 2300mA or 2750mA. Please append units (-mA) + +Example: + + backlight { + compatible = skyworks,sky81452-backlight; + name = pwm-backlight; + skyworks,en-channels = 0x3f; + skyworks,ignore-pwm; + skyworks,phase-shift; + skyworks,ovp-level = 20; + skyworks,current-limit = 2300; + }; -- 1.9.1 -- To unsubscribe from this list: send the line unsubscribe linux-kernel in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
[PATCH v10 0/6] Add Skyworks SKY81452 device drivers
From: Gyungoh Yoo jack@skyworksinc.com This patch set includes regulator and backlight driver for SKY81452. Also it includes documents for device tree and module. sky81452-regulator was already applied. So this series doesn't include it. v10: Removed trivial get_brightness implementations for sky81452-backlight v9: Removed the change to remove MODULE_VERSION() for sky81452-regulator v8: Renamed property names for backlight with vendor prefix Modified gpio-enable property to generic property for GPIO Made up the example for backlight DT Changed the DT parsing of regulator using regulator_node and of_match v7: Modified licensing text to GPLv2 Splitted Kconfig renaming from DT patch v6: Added new line character at the end of line of dev_err() v5: Changed DT for regulator : 'lout' node should be defined under 'regulator' Removed compatible string from sky81452-regulator driver Modified sky81452-regulator to return EINVAL when of_node is NULL Move sky81452-backlight.h to include/linux/platform_data v4: Removed MODULE_VERSION() Modified license to GPLv2 Removed calling to backlight_device_unregister() in sky81452-backlight v3: Cleaned-up DBG messages Cleaned-up DT Fixed the backlight name from 'sky81452-bl' to 'sky81452-backlight' Assigned mfd_cell.of_compatible for binding device node Modified error messages Modified sky81452-regulator to return ENODATA when of_node is NULL v2: Split the patches for each sub-system Added 'reg' attribute for I2C address in device tree documents Added 'compatible' attribute in child drivers Renamed CONFIG_SKY81452 to CONFIG_MFD_SKY81452 Changed the dependency from I2C=y to I2C, for CONFIG_MFD_SKY81452 Added message for exception or errors. Added vendor prefix for Skyworks Solutions, Inc. Add SKY81452 to the Trivial Devices list Gyungoh Yoo (6): mfd: Add support for Skyworks SKY81452 driver backlight: Add support Skyworks SKY81452 backlight driver devicetree: mfd: Add new SKY81452 mfd binding devicetree: backlight: Add new SKY81452 backlight binding devicetree: Add vendor prefix for Skyworks Solutions, Inc. devicetree: i2c: Add SKY81452 to the Trivial Devices list .../devicetree/bindings/i2c/trivial-devices.txt| 1 + Documentation/devicetree/bindings/mfd/sky81452.txt | 36 +++ .../devicetree/bindings/vendor-prefixes.txt| 1 + .../video/backlight/sky81452-backlight.txt | 29 ++ drivers/mfd/Kconfig| 12 + drivers/mfd/Makefile | 1 + drivers/mfd/sky81452.c | 108 +++ drivers/video/backlight/Kconfig| 10 + drivers/video/backlight/Makefile | 1 + drivers/video/backlight/sky81452-backlight.c | 334 + include/linux/mfd/sky81452.h | 31 ++ include/linux/platform_data/sky81452-backlight.h | 46 +++ 12 files changed, 610 insertions(+) create mode 100644 Documentation/devicetree/bindings/mfd/sky81452.txt create mode 100644 Documentation/devicetree/bindings/video/backlight/sky81452-backlight.txt create mode 100644 drivers/mfd/sky81452.c create mode 100644 drivers/video/backlight/sky81452-backlight.c create mode 100644 include/linux/mfd/sky81452.h create mode 100644 include/linux/platform_data/sky81452-backlight.h -- 1.9.1 -- To unsubscribe from this list: send the line unsubscribe linux-kernel in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
[PATCH v10 1/6] mfd: Add support for Skyworks SKY81452 driver
From: Gyungoh Yoo jack@skyworksinc.com Signed-off-by: Gyungoh Yoo jack@skyworksinc.com Acked-by: Lee Jones lee.jo...@linaro.org --- Changes v10: Nothing Changes v9: Nothing Changes v8: Nothing Changes v7: Modified licensing text to GPLv2 Changes v6: Added new line character at the end of line of dev_err() Changes v5: Move sky81452-backlight.h to include/linux/platform_data Changes v4: Removed MODULE_VERSION() Modified license to GPLv2 Changes v3: Fixed the backlight name from 'sky81452-bl' to 'sky81452-backlight' Assigned mfd_cell.of_compatible for binding device node Modified error messages Changes v2: Renamed CONFIG_SKY81452 to CONFIG_MFD_SKY81452 Changed the dependency from I2C=y to I2C, for CONFIG_MFD_SKY81452 Added message for exception or errors drivers/mfd/Kconfig | 12 + drivers/mfd/Makefile | 1 + drivers/mfd/sky81452.c | 108 +++ include/linux/mfd/sky81452.h | 31 + 4 files changed, 152 insertions(+) create mode 100644 drivers/mfd/sky81452.c create mode 100644 include/linux/mfd/sky81452.h diff --git a/drivers/mfd/Kconfig b/drivers/mfd/Kconfig index 1456ea7..a54244c 100644 --- a/drivers/mfd/Kconfig +++ b/drivers/mfd/Kconfig @@ -693,6 +693,18 @@ config MFD_SM501_GPIO lines on the SM501. The platform data is used to supply the base number for the first GPIO line to register. +config MFD_SKY81452 + tristate Skyworks Solutions SKY81452 + select MFD_CORE + select REGMAP_I2C + depends on I2C + help + This is the core driver for the Skyworks SKY81452 backlight and + voltage regulator device. + + This driver can also be built as a module. If so, the module + will be called sky81452. + config MFD_SMSC bool SMSC ECE1099 series chips depends on I2C=y diff --git a/drivers/mfd/Makefile b/drivers/mfd/Makefile index 8bd54b1..d9683ea 100644 --- a/drivers/mfd/Makefile +++ b/drivers/mfd/Makefile @@ -174,6 +174,7 @@ obj-$(CONFIG_MFD_STW481X) += stw481x.o obj-$(CONFIG_MFD_IPAQ_MICRO) += ipaq-micro.o obj-$(CONFIG_MFD_MENF21BMC)+= menf21bmc.o obj-$(CONFIG_MFD_HI6421_PMIC) += hi6421-pmic-core.o +obj-$(CONFIG_MFD_SKY81452) += sky81452.o intel-soc-pmic-objs:= intel_soc_pmic_core.o intel_soc_pmic_crc.o obj-$(CONFIG_INTEL_SOC_PMIC) += intel-soc-pmic.o diff --git a/drivers/mfd/sky81452.c b/drivers/mfd/sky81452.c new file mode 100644 index 000..b0c9b04 --- /dev/null +++ b/drivers/mfd/sky81452.c @@ -0,0 +1,108 @@ +/* + * sky81452.c SKY81452 MFD driver + * + * Copyright 2014 Skyworks Solutions Inc. + * Author : Gyungoh Yoo jack@skyworksinc.com + * + * 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. + * + * This program is distributed in the hope that it will be useful, but + * WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, see http://www.gnu.org/licenses/. + */ + +#include linux/kernel.h +#include linux/module.h +#include linux/init.h +#include linux/err.h +#include linux/slab.h +#include linux/i2c.h +#include linux/regmap.h +#include linux/mfd/core.h +#include linux/mfd/sky81452.h + +static const struct regmap_config sky81452_config = { + .reg_bits = 8, + .val_bits = 8, +}; + +static int sky81452_probe(struct i2c_client *client, + const struct i2c_device_id *id) +{ + struct device *dev = client-dev; + const struct sky81452_platform_data *pdata = dev_get_platdata(dev); + struct mfd_cell cells[2]; + struct regmap *regmap; + int ret; + + if (!pdata) { + pdata = devm_kzalloc(dev, sizeof(*pdata), GFP_KERNEL); + if (!pdata) + return -ENOMEM; + } + + regmap = devm_regmap_init_i2c(client, sky81452_config); + if (IS_ERR(regmap)) { + dev_err(dev, failed to initialize.err=%ld\n, PTR_ERR(regmap)); + return PTR_ERR(regmap); + } + + i2c_set_clientdata(client, regmap); + + memset(cells, 0, sizeof(cells)); + cells[0].name = sky81452-backlight; + cells[0].of_compatible = skyworks,sky81452-backlight; + cells[0].platform_data = pdata-bl_pdata; + cells[0].pdata_size = sizeof(*pdata-bl_pdata); + cells[1].name = sky81452-regulator; + cells[1].platform_data = pdata-regulator_init_data; + cells[1].pdata_size = sizeof(*pdata-regulator_init_data); + + ret = mfd_add_devices(dev, -1, cells, ARRAY_SIZE(cells), NULL, 0, NULL); + if (ret) + dev_err(dev, failed to add child devices
[PATCH v11 4/6] devicetree: Add new SKY81452 backlight binding
From: Gyungoh Yoo jack@skyworksinc.com Signed-off-by: Gyungoh Yoo jack@skyworksinc.com Acked-by: Bryan Wu coolo...@gmail.com --- Changes v11: Renamed 'skyworks,en-channels' property to led-sources. Removed unused property 'skyworks,ovp-level'. Changes v10: Nothing Changes v9: Nothing Changes v8: Renamed property names for backlight with vendor prefix Modified gpio-enable property to generic property for GPIO Made up the example for backlight DT Changes v7: Nothing Changes v6: Nothing Changes v5: Nothing Changes v4: Nothing Changes v3: Nothing Changes v2: Added reg attribute for I2C slave address .../video/backlight/sky81452-backlight.txt | 29 ++ 1 file changed, 29 insertions(+) create mode 100644 Documentation/devicetree/bindings/video/backlight/sky81452-backlight.txt diff --git a/Documentation/devicetree/bindings/video/backlight/sky81452-backlight.txt b/Documentation/devicetree/bindings/video/backlight/sky81452-backlight.txt new file mode 100644 index 000..8bf2940 --- /dev/null +++ b/Documentation/devicetree/bindings/video/backlight/sky81452-backlight.txt @@ -0,0 +1,29 @@ +SKY81452-backlight bindings + +Required properties: +- compatible : Must be skyworks,sky81452-backlight + +Optional properties: +- name : Name of backlight device. Default is 'lcd-backlight'. +- gpios: GPIO to use to EN pin. + See Documentation/devicetree/bindings/gpio/gpio.txt +- led-sources : List of enabled channels from 0 to 5. + See Documentation/devicetree/bindings/leds/common.txt +- skyworks,ignore-pwm : Ignore both PWM input +- skyworks,dpwm-mode : Enable DPWM dimming mode, otherwise Analog dimming. +- skyworks,phase-shift : Enable phase shift mode +- skyworks,short-detection-threshold-volt + : It should be one of 4, 5, 6 and 7V. +- skyworks,current-limit-mA + : It should be 2300mA or 2750mA. + +Example: + + backlight { + compatible = skyworks,sky81452-backlight; + name = pwm-backlight; + led-sources = 0 1 2 5; + skyworks,ignore-pwm; + skyworks,phase-shift; + skyworks,current-limit-mA = 2300; + }; -- 1.9.1 -- To unsubscribe from this list: send the line unsubscribe linux-kernel in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
[PATCH v11 2/6] backlight: Add support Skyworks SKY81452 backlight driver
From: Gyungoh Yoo jack@skyworksinc.com Signed-off-by: Gyungoh Yoo jack@skyworksinc.com Acked-by: Jingoo Han jg1@samsung.com Acked-by: Bryan Wu coolo...@gmail.com --- Changes v11: Renamed 'skyworks,en-channels' property to led-sources. Changes v10: Removed trivial get_brightness implementations Changes v9: Nothing Changes v8: Renamed property names for backlight with vendor prefix Modified gpio-enable property to generic property for GPIO Changes v7: Modified licensing text to GPLv2 Changes v6: Added new line character at the end of line of dev_err() Changes v5: Move sky81452-backlight.h to include/linux/platform_data Changes v4: Reordering header files for readability Removed calling to backlight_device_unregister() Removed MODULE_VERSION() Modified license to GPLv2 Changes v3: Modified DBG messages Changes v2: Added 'compatible' attribute in the driver Added message for exception or errors drivers/video/backlight/Kconfig | 10 + drivers/video/backlight/Makefile | 1 + drivers/video/backlight/sky81452-backlight.c | 353 +++ include/linux/platform_data/sky81452-backlight.h | 46 +++ 4 files changed, 410 insertions(+) create mode 100644 drivers/video/backlight/sky81452-backlight.c create mode 100644 include/linux/platform_data/sky81452-backlight.h diff --git a/drivers/video/backlight/Kconfig b/drivers/video/backlight/Kconfig index efb0904..2d9923a 100644 --- a/drivers/video/backlight/Kconfig +++ b/drivers/video/backlight/Kconfig @@ -408,6 +408,16 @@ config BACKLIGHT_PANDORA If you have a Pandora console, say Y to enable the backlight driver. +config BACKLIGHT_SKY81452 + tristate Backlight driver for SKY81452 + depends on BACKLIGHT_CLASS_DEVICE MFD_SKY81452 + help + If you have a Skyworks SKY81452, say Y to enable the + backlight driver. + + To compile this driver as a module, choose M here: the module will + be called sky81452-backlight + config BACKLIGHT_TPS65217 tristate TPS65217 Backlight depends on BACKLIGHT_CLASS_DEVICE MFD_TPS65217 diff --git a/drivers/video/backlight/Makefile b/drivers/video/backlight/Makefile index fcd50b73..d67073f 100644 --- a/drivers/video/backlight/Makefile +++ b/drivers/video/backlight/Makefile @@ -50,6 +50,7 @@ obj-$(CONFIG_BACKLIGHT_PANDORA) += pandora_bl.o obj-$(CONFIG_BACKLIGHT_PCF50633) += pcf50633-backlight.o obj-$(CONFIG_BACKLIGHT_PWM)+= pwm_bl.o obj-$(CONFIG_BACKLIGHT_SAHARA) += kb3886_bl.o +obj-$(CONFIG_BACKLIGHT_SKY81452) += sky81452-backlight.o obj-$(CONFIG_BACKLIGHT_TOSA) += tosa_bl.o obj-$(CONFIG_BACKLIGHT_TPS65217) += tps65217_bl.o obj-$(CONFIG_BACKLIGHT_WM831X) += wm831x_bl.o diff --git a/drivers/video/backlight/sky81452-backlight.c b/drivers/video/backlight/sky81452-backlight.c new file mode 100644 index 000..052fa1b --- /dev/null +++ b/drivers/video/backlight/sky81452-backlight.c @@ -0,0 +1,353 @@ +/* + * sky81452-backlight.cSKY81452 backlight driver + * + * Copyright 2014 Skyworks Solutions Inc. + * Author : Gyungoh Yoo jack@skyworksinc.com + * + * 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. + * + * This program is distributed in the hope that it will be useful, but + * WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, see http://www.gnu.org/licenses/. + */ + +#include linux/backlight.h +#include linux/err.h +#include linux/gpio.h +#include linux/init.h +#include linux/kernel.h +#include linux/module.h +#include linux/of.h +#include linux/of_gpio.h +#include linux/platform_device.h +#include linux/regmap.h +#include linux/platform_data/sky81452-backlight.h +#include linux/slab.h + +/* registers */ +#define SKY81452_REG0 0x00 +#define SKY81452_REG1 0x01 +#define SKY81452_REG2 0x02 +#define SKY81452_REG4 0x04 +#define SKY81452_REG5 0x05 + +/* bit mask */ +#define SKY81452_CS0xFF +#define SKY81452_EN0x3F +#define SKY81452_IGPW 0x20 +#define SKY81452_PWMMD 0x10 +#define SKY81452_PHASE 0x08 +#define SKY81452_ILIM 0x04 +#define SKY81452_VSHRT 0x03 +#define SKY81452_OCP 0x80 +#define SKY81452_OTMP 0x40 +#define SKY81452_SHRT 0x3F +#define SKY81452_OPN 0x3F + +#define SKY81452_DEFAULT_NAME lcd-backlight +#define SKY81452_MAX_BRIGHTNESS(SKY81452_CS + 1) + +#define CTZ(b) __builtin_ctz(b) + +static int sky81452_bl_update_status(struct backlight_device *bd) +{ + const struct sky81452_bl_platform_data *pdata = + dev_get_platdata(bd-dev.parent); + const unsigned int
[PATCH v11 0/6] Add Skyworks SKY81452 device drivers
From: Gyungoh Yoo jack@skyworksinc.com This patch set includes regulator and backlight driver for SKY81452. Also it includes documents for device tree and module. sky81452-regulator was already applied. So this series doesn't include it. v11: Renamed 'skyworks,en-channels' property to led-sources. Removed unused property 'skyworks,ovp-level'. v10: Removed trivial get_brightness implementations for sky81452-backlight v9: Removed the change to remove MODULE_VERSION() for sky81452-regulator v8: Renamed property names for backlight with vendor prefix Modified gpio-enable property to generic property for GPIO Made up the example for backlight DT Changed the DT parsing of regulator using regulator_node and of_match v7: Modified licensing text to GPLv2 Splitted Kconfig renaming from DT patch v6: Added new line character at the end of line of dev_err() v5: Changed DT for regulator : 'lout' node should be defined under 'regulator' Removed compatible string from sky81452-regulator driver Modified sky81452-regulator to return EINVAL when of_node is NULL Move sky81452-backlight.h to include/linux/platform_data v4: Removed MODULE_VERSION() Modified license to GPLv2 Removed calling to backlight_device_unregister() in sky81452-backlight v3: Cleaned-up DBG messages Cleaned-up DT Fixed the backlight name from 'sky81452-bl' to 'sky81452-backlight' Assigned mfd_cell.of_compatible for binding device node Modified error messages Modified sky81452-regulator to return ENODATA when of_node is NULL v2: Split the patches for each sub-system Added 'reg' attribute for I2C address in device tree documents Added 'compatible' attribute in child drivers Renamed CONFIG_SKY81452 to CONFIG_MFD_SKY81452 Changed the dependency from I2C=y to I2C, for CONFIG_MFD_SKY81452 Added message for exception or errors. Added vendor prefix for Skyworks Solutions, Inc. Add SKY81452 to the Trivial Devices list Gyungoh Yoo (6): mfd: Add support for Skyworks SKY81452 driver backlight: Add support Skyworks SKY81452 backlight driver devicetree: Add new SKY81452 mfd binding devicetree: Add new SKY81452 backlight binding devicetree: Add vendor prefix for Skyworks Solutions, Inc. devicetree: Add SKY81452 to the Trivial Devices list .../devicetree/bindings/i2c/trivial-devices.txt| 1 + Documentation/devicetree/bindings/mfd/sky81452.txt | 35 ++ .../devicetree/bindings/vendor-prefixes.txt| 1 + .../video/backlight/sky81452-backlight.txt | 29 ++ drivers/mfd/Kconfig| 12 + drivers/mfd/Makefile | 1 + drivers/mfd/sky81452.c | 108 +++ drivers/video/backlight/Kconfig| 10 + drivers/video/backlight/Makefile | 1 + drivers/video/backlight/sky81452-backlight.c | 352 + include/linux/mfd/sky81452.h | 31 ++ include/linux/platform_data/sky81452-backlight.h | 46 +++ 12 files changed, 627 insertions(+) create mode 100644 Documentation/devicetree/bindings/mfd/sky81452.txt create mode 100644 Documentation/devicetree/bindings/video/backlight/sky81452-backlight.txt create mode 100644 drivers/mfd/sky81452.c create mode 100644 drivers/video/backlight/sky81452-backlight.c create mode 100644 include/linux/mfd/sky81452.h create mode 100644 include/linux/platform_data/sky81452-backlight.h -- 1.9.1 -- To unsubscribe from this list: send the line unsubscribe linux-kernel in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
[PATCH v11 1/6] mfd: Add support for Skyworks SKY81452 driver
From: Gyungoh Yoo jack@skyworksinc.com Signed-off-by: Gyungoh Yoo jack@skyworksinc.com Acked-by: Lee Jones lee.jo...@linaro.org --- Changes v11: Nothing Changes v10: Nothing Changes v9: Nothing Changes v8: Nothing Changes v7: Modified licensing text to GPLv2 Changes v6: Added new line character at the end of line of dev_err() Changes v5: Move sky81452-backlight.h to include/linux/platform_data Changes v4: Removed MODULE_VERSION() Modified license to GPLv2 Changes v3: Fixed the backlight name from 'sky81452-bl' to 'sky81452-backlight' Assigned mfd_cell.of_compatible for binding device node Modified error messages Changes v2: Renamed CONFIG_SKY81452 to CONFIG_MFD_SKY81452 Changed the dependency from I2C=y to I2C, for CONFIG_MFD_SKY81452 Added message for exception or errors drivers/mfd/Kconfig | 12 + drivers/mfd/Makefile | 1 + drivers/mfd/sky81452.c | 108 +++ include/linux/mfd/sky81452.h | 31 + 4 files changed, 152 insertions(+) create mode 100644 drivers/mfd/sky81452.c create mode 100644 include/linux/mfd/sky81452.h diff --git a/drivers/mfd/Kconfig b/drivers/mfd/Kconfig index 2e6b731..368f650 100644 --- a/drivers/mfd/Kconfig +++ b/drivers/mfd/Kconfig @@ -714,6 +714,18 @@ config MFD_SM501_GPIO lines on the SM501. The platform data is used to supply the base number for the first GPIO line to register. +config MFD_SKY81452 + tristate Skyworks Solutions SKY81452 + select MFD_CORE + select REGMAP_I2C + depends on I2C + help + This is the core driver for the Skyworks SKY81452 backlight and + voltage regulator device. + + This driver can also be built as a module. If so, the module + will be called sky81452. + config MFD_SMSC bool SMSC ECE1099 series chips depends on I2C=y diff --git a/drivers/mfd/Makefile b/drivers/mfd/Makefile index 53467e2..afae3ca 100644 --- a/drivers/mfd/Makefile +++ b/drivers/mfd/Makefile @@ -176,6 +176,7 @@ obj-$(CONFIG_MFD_IPAQ_MICRO)+= ipaq-micro.o obj-$(CONFIG_MFD_MENF21BMC)+= menf21bmc.o obj-$(CONFIG_MFD_HI6421_PMIC) += hi6421-pmic-core.o obj-$(CONFIG_MFD_DLN2) += dln2.o +obj-$(CONFIG_MFD_SKY81452) += sky81452.o intel-soc-pmic-objs:= intel_soc_pmic_core.o intel_soc_pmic_crc.o obj-$(CONFIG_INTEL_SOC_PMIC) += intel-soc-pmic.o diff --git a/drivers/mfd/sky81452.c b/drivers/mfd/sky81452.c new file mode 100644 index 000..b0c9b04 --- /dev/null +++ b/drivers/mfd/sky81452.c @@ -0,0 +1,108 @@ +/* + * sky81452.c SKY81452 MFD driver + * + * Copyright 2014 Skyworks Solutions Inc. + * Author : Gyungoh Yoo jack@skyworksinc.com + * + * 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. + * + * This program is distributed in the hope that it will be useful, but + * WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, see http://www.gnu.org/licenses/. + */ + +#include linux/kernel.h +#include linux/module.h +#include linux/init.h +#include linux/err.h +#include linux/slab.h +#include linux/i2c.h +#include linux/regmap.h +#include linux/mfd/core.h +#include linux/mfd/sky81452.h + +static const struct regmap_config sky81452_config = { + .reg_bits = 8, + .val_bits = 8, +}; + +static int sky81452_probe(struct i2c_client *client, + const struct i2c_device_id *id) +{ + struct device *dev = client-dev; + const struct sky81452_platform_data *pdata = dev_get_platdata(dev); + struct mfd_cell cells[2]; + struct regmap *regmap; + int ret; + + if (!pdata) { + pdata = devm_kzalloc(dev, sizeof(*pdata), GFP_KERNEL); + if (!pdata) + return -ENOMEM; + } + + regmap = devm_regmap_init_i2c(client, sky81452_config); + if (IS_ERR(regmap)) { + dev_err(dev, failed to initialize.err=%ld\n, PTR_ERR(regmap)); + return PTR_ERR(regmap); + } + + i2c_set_clientdata(client, regmap); + + memset(cells, 0, sizeof(cells)); + cells[0].name = sky81452-backlight; + cells[0].of_compatible = skyworks,sky81452-backlight; + cells[0].platform_data = pdata-bl_pdata; + cells[0].pdata_size = sizeof(*pdata-bl_pdata); + cells[1].name = sky81452-regulator; + cells[1].platform_data = pdata-regulator_init_data; + cells[1].pdata_size = sizeof(*pdata-regulator_init_data); + + ret = mfd_add_devices(dev, -1, cells, ARRAY_SIZE(cells), NULL, 0, NULL); + if (ret) + dev_err(dev, failed
[PATCH v11 3/6] devicetree: Add new SKY81452 mfd binding
From: Gyungoh Yoo jack@skyworksinc.com Signed-off-by: Gyungoh Yoo jack@skyworksinc.com Acked-by: Lee Jones lee.jo...@linaro.org --- Changes v11: Renamed 'skyworks,en-channels' property to led-sources. Removed unused property 'skyworks,ovp-level'. Changes v10: Nothing Changes v9: Nothing Changes v8: Made up the example for backlight DT Changes v7: Nothing Changes v6: Nothing Changes v5: Changed DT for regulator : 'lout' node should be defined under 'regulator' Removed compatible string from sky81452-regulator driver Changes v4: Nothing Changes v3: Nothing Changes v2: Added reg attribute for I2C slave address Documentation/devicetree/bindings/mfd/sky81452.txt | 35 ++ 1 file changed, 35 insertions(+) create mode 100644 Documentation/devicetree/bindings/mfd/sky81452.txt diff --git a/Documentation/devicetree/bindings/mfd/sky81452.txt b/Documentation/devicetree/bindings/mfd/sky81452.txt new file mode 100644 index 000..3518179 --- /dev/null +++ b/Documentation/devicetree/bindings/mfd/sky81452.txt @@ -0,0 +1,35 @@ +SKY81452 bindings + +Required properties: +- compatible : Must be skyworks,sky81452 +- reg : I2C slave address + +Required child nodes: +- backlight: container node for backlight following the binding + in video/backlight/sky81452-backlight.txt +- regulator: container node for regulators following the binding + in regulator/sky81452-regulator.txt + +Example: + + sky81452@2c { + compatible = skyworks,sky81452; + reg = 0x2c; + + backlight { + compatible = skyworks,sky81452-backlight; + name = pwm-backlight; + led-sources = 0 1 2 3 6; + skyworks,ignore-pwm; + skyworks,phase-shift; + skyworks,current-limit = 2300; + }; + + regulator { + lout { + regulator-name = sky81452-lout; + regulator-min-microvolt = 450; + regulator-max-microvolt = 800; + }; + }; + }; -- 1.9.1 -- To unsubscribe from this list: send the line unsubscribe linux-kernel in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
[PATCH v11 6/6] devicetree: Add SKY81452 to the Trivial Devices list
From: Gyungoh Yoo jack@skyworksinc.com Signed-off-by: Gyungoh Yoo jack@skyworksinc.com --- Changes v11: Nothing Changes v10: Nothing Changes v9: Nothing Changes v8: Nothing Changes v7: Nothing Changes v6: Nothing Changes v5: Nothing Changes v4: Nothing Changes v3: Nothing Changes v2: Add SKY81452 to the Trivial Devices list Documentation/devicetree/bindings/i2c/trivial-devices.txt | 1 + 1 file changed, 1 insertion(+) diff --git a/Documentation/devicetree/bindings/i2c/trivial-devices.txt b/Documentation/devicetree/bindings/i2c/trivial-devices.txt index 9f41d05..b026167 100644 --- a/Documentation/devicetree/bindings/i2c/trivial-devices.txt +++ b/Documentation/devicetree/bindings/i2c/trivial-devices.txt @@ -88,6 +88,7 @@ ricoh,rv5c386 I2C bus SERIAL INTERFACE REAL-TIME CLOCK IC ricoh,rv5c387a I2C bus SERIAL INTERFACE REAL-TIME CLOCK IC samsung,24ad0xd1 S524AD0XF1 (128K/256K-bit Serial EEPROM for Low Power) sii,s35390a2-wire CMOS real-time clock +skyworks,sky81452 Skyworks SKY81452: Six-Channel White LED Driver with Touch Panel Bias Supply st-micro,24c256i2c serial eeprom (24cxx) stm,m41t00 Serial Access TIMEKEEPER stm,m41t62 Serial real-time clock (RTC) with alarm -- 1.9.1 -- To unsubscribe from this list: send the line unsubscribe linux-kernel in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
[PATCH v11 5/6] devicetree: Add vendor prefix for Skyworks Solutions, Inc.
From: Gyungoh Yoo jack@skyworksinc.com Signed-off-by: Gyungoh Yoo jack@skyworksinc.com Acked-by: Lee Jones lee.jo...@linaro.org --- Changes v11: Nothing Changes v10: Nothing Changes v9: Nothing Changes v8: Nothing Changes v7: Nothing Changes v6: Nothing Changes v5: Nothing Changes v4: Nothing Changes v3: Nothing Changes v2: Added vendor prefix for Skyworks Solutions, Inc. Documentation/devicetree/bindings/vendor-prefixes.txt | 1 + 1 file changed, 1 insertion(+) diff --git a/Documentation/devicetree/bindings/vendor-prefixes.txt b/Documentation/devicetree/bindings/vendor-prefixes.txt index d443279..02f182d9 100644 --- a/Documentation/devicetree/bindings/vendor-prefixes.txt +++ b/Documentation/devicetree/bindings/vendor-prefixes.txt @@ -149,6 +149,7 @@ sii Seiko Instruments, Inc. silergySilergy Corp. sirf SiRF Technology, Inc. sitronix Sitronix Technology Corporation +skyworks Skyworks Solutions, Inc. smsc Standard Microsystems Corporation snps Synopsys, Inc. solidrun SolidRun -- 1.9.1 -- To unsubscribe from this list: send the line unsubscribe linux-kernel in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
Re: [PATCH v10 0/6] Add Skyworks SKY81452 device drivers
On Thu, Feb 05, 2015 at 03:29:40PM +0900, gyun...@gmail.com wrote: Please ignore this patch serial v10. Sorry for my mistake From: Gyungoh Yoo jack@skyworksinc.com This patch set includes regulator and backlight driver for SKY81452. Also it includes documents for device tree and module. sky81452-regulator was already applied. So this series doesn't include it. v10: Removed trivial get_brightness implementations for sky81452-backlight v9: Removed the change to remove MODULE_VERSION() for sky81452-regulator v8: Renamed property names for backlight with vendor prefix Modified gpio-enable property to generic property for GPIO Made up the example for backlight DT Changed the DT parsing of regulator using regulator_node and of_match v7: Modified licensing text to GPLv2 Splitted Kconfig renaming from DT patch v6: Added new line character at the end of line of dev_err() v5: Changed DT for regulator : 'lout' node should be defined under 'regulator' Removed compatible string from sky81452-regulator driver Modified sky81452-regulator to return EINVAL when of_node is NULL Move sky81452-backlight.h to include/linux/platform_data v4: Removed MODULE_VERSION() Modified license to GPLv2 Removed calling to backlight_device_unregister() in sky81452-backlight v3: Cleaned-up DBG messages Cleaned-up DT Fixed the backlight name from 'sky81452-bl' to 'sky81452-backlight' Assigned mfd_cell.of_compatible for binding device node Modified error messages Modified sky81452-regulator to return ENODATA when of_node is NULL v2: Split the patches for each sub-system Added 'reg' attribute for I2C address in device tree documents Added 'compatible' attribute in child drivers Renamed CONFIG_SKY81452 to CONFIG_MFD_SKY81452 Changed the dependency from I2C=y to I2C, for CONFIG_MFD_SKY81452 Added message for exception or errors. Added vendor prefix for Skyworks Solutions, Inc. Add SKY81452 to the Trivial Devices list Gyungoh Yoo (6): mfd: Add support for Skyworks SKY81452 driver backlight: Add support Skyworks SKY81452 backlight driver devicetree: mfd: Add new SKY81452 mfd binding devicetree: backlight: Add new SKY81452 backlight binding devicetree: Add vendor prefix for Skyworks Solutions, Inc. devicetree: i2c: Add SKY81452 to the Trivial Devices list .../devicetree/bindings/i2c/trivial-devices.txt| 1 + Documentation/devicetree/bindings/mfd/sky81452.txt | 36 +++ .../devicetree/bindings/vendor-prefixes.txt| 1 + .../video/backlight/sky81452-backlight.txt | 29 ++ drivers/mfd/Kconfig| 12 + drivers/mfd/Makefile | 1 + drivers/mfd/sky81452.c | 108 +++ drivers/video/backlight/Kconfig| 10 + drivers/video/backlight/Makefile | 1 + drivers/video/backlight/sky81452-backlight.c | 334 + include/linux/mfd/sky81452.h | 31 ++ include/linux/platform_data/sky81452-backlight.h | 46 +++ 12 files changed, 610 insertions(+) create mode 100644 Documentation/devicetree/bindings/mfd/sky81452.txt create mode 100644 Documentation/devicetree/bindings/video/backlight/sky81452-backlight.txt create mode 100644 drivers/mfd/sky81452.c create mode 100644 drivers/video/backlight/sky81452-backlight.c create mode 100644 include/linux/mfd/sky81452.h create mode 100644 include/linux/platform_data/sky81452-backlight.h -- 1.9.1 -- To unsubscribe from this list: send the line unsubscribe linux-kernel in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
Re: [PATCH v10 4/6] devicetree: Add new SKY81452 backlight binding
On Fri, Jan 23, 2015 at 03:28:33PM +0900, gyun...@gmail.com wrote: > From: Gyungoh Yoo > > Signed-off-by: Gyungoh Yoo > Acked-by: Bryan Wu The existing Ack is only for backlight driver. DT Ack please. > --- > Changes v10: > Nothing > > Changes v9: > Nothing > > Changes v8: > Renamed property names for backlight with vendor prefix > Modified gpio-enable property to generic property for GPIO > Made up the example for backlight DT > > Changes v7: > Nothing > > Changes v6: > Nothing > > Changes v5: > Nothing > > Changes v4: > Nothing > > Changes v3: > Nothing > > Changes v2: > Added reg attribute for I2C slave address > > .../video/backlight/sky81452-backlight.txt | 29 > ++ > 1 file changed, 29 insertions(+) > create mode 100644 > Documentation/devicetree/bindings/video/backlight/sky81452-backlight.txt > > diff --git > a/Documentation/devicetree/bindings/video/backlight/sky81452-backlight.txt > b/Documentation/devicetree/bindings/video/backlight/sky81452-backlight.txt > new file mode 100644 > index 000..8daebf5 > --- /dev/null > +++ b/Documentation/devicetree/bindings/video/backlight/sky81452-backlight.txt > @@ -0,0 +1,29 @@ > +SKY81452-backlight bindings > + > +Required properties: > +- compatible : Must be "skyworks,sky81452-backlight" > + > +Optional properties: > +- name : Name of backlight device. Default is > 'lcd-backlight'. > +- gpios : GPIO to use to EN pin. > + See Documentation/devicetree/bindings/gpio/gpio.txt > +- skyworks,en-channels : Enable mask for current sink channel 1 to 6. > +- skyworks,ignore-pwm: Ignore both PWM input > +- skyworks,dpwm-mode : Enable DPWM dimming mode, otherwise Analog dimming. > +- skyworks,phase-shift : Enable phase shift mode > +- skyworks,ovp-level : Over-voltage protection level. > + Should be between 14 or 28V. > +- skyworks,short-detection-threshold : It should be one of 4, 5, 6 and 7V. > +- skyworks,current-limit : It should be 2300mA or 2750mA. > + > +Example: > + > + backlight { > + compatible = "skyworks,sky81452-backlight"; > + name = "pwm-backlight"; > + skyworks,en-channels = <0x3f>; > + skyworks,ignore-pwm; > + skyworks,phase-shift; > + skyworks,ovp-level = <20>; > + skyworks,current-limit = <2300>; > + }; > -- > 1.9.1 > -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
Re: [PATCH v10 4/6] devicetree: Add new SKY81452 backlight binding
On Fri, Jan 23, 2015 at 03:28:33PM +0900, gyun...@gmail.com wrote: From: Gyungoh Yoo jack@skyworksinc.com Signed-off-by: Gyungoh Yoo jack@skyworksinc.com Acked-by: Bryan Wu coolo...@gmail.com The existing Ack is only for backlight driver. DT Ack please. --- Changes v10: Nothing Changes v9: Nothing Changes v8: Renamed property names for backlight with vendor prefix Modified gpio-enable property to generic property for GPIO Made up the example for backlight DT Changes v7: Nothing Changes v6: Nothing Changes v5: Nothing Changes v4: Nothing Changes v3: Nothing Changes v2: Added reg attribute for I2C slave address .../video/backlight/sky81452-backlight.txt | 29 ++ 1 file changed, 29 insertions(+) create mode 100644 Documentation/devicetree/bindings/video/backlight/sky81452-backlight.txt diff --git a/Documentation/devicetree/bindings/video/backlight/sky81452-backlight.txt b/Documentation/devicetree/bindings/video/backlight/sky81452-backlight.txt new file mode 100644 index 000..8daebf5 --- /dev/null +++ b/Documentation/devicetree/bindings/video/backlight/sky81452-backlight.txt @@ -0,0 +1,29 @@ +SKY81452-backlight bindings + +Required properties: +- compatible : Must be skyworks,sky81452-backlight + +Optional properties: +- name : Name of backlight device. Default is 'lcd-backlight'. +- gpios : GPIO to use to EN pin. + See Documentation/devicetree/bindings/gpio/gpio.txt +- skyworks,en-channels : Enable mask for current sink channel 1 to 6. +- skyworks,ignore-pwm: Ignore both PWM input +- skyworks,dpwm-mode : Enable DPWM dimming mode, otherwise Analog dimming. +- skyworks,phase-shift : Enable phase shift mode +- skyworks,ovp-level : Over-voltage protection level. + Should be between 14 or 28V. +- skyworks,short-detection-threshold : It should be one of 4, 5, 6 and 7V. +- skyworks,current-limit : It should be 2300mA or 2750mA. + +Example: + + backlight { + compatible = skyworks,sky81452-backlight; + name = pwm-backlight; + skyworks,en-channels = 0x3f; + skyworks,ignore-pwm; + skyworks,phase-shift; + skyworks,ovp-level = 20; + skyworks,current-limit = 2300; + }; -- 1.9.1 -- To unsubscribe from this list: send the line unsubscribe linux-kernel in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
[PATCH v10 6/6] devicetree: i2c: Add SKY81452 to the Trivial Devices list
From: Gyungoh Yoo Signed-off-by: Gyungoh Yoo --- Changes v10: Nothing Changes v9: Nothing Changes v8: Nothing Changes v7: Nothing Changes v6: Nothing Changes v5: Nothing Changes v4: Nothing Changes v3: Nothing Changes v2: Add SKY81452 to the Trivial Devices list Documentation/devicetree/bindings/i2c/trivial-devices.txt | 1 + 1 file changed, 1 insertion(+) diff --git a/Documentation/devicetree/bindings/i2c/trivial-devices.txt b/Documentation/devicetree/bindings/i2c/trivial-devices.txt index fbde415..122fa1e 100644 --- a/Documentation/devicetree/bindings/i2c/trivial-devices.txt +++ b/Documentation/devicetree/bindings/i2c/trivial-devices.txt @@ -77,6 +77,7 @@ ramtron,24c64 i2c serial eeprom (24cxx) ricoh,rs5c372a I2C bus SERIAL INTERFACE REAL-TIME CLOCK IC samsung,24ad0xd1 S524AD0XF1 (128K/256K-bit Serial EEPROM for Low Power) sii,s35390a2-wire CMOS real-time clock +skyworks,sky81452 Skyworks SKY81452: Six-Channel White LED Driver with Touch Panel Bias Supply st-micro,24c256i2c serial eeprom (24cxx) stm,m41t00 Serial Access TIMEKEEPER stm,m41t62 Serial real-time clock (RTC) with alarm -- 1.9.1 -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
[PATCH v10 2/6] backlight: Add support Skyworks SKY81452 backlight driver
From: Gyungoh Yoo Signed-off-by: Gyungoh Yoo Acked-by: Jingoo Han Acked-by: Bryan Wu --- Changes v10: Removed trivial get_brightness implementations Changes v9: Nothing Changes v8: Renamed property names for backlight with vendor prefix Modified gpio-enable property to generic property for GPIO Changes v7: Modified licensing text to GPLv2 Changes v6: Added new line character at the end of line of dev_err() Changes v5: Move sky81452-backlight.h to include/linux/platform_data Changes v4: Reordering header files for readability Removed calling to backlight_device_unregister() Removed MODULE_VERSION() Modified license to GPLv2 Changes v3: Modified DBG messages Changes v2: Added 'compatible' attribute in the driver Added message for exception or errors drivers/video/backlight/Kconfig | 10 + drivers/video/backlight/Makefile | 1 + drivers/video/backlight/sky81452-backlight.c | 334 +++ include/linux/platform_data/sky81452-backlight.h | 46 4 files changed, 391 insertions(+) create mode 100644 drivers/video/backlight/sky81452-backlight.c create mode 100644 include/linux/platform_data/sky81452-backlight.h diff --git a/drivers/video/backlight/Kconfig b/drivers/video/backlight/Kconfig index 8d03924..2586fdd 100644 --- a/drivers/video/backlight/Kconfig +++ b/drivers/video/backlight/Kconfig @@ -409,6 +409,16 @@ config BACKLIGHT_PANDORA If you have a Pandora console, say Y to enable the backlight driver. +config BACKLIGHT_SKY81452 + tristate "Backlight driver for SKY81452" + depends on BACKLIGHT_CLASS_DEVICE && MFD_SKY81452 + help + If you have a Skyworks SKY81452, say Y to enable the + backlight driver. + + To compile this driver as a module, choose M here: the module will + be called sky81452-backlight + config BACKLIGHT_TPS65217 tristate "TPS65217 Backlight" depends on BACKLIGHT_CLASS_DEVICE && MFD_TPS65217 diff --git a/drivers/video/backlight/Makefile b/drivers/video/backlight/Makefile index fcd50b73..d67073f 100644 --- a/drivers/video/backlight/Makefile +++ b/drivers/video/backlight/Makefile @@ -50,6 +50,7 @@ obj-$(CONFIG_BACKLIGHT_PANDORA) += pandora_bl.o obj-$(CONFIG_BACKLIGHT_PCF50633) += pcf50633-backlight.o obj-$(CONFIG_BACKLIGHT_PWM)+= pwm_bl.o obj-$(CONFIG_BACKLIGHT_SAHARA) += kb3886_bl.o +obj-$(CONFIG_BACKLIGHT_SKY81452) += sky81452-backlight.o obj-$(CONFIG_BACKLIGHT_TOSA) += tosa_bl.o obj-$(CONFIG_BACKLIGHT_TPS65217) += tps65217_bl.o obj-$(CONFIG_BACKLIGHT_WM831X) += wm831x_bl.o diff --git a/drivers/video/backlight/sky81452-backlight.c b/drivers/video/backlight/sky81452-backlight.c new file mode 100644 index 000..8105597 --- /dev/null +++ b/drivers/video/backlight/sky81452-backlight.c @@ -0,0 +1,334 @@ +/* + * sky81452-backlight.cSKY81452 backlight driver + * + * Copyright 2014 Skyworks Solutions Inc. + * Author : Gyungoh Yoo + * + * 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. + * + * This program is distributed in the hope that it will be useful, but + * WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, see <http://www.gnu.org/licenses/>. + */ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +/* registers */ +#define SKY81452_REG0 0x00 +#define SKY81452_REG1 0x01 +#define SKY81452_REG2 0x02 +#define SKY81452_REG4 0x04 +#define SKY81452_REG5 0x05 + +/* bit mask */ +#define SKY81452_CS0xFF +#define SKY81452_EN0x3F +#define SKY81452_IGPW 0x20 +#define SKY81452_PWMMD 0x10 +#define SKY81452_PHASE 0x08 +#define SKY81452_ILIM 0x04 +#define SKY81452_VSHRT 0x03 +#define SKY81452_OCP 0x80 +#define SKY81452_OTMP 0x40 +#define SKY81452_SHRT 0x3F +#define SKY81452_OPN 0x3F + +#define SKY81452_DEFAULT_NAME "lcd-backlight" +#define SKY81452_MAX_BRIGHTNESS(SKY81452_CS + 1) + +#define CTZ(b) __builtin_ctz(b) + +static int sky81452_bl_update_status(struct backlight_device *bd) +{ + const struct sky81452_bl_platform_data *pdata = + dev_get_platdata(bd->dev.parent); + const unsigned int brightness = (unsigned int)bd->props.brightness; + struct regmap *regmap = bl_get_data(bd); + int ret; + + if (brightness > 0) { + ret = regmap_write(regmap, SKY81452_REG0, brightness - 1); + if (IS_ERR_VALUE(ret)) + return ret; + +
[PATCH v10 5/6] devicetree: Add vendor prefix for Skyworks Solutions, Inc.
From: Gyungoh Yoo Signed-off-by: Gyungoh Yoo Acked-by: Lee Jones --- Changes v10: Nothing Changes v9: Nothing Changes v8: Nothing Changes v7: Nothing Changes v6: Nothing Changes v5: Nothing Changes v4: Nothing Changes v3: Nothing Changes v2: Added vendor prefix for Skyworks Solutions, Inc. Documentation/devicetree/bindings/vendor-prefixes.txt | 1 + 1 file changed, 1 insertion(+) diff --git a/Documentation/devicetree/bindings/vendor-prefixes.txt b/Documentation/devicetree/bindings/vendor-prefixes.txt index a344ec2..68143f0 100644 --- a/Documentation/devicetree/bindings/vendor-prefixes.txt +++ b/Documentation/devicetree/bindings/vendor-prefixes.txt @@ -140,6 +140,7 @@ sii Seiko Instruments, Inc. silergySilergy Corp. sirf SiRF Technology, Inc. sitronix Sitronix Technology Corporation +skyworks Skyworks Solutions, Inc. smsc Standard Microsystems Corporation snps Synopsys, Inc. solidrun SolidRun -- 1.9.1 -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
[PATCH v10 3/6] devicetree: Add new SKY81452 mfd binding
From: Gyungoh Yoo Signed-off-by: Gyungoh Yoo Acked-by: Lee Jones --- Changes v10: Nothing Changes v9: Nothing Changes v8: Made up the example for backlight DT Changes v7: Nothing Changes v6: Nothing Changes v5: Changed DT for regulator : 'lout' node should be defined under 'regulator' Removed compatible string from sky81452-regulator driver Changes v4: Nothing Changes v3: Nothing Changes v2: Added reg attribute for I2C slave address Documentation/devicetree/bindings/mfd/sky81452.txt | 36 ++ 1 file changed, 36 insertions(+) create mode 100644 Documentation/devicetree/bindings/mfd/sky81452.txt diff --git a/Documentation/devicetree/bindings/mfd/sky81452.txt b/Documentation/devicetree/bindings/mfd/sky81452.txt new file mode 100644 index 000..ab71473 --- /dev/null +++ b/Documentation/devicetree/bindings/mfd/sky81452.txt @@ -0,0 +1,36 @@ +SKY81452 bindings + +Required properties: +- compatible : Must be "skyworks,sky81452" +- reg : I2C slave address + +Required child nodes: +- backlight: container node for backlight following the binding + in video/backlight/sky81452-backlight.txt +- regulator: container node for regulators following the binding + in regulator/sky81452-regulator.txt + +Example: + + sky81452@2c { + compatible = "skyworks,sky81452"; + reg = <0x2c>; + + backlight { + compatible = "skyworks,sky81452-backlight"; + name = "pwm-backlight"; + skyworks,en-channels = <0x3f>; + skyworks,ignore-pwm; + skyworks,phase-shift; + skyworks,ovp-level = <20>; + skyworks,current-limit = <2300>; + }; + + regulator { + lout { + regulator-name = "sky81452-lout"; + regulator-min-microvolt = <450>; + regulator-max-microvolt = <800>; + }; + }; + }; -- 1.9.1 -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
[PATCH v10 1/6] mfd: Add support for Skyworks SKY81452 driver
From: Gyungoh Yoo Signed-off-by: Gyungoh Yoo Acked-by: Lee Jones --- Changes v10: Nothing Changes v9: Nothing Changes v8: Nothing Changes v7: Modified licensing text to GPLv2 Changes v6: Added new line character at the end of line of dev_err() Changes v5: Move sky81452-backlight.h to include/linux/platform_data Changes v4: Removed MODULE_VERSION() Modified license to GPLv2 Changes v3: Fixed the backlight name from 'sky81452-bl' to 'sky81452-backlight' Assigned mfd_cell.of_compatible for binding device node Modified error messages Changes v2: Renamed CONFIG_SKY81452 to CONFIG_MFD_SKY81452 Changed the dependency from I2C=y to I2C, for CONFIG_MFD_SKY81452 Added message for exception or errors drivers/mfd/Kconfig | 12 + drivers/mfd/Makefile | 1 + drivers/mfd/sky81452.c | 108 +++ include/linux/mfd/sky81452.h | 31 + 4 files changed, 152 insertions(+) create mode 100644 drivers/mfd/sky81452.c create mode 100644 include/linux/mfd/sky81452.h diff --git a/drivers/mfd/Kconfig b/drivers/mfd/Kconfig index 1456ea7..a54244c 100644 --- a/drivers/mfd/Kconfig +++ b/drivers/mfd/Kconfig @@ -693,6 +693,18 @@ config MFD_SM501_GPIO lines on the SM501. The platform data is used to supply the base number for the first GPIO line to register. +config MFD_SKY81452 + tristate "Skyworks Solutions SKY81452" + select MFD_CORE + select REGMAP_I2C + depends on I2C + help + This is the core driver for the Skyworks SKY81452 backlight and + voltage regulator device. + + This driver can also be built as a module. If so, the module + will be called sky81452. + config MFD_SMSC bool "SMSC ECE1099 series chips" depends on I2C=y diff --git a/drivers/mfd/Makefile b/drivers/mfd/Makefile index 8bd54b1..d9683ea 100644 --- a/drivers/mfd/Makefile +++ b/drivers/mfd/Makefile @@ -174,6 +174,7 @@ obj-$(CONFIG_MFD_STW481X) += stw481x.o obj-$(CONFIG_MFD_IPAQ_MICRO) += ipaq-micro.o obj-$(CONFIG_MFD_MENF21BMC)+= menf21bmc.o obj-$(CONFIG_MFD_HI6421_PMIC) += hi6421-pmic-core.o +obj-$(CONFIG_MFD_SKY81452) += sky81452.o intel-soc-pmic-objs:= intel_soc_pmic_core.o intel_soc_pmic_crc.o obj-$(CONFIG_INTEL_SOC_PMIC) += intel-soc-pmic.o diff --git a/drivers/mfd/sky81452.c b/drivers/mfd/sky81452.c new file mode 100644 index 000..b0c9b04 --- /dev/null +++ b/drivers/mfd/sky81452.c @@ -0,0 +1,108 @@ +/* + * sky81452.c SKY81452 MFD driver + * + * Copyright 2014 Skyworks Solutions Inc. + * Author : Gyungoh Yoo + * + * 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. + * + * This program is distributed in the hope that it will be useful, but + * WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, see <http://www.gnu.org/licenses/>. + */ + +#include +#include +#include +#include +#include +#include +#include +#include +#include + +static const struct regmap_config sky81452_config = { + .reg_bits = 8, + .val_bits = 8, +}; + +static int sky81452_probe(struct i2c_client *client, + const struct i2c_device_id *id) +{ + struct device *dev = >dev; + const struct sky81452_platform_data *pdata = dev_get_platdata(dev); + struct mfd_cell cells[2]; + struct regmap *regmap; + int ret; + + if (!pdata) { + pdata = devm_kzalloc(dev, sizeof(*pdata), GFP_KERNEL); + if (!pdata) + return -ENOMEM; + } + + regmap = devm_regmap_init_i2c(client, _config); + if (IS_ERR(regmap)) { + dev_err(dev, "failed to initialize.err=%ld\n", PTR_ERR(regmap)); + return PTR_ERR(regmap); + } + + i2c_set_clientdata(client, regmap); + + memset(cells, 0, sizeof(cells)); + cells[0].name = "sky81452-backlight"; + cells[0].of_compatible = "skyworks,sky81452-backlight"; + cells[0].platform_data = pdata->bl_pdata; + cells[0].pdata_size = sizeof(*pdata->bl_pdata); + cells[1].name = "sky81452-regulator"; + cells[1].platform_data = pdata->regulator_init_data; + cells[1].pdata_size = sizeof(*pdata->regulator_init_data); + + ret = mfd_add_devices(dev, -1, cells, ARRAY_SIZE(cells), NULL, 0, NULL); + if (ret) + dev_err(dev, "failed to add child devices. err=%d\n", ret); + + return ret; +} + +static int sky81452_remove(struct i2c_client *client) +{ + mfd_r
[PATCH v10 0/6] Add Skyworks SKY81452 device drivers
From: Gyungoh Yoo This patch set includes regulator and backlight driver for SKY81452. Also it includes documents for device tree and module. sky81452-regulator was already applied. So this series doesn't include it. v10: Removed trivial get_brightness implementations for sky81452-backlight v9: Removed the change to remove MODULE_VERSION() for sky81452-regulator v8: Renamed property names for backlight with vendor prefix Modified gpio-enable property to generic property for GPIO Made up the example for backlight DT Changed the DT parsing of regulator using regulator_node and of_match v7: Modified licensing text to GPLv2 Splitted Kconfig renaming from DT patch v6: Added new line character at the end of line of dev_err() v5: Changed DT for regulator : 'lout' node should be defined under 'regulator' Removed compatible string from sky81452-regulator driver Modified sky81452-regulator to return EINVAL when of_node is NULL Move sky81452-backlight.h to include/linux/platform_data v4: Removed MODULE_VERSION() Modified license to GPLv2 Removed calling to backlight_device_unregister() in sky81452-backlight v3: Cleaned-up DBG messages Cleaned-up DT Fixed the backlight name from 'sky81452-bl' to 'sky81452-backlight' Assigned mfd_cell.of_compatible for binding device node Modified error messages Modified sky81452-regulator to return ENODATA when of_node is NULL v2: Split the patches for each sub-system Added 'reg' attribute for I2C address in device tree documents Added 'compatible' attribute in child drivers Renamed CONFIG_SKY81452 to CONFIG_MFD_SKY81452 Changed the dependency from I2C=y to I2C, for CONFIG_MFD_SKY81452 Added message for exception or errors. Added vendor prefix for Skyworks Solutions, Inc. Add SKY81452 to the Trivial Devices list Gyungoh Yoo (6): mfd: Add support for Skyworks SKY81452 driver backlight: Add support Skyworks SKY81452 backlight driver devicetree: mfd: Add new SKY81452 mfd binding devicetree: backlight: Add new SKY81452 backlight binding devicetree: Add vendor prefix for Skyworks Solutions, Inc. devicetree: i2c: Add SKY81452 to the Trivial Devices list .../devicetree/bindings/i2c/trivial-devices.txt| 1 + Documentation/devicetree/bindings/mfd/sky81452.txt | 36 +++ .../devicetree/bindings/vendor-prefixes.txt| 1 + .../video/backlight/sky81452-backlight.txt | 29 ++ drivers/mfd/Kconfig| 12 + drivers/mfd/Makefile | 1 + drivers/mfd/sky81452.c | 108 +++ drivers/video/backlight/Kconfig| 10 + drivers/video/backlight/Makefile | 1 + drivers/video/backlight/sky81452-backlight.c | 334 + include/linux/mfd/sky81452.h | 31 ++ include/linux/platform_data/sky81452-backlight.h | 46 +++ 12 files changed, 610 insertions(+) create mode 100644 Documentation/devicetree/bindings/mfd/sky81452.txt create mode 100644 Documentation/devicetree/bindings/video/backlight/sky81452-backlight.txt create mode 100644 drivers/mfd/sky81452.c create mode 100644 drivers/video/backlight/sky81452-backlight.c create mode 100644 include/linux/mfd/sky81452.h create mode 100644 include/linux/platform_data/sky81452-backlight.h -- 1.9.1 -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
[PATCH v10 4/6] devicetree: Add new SKY81452 backlight binding
From: Gyungoh Yoo Signed-off-by: Gyungoh Yoo Acked-by: Bryan Wu --- Changes v10: Nothing Changes v9: Nothing Changes v8: Renamed property names for backlight with vendor prefix Modified gpio-enable property to generic property for GPIO Made up the example for backlight DT Changes v7: Nothing Changes v6: Nothing Changes v5: Nothing Changes v4: Nothing Changes v3: Nothing Changes v2: Added reg attribute for I2C slave address .../video/backlight/sky81452-backlight.txt | 29 ++ 1 file changed, 29 insertions(+) create mode 100644 Documentation/devicetree/bindings/video/backlight/sky81452-backlight.txt diff --git a/Documentation/devicetree/bindings/video/backlight/sky81452-backlight.txt b/Documentation/devicetree/bindings/video/backlight/sky81452-backlight.txt new file mode 100644 index 000..8daebf5 --- /dev/null +++ b/Documentation/devicetree/bindings/video/backlight/sky81452-backlight.txt @@ -0,0 +1,29 @@ +SKY81452-backlight bindings + +Required properties: +- compatible : Must be "skyworks,sky81452-backlight" + +Optional properties: +- name : Name of backlight device. Default is 'lcd-backlight'. +- gpios: GPIO to use to EN pin. + See Documentation/devicetree/bindings/gpio/gpio.txt +- skyworks,en-channels : Enable mask for current sink channel 1 to 6. +- skyworks,ignore-pwm : Ignore both PWM input +- skyworks,dpwm-mode : Enable DPWM dimming mode, otherwise Analog dimming. +- skyworks,phase-shift : Enable phase shift mode +- skyworks,ovp-level : Over-voltage protection level. + Should be between 14 or 28V. +- skyworks,short-detection-threshold : It should be one of 4, 5, 6 and 7V. +- skyworks,current-limit : It should be 2300mA or 2750mA. + +Example: + + backlight { + compatible = "skyworks,sky81452-backlight"; + name = "pwm-backlight"; + skyworks,en-channels = <0x3f>; + skyworks,ignore-pwm; + skyworks,phase-shift; + skyworks,ovp-level = <20>; + skyworks,current-limit = <2300>; + }; -- 1.9.1 -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
[PATCH v10 2/6] backlight: Add support Skyworks SKY81452 backlight driver
From: Gyungoh Yoo jack@skyworksinc.com Signed-off-by: Gyungoh Yoo jack@skyworksinc.com Acked-by: Jingoo Han jg1@samsung.com Acked-by: Bryan Wu coolo...@gmail.com --- Changes v10: Removed trivial get_brightness implementations Changes v9: Nothing Changes v8: Renamed property names for backlight with vendor prefix Modified gpio-enable property to generic property for GPIO Changes v7: Modified licensing text to GPLv2 Changes v6: Added new line character at the end of line of dev_err() Changes v5: Move sky81452-backlight.h to include/linux/platform_data Changes v4: Reordering header files for readability Removed calling to backlight_device_unregister() Removed MODULE_VERSION() Modified license to GPLv2 Changes v3: Modified DBG messages Changes v2: Added 'compatible' attribute in the driver Added message for exception or errors drivers/video/backlight/Kconfig | 10 + drivers/video/backlight/Makefile | 1 + drivers/video/backlight/sky81452-backlight.c | 334 +++ include/linux/platform_data/sky81452-backlight.h | 46 4 files changed, 391 insertions(+) create mode 100644 drivers/video/backlight/sky81452-backlight.c create mode 100644 include/linux/platform_data/sky81452-backlight.h diff --git a/drivers/video/backlight/Kconfig b/drivers/video/backlight/Kconfig index 8d03924..2586fdd 100644 --- a/drivers/video/backlight/Kconfig +++ b/drivers/video/backlight/Kconfig @@ -409,6 +409,16 @@ config BACKLIGHT_PANDORA If you have a Pandora console, say Y to enable the backlight driver. +config BACKLIGHT_SKY81452 + tristate Backlight driver for SKY81452 + depends on BACKLIGHT_CLASS_DEVICE MFD_SKY81452 + help + If you have a Skyworks SKY81452, say Y to enable the + backlight driver. + + To compile this driver as a module, choose M here: the module will + be called sky81452-backlight + config BACKLIGHT_TPS65217 tristate TPS65217 Backlight depends on BACKLIGHT_CLASS_DEVICE MFD_TPS65217 diff --git a/drivers/video/backlight/Makefile b/drivers/video/backlight/Makefile index fcd50b73..d67073f 100644 --- a/drivers/video/backlight/Makefile +++ b/drivers/video/backlight/Makefile @@ -50,6 +50,7 @@ obj-$(CONFIG_BACKLIGHT_PANDORA) += pandora_bl.o obj-$(CONFIG_BACKLIGHT_PCF50633) += pcf50633-backlight.o obj-$(CONFIG_BACKLIGHT_PWM)+= pwm_bl.o obj-$(CONFIG_BACKLIGHT_SAHARA) += kb3886_bl.o +obj-$(CONFIG_BACKLIGHT_SKY81452) += sky81452-backlight.o obj-$(CONFIG_BACKLIGHT_TOSA) += tosa_bl.o obj-$(CONFIG_BACKLIGHT_TPS65217) += tps65217_bl.o obj-$(CONFIG_BACKLIGHT_WM831X) += wm831x_bl.o diff --git a/drivers/video/backlight/sky81452-backlight.c b/drivers/video/backlight/sky81452-backlight.c new file mode 100644 index 000..8105597 --- /dev/null +++ b/drivers/video/backlight/sky81452-backlight.c @@ -0,0 +1,334 @@ +/* + * sky81452-backlight.cSKY81452 backlight driver + * + * Copyright 2014 Skyworks Solutions Inc. + * Author : Gyungoh Yoo jack@skyworksinc.com + * + * 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. + * + * This program is distributed in the hope that it will be useful, but + * WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, see http://www.gnu.org/licenses/. + */ + +#include linux/backlight.h +#include linux/err.h +#include linux/gpio.h +#include linux/init.h +#include linux/kernel.h +#include linux/module.h +#include linux/of.h +#include linux/of_gpio.h +#include linux/platform_device.h +#include linux/regmap.h +#include linux/platform_data/sky81452-backlight.h +#include linux/slab.h + +/* registers */ +#define SKY81452_REG0 0x00 +#define SKY81452_REG1 0x01 +#define SKY81452_REG2 0x02 +#define SKY81452_REG4 0x04 +#define SKY81452_REG5 0x05 + +/* bit mask */ +#define SKY81452_CS0xFF +#define SKY81452_EN0x3F +#define SKY81452_IGPW 0x20 +#define SKY81452_PWMMD 0x10 +#define SKY81452_PHASE 0x08 +#define SKY81452_ILIM 0x04 +#define SKY81452_VSHRT 0x03 +#define SKY81452_OCP 0x80 +#define SKY81452_OTMP 0x40 +#define SKY81452_SHRT 0x3F +#define SKY81452_OPN 0x3F + +#define SKY81452_DEFAULT_NAME lcd-backlight +#define SKY81452_MAX_BRIGHTNESS(SKY81452_CS + 1) + +#define CTZ(b) __builtin_ctz(b) + +static int sky81452_bl_update_status(struct backlight_device *bd) +{ + const struct sky81452_bl_platform_data *pdata = + dev_get_platdata(bd-dev.parent); + const unsigned int brightness = (unsigned int)bd-props.brightness; + struct regmap *regmap
[PATCH v10 5/6] devicetree: Add vendor prefix for Skyworks Solutions, Inc.
From: Gyungoh Yoo jack@skyworksinc.com Signed-off-by: Gyungoh Yoo jack@skyworksinc.com Acked-by: Lee Jones lee.jo...@linaro.org --- Changes v10: Nothing Changes v9: Nothing Changes v8: Nothing Changes v7: Nothing Changes v6: Nothing Changes v5: Nothing Changes v4: Nothing Changes v3: Nothing Changes v2: Added vendor prefix for Skyworks Solutions, Inc. Documentation/devicetree/bindings/vendor-prefixes.txt | 1 + 1 file changed, 1 insertion(+) diff --git a/Documentation/devicetree/bindings/vendor-prefixes.txt b/Documentation/devicetree/bindings/vendor-prefixes.txt index a344ec2..68143f0 100644 --- a/Documentation/devicetree/bindings/vendor-prefixes.txt +++ b/Documentation/devicetree/bindings/vendor-prefixes.txt @@ -140,6 +140,7 @@ sii Seiko Instruments, Inc. silergySilergy Corp. sirf SiRF Technology, Inc. sitronix Sitronix Technology Corporation +skyworks Skyworks Solutions, Inc. smsc Standard Microsystems Corporation snps Synopsys, Inc. solidrun SolidRun -- 1.9.1 -- To unsubscribe from this list: send the line unsubscribe linux-kernel in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
[PATCH v10 3/6] devicetree: Add new SKY81452 mfd binding
From: Gyungoh Yoo jack@skyworksinc.com Signed-off-by: Gyungoh Yoo jack@skyworksinc.com Acked-by: Lee Jones lee.jo...@linaro.org --- Changes v10: Nothing Changes v9: Nothing Changes v8: Made up the example for backlight DT Changes v7: Nothing Changes v6: Nothing Changes v5: Changed DT for regulator : 'lout' node should be defined under 'regulator' Removed compatible string from sky81452-regulator driver Changes v4: Nothing Changes v3: Nothing Changes v2: Added reg attribute for I2C slave address Documentation/devicetree/bindings/mfd/sky81452.txt | 36 ++ 1 file changed, 36 insertions(+) create mode 100644 Documentation/devicetree/bindings/mfd/sky81452.txt diff --git a/Documentation/devicetree/bindings/mfd/sky81452.txt b/Documentation/devicetree/bindings/mfd/sky81452.txt new file mode 100644 index 000..ab71473 --- /dev/null +++ b/Documentation/devicetree/bindings/mfd/sky81452.txt @@ -0,0 +1,36 @@ +SKY81452 bindings + +Required properties: +- compatible : Must be skyworks,sky81452 +- reg : I2C slave address + +Required child nodes: +- backlight: container node for backlight following the binding + in video/backlight/sky81452-backlight.txt +- regulator: container node for regulators following the binding + in regulator/sky81452-regulator.txt + +Example: + + sky81452@2c { + compatible = skyworks,sky81452; + reg = 0x2c; + + backlight { + compatible = skyworks,sky81452-backlight; + name = pwm-backlight; + skyworks,en-channels = 0x3f; + skyworks,ignore-pwm; + skyworks,phase-shift; + skyworks,ovp-level = 20; + skyworks,current-limit = 2300; + }; + + regulator { + lout { + regulator-name = sky81452-lout; + regulator-min-microvolt = 450; + regulator-max-microvolt = 800; + }; + }; + }; -- 1.9.1 -- To unsubscribe from this list: send the line unsubscribe linux-kernel in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
[PATCH v10 1/6] mfd: Add support for Skyworks SKY81452 driver
From: Gyungoh Yoo jack@skyworksinc.com Signed-off-by: Gyungoh Yoo jack@skyworksinc.com Acked-by: Lee Jones lee.jo...@linaro.org --- Changes v10: Nothing Changes v9: Nothing Changes v8: Nothing Changes v7: Modified licensing text to GPLv2 Changes v6: Added new line character at the end of line of dev_err() Changes v5: Move sky81452-backlight.h to include/linux/platform_data Changes v4: Removed MODULE_VERSION() Modified license to GPLv2 Changes v3: Fixed the backlight name from 'sky81452-bl' to 'sky81452-backlight' Assigned mfd_cell.of_compatible for binding device node Modified error messages Changes v2: Renamed CONFIG_SKY81452 to CONFIG_MFD_SKY81452 Changed the dependency from I2C=y to I2C, for CONFIG_MFD_SKY81452 Added message for exception or errors drivers/mfd/Kconfig | 12 + drivers/mfd/Makefile | 1 + drivers/mfd/sky81452.c | 108 +++ include/linux/mfd/sky81452.h | 31 + 4 files changed, 152 insertions(+) create mode 100644 drivers/mfd/sky81452.c create mode 100644 include/linux/mfd/sky81452.h diff --git a/drivers/mfd/Kconfig b/drivers/mfd/Kconfig index 1456ea7..a54244c 100644 --- a/drivers/mfd/Kconfig +++ b/drivers/mfd/Kconfig @@ -693,6 +693,18 @@ config MFD_SM501_GPIO lines on the SM501. The platform data is used to supply the base number for the first GPIO line to register. +config MFD_SKY81452 + tristate Skyworks Solutions SKY81452 + select MFD_CORE + select REGMAP_I2C + depends on I2C + help + This is the core driver for the Skyworks SKY81452 backlight and + voltage regulator device. + + This driver can also be built as a module. If so, the module + will be called sky81452. + config MFD_SMSC bool SMSC ECE1099 series chips depends on I2C=y diff --git a/drivers/mfd/Makefile b/drivers/mfd/Makefile index 8bd54b1..d9683ea 100644 --- a/drivers/mfd/Makefile +++ b/drivers/mfd/Makefile @@ -174,6 +174,7 @@ obj-$(CONFIG_MFD_STW481X) += stw481x.o obj-$(CONFIG_MFD_IPAQ_MICRO) += ipaq-micro.o obj-$(CONFIG_MFD_MENF21BMC)+= menf21bmc.o obj-$(CONFIG_MFD_HI6421_PMIC) += hi6421-pmic-core.o +obj-$(CONFIG_MFD_SKY81452) += sky81452.o intel-soc-pmic-objs:= intel_soc_pmic_core.o intel_soc_pmic_crc.o obj-$(CONFIG_INTEL_SOC_PMIC) += intel-soc-pmic.o diff --git a/drivers/mfd/sky81452.c b/drivers/mfd/sky81452.c new file mode 100644 index 000..b0c9b04 --- /dev/null +++ b/drivers/mfd/sky81452.c @@ -0,0 +1,108 @@ +/* + * sky81452.c SKY81452 MFD driver + * + * Copyright 2014 Skyworks Solutions Inc. + * Author : Gyungoh Yoo jack@skyworksinc.com + * + * 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. + * + * This program is distributed in the hope that it will be useful, but + * WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, see http://www.gnu.org/licenses/. + */ + +#include linux/kernel.h +#include linux/module.h +#include linux/init.h +#include linux/err.h +#include linux/slab.h +#include linux/i2c.h +#include linux/regmap.h +#include linux/mfd/core.h +#include linux/mfd/sky81452.h + +static const struct regmap_config sky81452_config = { + .reg_bits = 8, + .val_bits = 8, +}; + +static int sky81452_probe(struct i2c_client *client, + const struct i2c_device_id *id) +{ + struct device *dev = client-dev; + const struct sky81452_platform_data *pdata = dev_get_platdata(dev); + struct mfd_cell cells[2]; + struct regmap *regmap; + int ret; + + if (!pdata) { + pdata = devm_kzalloc(dev, sizeof(*pdata), GFP_KERNEL); + if (!pdata) + return -ENOMEM; + } + + regmap = devm_regmap_init_i2c(client, sky81452_config); + if (IS_ERR(regmap)) { + dev_err(dev, failed to initialize.err=%ld\n, PTR_ERR(regmap)); + return PTR_ERR(regmap); + } + + i2c_set_clientdata(client, regmap); + + memset(cells, 0, sizeof(cells)); + cells[0].name = sky81452-backlight; + cells[0].of_compatible = skyworks,sky81452-backlight; + cells[0].platform_data = pdata-bl_pdata; + cells[0].pdata_size = sizeof(*pdata-bl_pdata); + cells[1].name = sky81452-regulator; + cells[1].platform_data = pdata-regulator_init_data; + cells[1].pdata_size = sizeof(*pdata-regulator_init_data); + + ret = mfd_add_devices(dev, -1, cells, ARRAY_SIZE(cells), NULL, 0, NULL); + if (ret) + dev_err(dev, failed to add child devices
[PATCH v10 4/6] devicetree: Add new SKY81452 backlight binding
From: Gyungoh Yoo jack@skyworksinc.com Signed-off-by: Gyungoh Yoo jack@skyworksinc.com Acked-by: Bryan Wu coolo...@gmail.com --- Changes v10: Nothing Changes v9: Nothing Changes v8: Renamed property names for backlight with vendor prefix Modified gpio-enable property to generic property for GPIO Made up the example for backlight DT Changes v7: Nothing Changes v6: Nothing Changes v5: Nothing Changes v4: Nothing Changes v3: Nothing Changes v2: Added reg attribute for I2C slave address .../video/backlight/sky81452-backlight.txt | 29 ++ 1 file changed, 29 insertions(+) create mode 100644 Documentation/devicetree/bindings/video/backlight/sky81452-backlight.txt diff --git a/Documentation/devicetree/bindings/video/backlight/sky81452-backlight.txt b/Documentation/devicetree/bindings/video/backlight/sky81452-backlight.txt new file mode 100644 index 000..8daebf5 --- /dev/null +++ b/Documentation/devicetree/bindings/video/backlight/sky81452-backlight.txt @@ -0,0 +1,29 @@ +SKY81452-backlight bindings + +Required properties: +- compatible : Must be skyworks,sky81452-backlight + +Optional properties: +- name : Name of backlight device. Default is 'lcd-backlight'. +- gpios: GPIO to use to EN pin. + See Documentation/devicetree/bindings/gpio/gpio.txt +- skyworks,en-channels : Enable mask for current sink channel 1 to 6. +- skyworks,ignore-pwm : Ignore both PWM input +- skyworks,dpwm-mode : Enable DPWM dimming mode, otherwise Analog dimming. +- skyworks,phase-shift : Enable phase shift mode +- skyworks,ovp-level : Over-voltage protection level. + Should be between 14 or 28V. +- skyworks,short-detection-threshold : It should be one of 4, 5, 6 and 7V. +- skyworks,current-limit : It should be 2300mA or 2750mA. + +Example: + + backlight { + compatible = skyworks,sky81452-backlight; + name = pwm-backlight; + skyworks,en-channels = 0x3f; + skyworks,ignore-pwm; + skyworks,phase-shift; + skyworks,ovp-level = 20; + skyworks,current-limit = 2300; + }; -- 1.9.1 -- To unsubscribe from this list: send the line unsubscribe linux-kernel in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
[PATCH v10 0/6] Add Skyworks SKY81452 device drivers
From: Gyungoh Yoo jack@skyworksinc.com This patch set includes regulator and backlight driver for SKY81452. Also it includes documents for device tree and module. sky81452-regulator was already applied. So this series doesn't include it. v10: Removed trivial get_brightness implementations for sky81452-backlight v9: Removed the change to remove MODULE_VERSION() for sky81452-regulator v8: Renamed property names for backlight with vendor prefix Modified gpio-enable property to generic property for GPIO Made up the example for backlight DT Changed the DT parsing of regulator using regulator_node and of_match v7: Modified licensing text to GPLv2 Splitted Kconfig renaming from DT patch v6: Added new line character at the end of line of dev_err() v5: Changed DT for regulator : 'lout' node should be defined under 'regulator' Removed compatible string from sky81452-regulator driver Modified sky81452-regulator to return EINVAL when of_node is NULL Move sky81452-backlight.h to include/linux/platform_data v4: Removed MODULE_VERSION() Modified license to GPLv2 Removed calling to backlight_device_unregister() in sky81452-backlight v3: Cleaned-up DBG messages Cleaned-up DT Fixed the backlight name from 'sky81452-bl' to 'sky81452-backlight' Assigned mfd_cell.of_compatible for binding device node Modified error messages Modified sky81452-regulator to return ENODATA when of_node is NULL v2: Split the patches for each sub-system Added 'reg' attribute for I2C address in device tree documents Added 'compatible' attribute in child drivers Renamed CONFIG_SKY81452 to CONFIG_MFD_SKY81452 Changed the dependency from I2C=y to I2C, for CONFIG_MFD_SKY81452 Added message for exception or errors. Added vendor prefix for Skyworks Solutions, Inc. Add SKY81452 to the Trivial Devices list Gyungoh Yoo (6): mfd: Add support for Skyworks SKY81452 driver backlight: Add support Skyworks SKY81452 backlight driver devicetree: mfd: Add new SKY81452 mfd binding devicetree: backlight: Add new SKY81452 backlight binding devicetree: Add vendor prefix for Skyworks Solutions, Inc. devicetree: i2c: Add SKY81452 to the Trivial Devices list .../devicetree/bindings/i2c/trivial-devices.txt| 1 + Documentation/devicetree/bindings/mfd/sky81452.txt | 36 +++ .../devicetree/bindings/vendor-prefixes.txt| 1 + .../video/backlight/sky81452-backlight.txt | 29 ++ drivers/mfd/Kconfig| 12 + drivers/mfd/Makefile | 1 + drivers/mfd/sky81452.c | 108 +++ drivers/video/backlight/Kconfig| 10 + drivers/video/backlight/Makefile | 1 + drivers/video/backlight/sky81452-backlight.c | 334 + include/linux/mfd/sky81452.h | 31 ++ include/linux/platform_data/sky81452-backlight.h | 46 +++ 12 files changed, 610 insertions(+) create mode 100644 Documentation/devicetree/bindings/mfd/sky81452.txt create mode 100644 Documentation/devicetree/bindings/video/backlight/sky81452-backlight.txt create mode 100644 drivers/mfd/sky81452.c create mode 100644 drivers/video/backlight/sky81452-backlight.c create mode 100644 include/linux/mfd/sky81452.h create mode 100644 include/linux/platform_data/sky81452-backlight.h -- 1.9.1 -- To unsubscribe from this list: send the line unsubscribe linux-kernel in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
[PATCH v10 6/6] devicetree: i2c: Add SKY81452 to the Trivial Devices list
From: Gyungoh Yoo jack@skyworksinc.com Signed-off-by: Gyungoh Yoo jack@skyworksinc.com --- Changes v10: Nothing Changes v9: Nothing Changes v8: Nothing Changes v7: Nothing Changes v6: Nothing Changes v5: Nothing Changes v4: Nothing Changes v3: Nothing Changes v2: Add SKY81452 to the Trivial Devices list Documentation/devicetree/bindings/i2c/trivial-devices.txt | 1 + 1 file changed, 1 insertion(+) diff --git a/Documentation/devicetree/bindings/i2c/trivial-devices.txt b/Documentation/devicetree/bindings/i2c/trivial-devices.txt index fbde415..122fa1e 100644 --- a/Documentation/devicetree/bindings/i2c/trivial-devices.txt +++ b/Documentation/devicetree/bindings/i2c/trivial-devices.txt @@ -77,6 +77,7 @@ ramtron,24c64 i2c serial eeprom (24cxx) ricoh,rs5c372a I2C bus SERIAL INTERFACE REAL-TIME CLOCK IC samsung,24ad0xd1 S524AD0XF1 (128K/256K-bit Serial EEPROM for Low Power) sii,s35390a2-wire CMOS real-time clock +skyworks,sky81452 Skyworks SKY81452: Six-Channel White LED Driver with Touch Panel Bias Supply st-micro,24c256i2c serial eeprom (24cxx) stm,m41t00 Serial Access TIMEKEEPER stm,m41t62 Serial real-time clock (RTC) with alarm -- 1.9.1 -- To unsubscribe from this list: send the line unsubscribe linux-kernel in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
Re: [PATCH v10 0/6] Add Skyworks SKY81452 device drivers
On Sun, Jan 18, 2015 at 05:40:37PM +, Lee Jones wrote: > > From: Gyungoh Yoo > > > > This patch set includes regulator and backlight driver for SKY81452. > > Also it includes documents for device tree and module. > > sky81452-regulator was already applied. So this series doesn't > > include it. > > Tell us what you need? What's missing? I need DT's Ack for 3/6 and 4/6. Thanks. > > > v10: > > Removed trivial get_brightness implementations for sky81452-backlight > > > > v9: > > Removed the change to remove MODULE_VERSION() for sky81452-regulator > > > > v8: > > Renamed property names for backlight with vendor prefix > > Modified gpio-enable property to generic property for GPIO > > Made up the example for backlight DT > > Changed the DT parsing of regulator using regulator_node and of_match > > > > v7: > > Modified licensing text to GPLv2 > > Splitted Kconfig renaming from DT patch > > > > v6: > > Added new line character at the end of line of dev_err() > > > > v5: > > Changed DT for regulator : 'lout' node should be defined under 'regulator' > > Removed compatible string from sky81452-regulator driver > > Modified sky81452-regulator to return EINVAL when of_node is NULL > > Move sky81452-backlight.h to include/linux/platform_data > > > > v4: > > Removed MODULE_VERSION() > > Modified license to GPLv2 > > Removed calling to backlight_device_unregister() in sky81452-backlight > > > > v3: > > Cleaned-up DBG messages > > Cleaned-up DT > > Fixed the backlight name from 'sky81452-bl' to 'sky81452-backlight' > > Assigned mfd_cell.of_compatible for binding device node > > Modified error messages > > Modified sky81452-regulator to return ENODATA when of_node is NULL > > > > v2: > > Split the patches for each sub-system > > Added 'reg' attribute for I2C address in device tree documents > > Added 'compatible' attribute in child drivers > > Renamed CONFIG_SKY81452 to CONFIG_MFD_SKY81452 > > Changed the dependency from I2C=y to I2C, for CONFIG_MFD_SKY81452 > > Added message for exception or errors. > > Added vendor prefix for Skyworks Solutions, Inc. > > Add SKY81452 to the Trivial Devices list > > > > Gyungoh Yoo (6): > > mfd: Add support for Skyworks SKY81452 driver > > backlight: Add support Skyworks SKY81452 backlight driver > > devicetree: mfd: Add new SKY81452 mfd binding > > devicetree: backlight: Add new SKY81452 backlight binding > > devicetree: Add vendor prefix for Skyworks Solutions, Inc. > > devicetree: i2c: Add SKY81452 to the Trivial Devices list > > > > .../devicetree/bindings/i2c/trivial-devices.txt| 1 + > > Documentation/devicetree/bindings/mfd/sky81452.txt | 36 +++ > > .../devicetree/bindings/vendor-prefixes.txt| 1 + > > .../video/backlight/sky81452-backlight.txt | 29 ++ > > drivers/mfd/Kconfig| 12 + > > drivers/mfd/Makefile | 1 + > > drivers/mfd/sky81452.c | 108 +++ > > drivers/video/backlight/Kconfig| 10 + > > drivers/video/backlight/Makefile | 1 + > > drivers/video/backlight/sky81452-backlight.c | 334 > > + > > include/linux/mfd/sky81452.h | 31 ++ > > include/linux/platform_data/sky81452-backlight.h | 46 +++ > > 12 files changed, 610 insertions(+) > > create mode 100644 Documentation/devicetree/bindings/mfd/sky81452.txt > > create mode 100644 > > Documentation/devicetree/bindings/video/backlight/sky81452-backlight.txt > > create mode 100644 drivers/mfd/sky81452.c > > create mode 100644 drivers/video/backlight/sky81452-backlight.c > > create mode 100644 include/linux/mfd/sky81452.h > > create mode 100644 include/linux/platform_data/sky81452-backlight.h > > > > -- > 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 linux-kernel" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
Re: [PATCH v10 0/6] Add Skyworks SKY81452 device drivers
On Sun, Jan 18, 2015 at 05:40:37PM +, Lee Jones wrote: From: Gyungoh Yoo jack@skyworksinc.com This patch set includes regulator and backlight driver for SKY81452. Also it includes documents for device tree and module. sky81452-regulator was already applied. So this series doesn't include it. Tell us what you need? What's missing? I need DT's Ack for 3/6 and 4/6. Thanks. v10: Removed trivial get_brightness implementations for sky81452-backlight v9: Removed the change to remove MODULE_VERSION() for sky81452-regulator v8: Renamed property names for backlight with vendor prefix Modified gpio-enable property to generic property for GPIO Made up the example for backlight DT Changed the DT parsing of regulator using regulator_node and of_match v7: Modified licensing text to GPLv2 Splitted Kconfig renaming from DT patch v6: Added new line character at the end of line of dev_err() v5: Changed DT for regulator : 'lout' node should be defined under 'regulator' Removed compatible string from sky81452-regulator driver Modified sky81452-regulator to return EINVAL when of_node is NULL Move sky81452-backlight.h to include/linux/platform_data v4: Removed MODULE_VERSION() Modified license to GPLv2 Removed calling to backlight_device_unregister() in sky81452-backlight v3: Cleaned-up DBG messages Cleaned-up DT Fixed the backlight name from 'sky81452-bl' to 'sky81452-backlight' Assigned mfd_cell.of_compatible for binding device node Modified error messages Modified sky81452-regulator to return ENODATA when of_node is NULL v2: Split the patches for each sub-system Added 'reg' attribute for I2C address in device tree documents Added 'compatible' attribute in child drivers Renamed CONFIG_SKY81452 to CONFIG_MFD_SKY81452 Changed the dependency from I2C=y to I2C, for CONFIG_MFD_SKY81452 Added message for exception or errors. Added vendor prefix for Skyworks Solutions, Inc. Add SKY81452 to the Trivial Devices list Gyungoh Yoo (6): mfd: Add support for Skyworks SKY81452 driver backlight: Add support Skyworks SKY81452 backlight driver devicetree: mfd: Add new SKY81452 mfd binding devicetree: backlight: Add new SKY81452 backlight binding devicetree: Add vendor prefix for Skyworks Solutions, Inc. devicetree: i2c: Add SKY81452 to the Trivial Devices list .../devicetree/bindings/i2c/trivial-devices.txt| 1 + Documentation/devicetree/bindings/mfd/sky81452.txt | 36 +++ .../devicetree/bindings/vendor-prefixes.txt| 1 + .../video/backlight/sky81452-backlight.txt | 29 ++ drivers/mfd/Kconfig| 12 + drivers/mfd/Makefile | 1 + drivers/mfd/sky81452.c | 108 +++ drivers/video/backlight/Kconfig| 10 + drivers/video/backlight/Makefile | 1 + drivers/video/backlight/sky81452-backlight.c | 334 + include/linux/mfd/sky81452.h | 31 ++ include/linux/platform_data/sky81452-backlight.h | 46 +++ 12 files changed, 610 insertions(+) create mode 100644 Documentation/devicetree/bindings/mfd/sky81452.txt create mode 100644 Documentation/devicetree/bindings/video/backlight/sky81452-backlight.txt create mode 100644 drivers/mfd/sky81452.c create mode 100644 drivers/video/backlight/sky81452-backlight.c create mode 100644 include/linux/mfd/sky81452.h create mode 100644 include/linux/platform_data/sky81452-backlight.h -- 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 linux-kernel in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
Re: [PATCH v10 4/6] devicetree: backlight: Add new SKY81452 backlight binding
DT Ack please. On Wed, Jan 07, 2015 at 11:19:25AM +0900, gyun...@gmail.com wrote: > From: Gyungoh Yoo > > Signed-off-by: Gyungoh Yoo > Acked-by: Bryan Wu > --- > Changes v10: > Nothing > > Changes v9: > Nothing > > Changes v8: > Renamed property names for backlight with vendor prefix > Modified gpio-enable property to generic property for GPIO > Made up the example for backlight DT > > Changes v7: > Nothing > > Changes v6: > Nothing > > Changes v5: > Nothing > > Changes v4: > Nothing > > Changes v3: > Nothing > > Changes v2: > Added reg attribute for I2C slave address > > .../video/backlight/sky81452-backlight.txt | 29 > ++ > 1 file changed, 29 insertions(+) > create mode 100644 > Documentation/devicetree/bindings/video/backlight/sky81452-backlight.txt > > diff --git > a/Documentation/devicetree/bindings/video/backlight/sky81452-backlight.txt > b/Documentation/devicetree/bindings/video/backlight/sky81452-backlight.txt > new file mode 100644 > index 000..8daebf5 > --- /dev/null > +++ b/Documentation/devicetree/bindings/video/backlight/sky81452-backlight.txt > @@ -0,0 +1,29 @@ > +SKY81452-backlight bindings > + > +Required properties: > +- compatible : Must be "skyworks,sky81452-backlight" > + > +Optional properties: > +- name : Name of backlight device. Default is > 'lcd-backlight'. > +- gpios : GPIO to use to EN pin. > + See Documentation/devicetree/bindings/gpio/gpio.txt > +- skyworks,en-channels : Enable mask for current sink channel 1 to 6. > +- skyworks,ignore-pwm: Ignore both PWM input > +- skyworks,dpwm-mode : Enable DPWM dimming mode, otherwise Analog dimming. > +- skyworks,phase-shift : Enable phase shift mode > +- skyworks,ovp-level : Over-voltage protection level. > + Should be between 14 or 28V. > +- skyworks,short-detection-threshold : It should be one of 4, 5, 6 and 7V. > +- skyworks,current-limit : It should be 2300mA or 2750mA. > + > +Example: > + > + backlight { > + compatible = "skyworks,sky81452-backlight"; > + name = "pwm-backlight"; > + skyworks,en-channels = <0x3f>; > + skyworks,ignore-pwm; > + skyworks,phase-shift; > + skyworks,ovp-level = <20>; > + skyworks,current-limit = <2300>; > + }; > -- > 1.9.1 > -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
Re: [PATCH v10 3/6] devicetree: mfd: Add new SKY81452 mfd binding
DT Ack please. On Wed, Jan 07, 2015 at 11:19:24AM +0900, gyun...@gmail.com wrote: > From: Gyungoh Yoo > > Signed-off-by: Gyungoh Yoo > Acked-by: Lee Jones > --- > Changes v10: > Nothing > > Changes v9: > Nothing > > Changes v8: > Made up the example for backlight DT > > Changes v7: > Nothing > > Changes v6: > Nothing > > Changes v5: > Changed DT for regulator : 'lout' node should be defined under 'regulator' > Removed compatible string from sky81452-regulator driver > > Changes v4: > Nothing > > Changes v3: > Nothing > > Changes v2: > Added reg attribute for I2C slave address > > Documentation/devicetree/bindings/mfd/sky81452.txt | 36 > ++ > 1 file changed, 36 insertions(+) > create mode 100644 Documentation/devicetree/bindings/mfd/sky81452.txt > > diff --git a/Documentation/devicetree/bindings/mfd/sky81452.txt > b/Documentation/devicetree/bindings/mfd/sky81452.txt > new file mode 100644 > index 000..ab71473 > --- /dev/null > +++ b/Documentation/devicetree/bindings/mfd/sky81452.txt > @@ -0,0 +1,36 @@ > +SKY81452 bindings > + > +Required properties: > +- compatible : Must be "skyworks,sky81452" > +- reg: I2C slave address > + > +Required child nodes: > +- backlight : container node for backlight following the binding > + in video/backlight/sky81452-backlight.txt > +- regulator : container node for regulators following the binding > + in regulator/sky81452-regulator.txt > + > +Example: > + > + sky81452@2c { > + compatible = "skyworks,sky81452"; > + reg = <0x2c>; > + > + backlight { > + compatible = "skyworks,sky81452-backlight"; > + name = "pwm-backlight"; > + skyworks,en-channels = <0x3f>; > + skyworks,ignore-pwm; > + skyworks,phase-shift; > + skyworks,ovp-level = <20>; > + skyworks,current-limit = <2300>; > + }; > + > + regulator { > + lout { > + regulator-name = "sky81452-lout"; > + regulator-min-microvolt = <450>; > + regulator-max-microvolt = <800>; > + }; > + }; > + }; > -- > 1.9.1 > -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
Re: [PATCH v10 4/6] devicetree: backlight: Add new SKY81452 backlight binding
DT Ack please. On Wed, Jan 07, 2015 at 11:19:25AM +0900, gyun...@gmail.com wrote: From: Gyungoh Yoo jack@skyworksinc.com Signed-off-by: Gyungoh Yoo jack@skyworksinc.com Acked-by: Bryan Wu coolo...@gmail.com --- Changes v10: Nothing Changes v9: Nothing Changes v8: Renamed property names for backlight with vendor prefix Modified gpio-enable property to generic property for GPIO Made up the example for backlight DT Changes v7: Nothing Changes v6: Nothing Changes v5: Nothing Changes v4: Nothing Changes v3: Nothing Changes v2: Added reg attribute for I2C slave address .../video/backlight/sky81452-backlight.txt | 29 ++ 1 file changed, 29 insertions(+) create mode 100644 Documentation/devicetree/bindings/video/backlight/sky81452-backlight.txt diff --git a/Documentation/devicetree/bindings/video/backlight/sky81452-backlight.txt b/Documentation/devicetree/bindings/video/backlight/sky81452-backlight.txt new file mode 100644 index 000..8daebf5 --- /dev/null +++ b/Documentation/devicetree/bindings/video/backlight/sky81452-backlight.txt @@ -0,0 +1,29 @@ +SKY81452-backlight bindings + +Required properties: +- compatible : Must be skyworks,sky81452-backlight + +Optional properties: +- name : Name of backlight device. Default is 'lcd-backlight'. +- gpios : GPIO to use to EN pin. + See Documentation/devicetree/bindings/gpio/gpio.txt +- skyworks,en-channels : Enable mask for current sink channel 1 to 6. +- skyworks,ignore-pwm: Ignore both PWM input +- skyworks,dpwm-mode : Enable DPWM dimming mode, otherwise Analog dimming. +- skyworks,phase-shift : Enable phase shift mode +- skyworks,ovp-level : Over-voltage protection level. + Should be between 14 or 28V. +- skyworks,short-detection-threshold : It should be one of 4, 5, 6 and 7V. +- skyworks,current-limit : It should be 2300mA or 2750mA. + +Example: + + backlight { + compatible = skyworks,sky81452-backlight; + name = pwm-backlight; + skyworks,en-channels = 0x3f; + skyworks,ignore-pwm; + skyworks,phase-shift; + skyworks,ovp-level = 20; + skyworks,current-limit = 2300; + }; -- 1.9.1 -- To unsubscribe from this list: send the line unsubscribe linux-kernel in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
Re: [PATCH v10 3/6] devicetree: mfd: Add new SKY81452 mfd binding
DT Ack please. On Wed, Jan 07, 2015 at 11:19:24AM +0900, gyun...@gmail.com wrote: From: Gyungoh Yoo jack@skyworksinc.com Signed-off-by: Gyungoh Yoo jack@skyworksinc.com Acked-by: Lee Jones lee.jo...@linaro.org --- Changes v10: Nothing Changes v9: Nothing Changes v8: Made up the example for backlight DT Changes v7: Nothing Changes v6: Nothing Changes v5: Changed DT for regulator : 'lout' node should be defined under 'regulator' Removed compatible string from sky81452-regulator driver Changes v4: Nothing Changes v3: Nothing Changes v2: Added reg attribute for I2C slave address Documentation/devicetree/bindings/mfd/sky81452.txt | 36 ++ 1 file changed, 36 insertions(+) create mode 100644 Documentation/devicetree/bindings/mfd/sky81452.txt diff --git a/Documentation/devicetree/bindings/mfd/sky81452.txt b/Documentation/devicetree/bindings/mfd/sky81452.txt new file mode 100644 index 000..ab71473 --- /dev/null +++ b/Documentation/devicetree/bindings/mfd/sky81452.txt @@ -0,0 +1,36 @@ +SKY81452 bindings + +Required properties: +- compatible : Must be skyworks,sky81452 +- reg: I2C slave address + +Required child nodes: +- backlight : container node for backlight following the binding + in video/backlight/sky81452-backlight.txt +- regulator : container node for regulators following the binding + in regulator/sky81452-regulator.txt + +Example: + + sky81452@2c { + compatible = skyworks,sky81452; + reg = 0x2c; + + backlight { + compatible = skyworks,sky81452-backlight; + name = pwm-backlight; + skyworks,en-channels = 0x3f; + skyworks,ignore-pwm; + skyworks,phase-shift; + skyworks,ovp-level = 20; + skyworks,current-limit = 2300; + }; + + regulator { + lout { + regulator-name = sky81452-lout; + regulator-min-microvolt = 450; + regulator-max-microvolt = 800; + }; + }; + }; -- 1.9.1 -- To unsubscribe from this list: send the line unsubscribe linux-kernel in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
[PATCH v10 6/6] devicetree: i2c: Add SKY81452 to the Trivial Devices list
From: Gyungoh Yoo Signed-off-by: Gyungoh Yoo --- Changes v10: Nothing Changes v9: Nothing Changes v8: Nothing Changes v7: Nothing Changes v6: Nothing Changes v5: Nothing Changes v4: Nothing Changes v3: Nothing Changes v2: Add SKY81452 to the Trivial Devices list Documentation/devicetree/bindings/i2c/trivial-devices.txt | 1 + 1 file changed, 1 insertion(+) diff --git a/Documentation/devicetree/bindings/i2c/trivial-devices.txt b/Documentation/devicetree/bindings/i2c/trivial-devices.txt index fbde415..122fa1e 100644 --- a/Documentation/devicetree/bindings/i2c/trivial-devices.txt +++ b/Documentation/devicetree/bindings/i2c/trivial-devices.txt @@ -77,6 +77,7 @@ ramtron,24c64 i2c serial eeprom (24cxx) ricoh,rs5c372a I2C bus SERIAL INTERFACE REAL-TIME CLOCK IC samsung,24ad0xd1 S524AD0XF1 (128K/256K-bit Serial EEPROM for Low Power) sii,s35390a2-wire CMOS real-time clock +skyworks,sky81452 Skyworks SKY81452: Six-Channel White LED Driver with Touch Panel Bias Supply st-micro,24c256i2c serial eeprom (24cxx) stm,m41t00 Serial Access TIMEKEEPER stm,m41t62 Serial real-time clock (RTC) with alarm -- 1.9.1 -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
[PATCH v10 2/6] backlight: Add support Skyworks SKY81452 backlight driver
From: Gyungoh Yoo Signed-off-by: Gyungoh Yoo Acked-by: Jingoo Han Acked-by: Bryan Wu --- Changes v10: Removed trivial get_brightness implementations Changes v9: Nothing Changes v8: Renamed property names for backlight with vendor prefix Modified gpio-enable property to generic property for GPIO Changes v7: Modified licensing text to GPLv2 Changes v6: Added new line character at the end of line of dev_err() Changes v5: Move sky81452-backlight.h to include/linux/platform_data Changes v4: Reordering header files for readability Removed calling to backlight_device_unregister() Removed MODULE_VERSION() Modified license to GPLv2 Changes v3: Modified DBG messages Changes v2: Added 'compatible' attribute in the driver Added message for exception or errors drivers/video/backlight/Kconfig | 10 + drivers/video/backlight/Makefile | 1 + drivers/video/backlight/sky81452-backlight.c | 334 +++ include/linux/platform_data/sky81452-backlight.h | 46 4 files changed, 391 insertions(+) create mode 100644 drivers/video/backlight/sky81452-backlight.c create mode 100644 include/linux/platform_data/sky81452-backlight.h diff --git a/drivers/video/backlight/Kconfig b/drivers/video/backlight/Kconfig index 8d03924..2586fdd 100644 --- a/drivers/video/backlight/Kconfig +++ b/drivers/video/backlight/Kconfig @@ -409,6 +409,16 @@ config BACKLIGHT_PANDORA If you have a Pandora console, say Y to enable the backlight driver. +config BACKLIGHT_SKY81452 + tristate "Backlight driver for SKY81452" + depends on BACKLIGHT_CLASS_DEVICE && MFD_SKY81452 + help + If you have a Skyworks SKY81452, say Y to enable the + backlight driver. + + To compile this driver as a module, choose M here: the module will + be called sky81452-backlight + config BACKLIGHT_TPS65217 tristate "TPS65217 Backlight" depends on BACKLIGHT_CLASS_DEVICE && MFD_TPS65217 diff --git a/drivers/video/backlight/Makefile b/drivers/video/backlight/Makefile index fcd50b73..d67073f 100644 --- a/drivers/video/backlight/Makefile +++ b/drivers/video/backlight/Makefile @@ -50,6 +50,7 @@ obj-$(CONFIG_BACKLIGHT_PANDORA) += pandora_bl.o obj-$(CONFIG_BACKLIGHT_PCF50633) += pcf50633-backlight.o obj-$(CONFIG_BACKLIGHT_PWM)+= pwm_bl.o obj-$(CONFIG_BACKLIGHT_SAHARA) += kb3886_bl.o +obj-$(CONFIG_BACKLIGHT_SKY81452) += sky81452-backlight.o obj-$(CONFIG_BACKLIGHT_TOSA) += tosa_bl.o obj-$(CONFIG_BACKLIGHT_TPS65217) += tps65217_bl.o obj-$(CONFIG_BACKLIGHT_WM831X) += wm831x_bl.o diff --git a/drivers/video/backlight/sky81452-backlight.c b/drivers/video/backlight/sky81452-backlight.c new file mode 100644 index 000..8105597 --- /dev/null +++ b/drivers/video/backlight/sky81452-backlight.c @@ -0,0 +1,334 @@ +/* + * sky81452-backlight.cSKY81452 backlight driver + * + * Copyright 2014 Skyworks Solutions Inc. + * Author : Gyungoh Yoo + * + * 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. + * + * This program is distributed in the hope that it will be useful, but + * WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, see <http://www.gnu.org/licenses/>. + */ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +/* registers */ +#define SKY81452_REG0 0x00 +#define SKY81452_REG1 0x01 +#define SKY81452_REG2 0x02 +#define SKY81452_REG4 0x04 +#define SKY81452_REG5 0x05 + +/* bit mask */ +#define SKY81452_CS0xFF +#define SKY81452_EN0x3F +#define SKY81452_IGPW 0x20 +#define SKY81452_PWMMD 0x10 +#define SKY81452_PHASE 0x08 +#define SKY81452_ILIM 0x04 +#define SKY81452_VSHRT 0x03 +#define SKY81452_OCP 0x80 +#define SKY81452_OTMP 0x40 +#define SKY81452_SHRT 0x3F +#define SKY81452_OPN 0x3F + +#define SKY81452_DEFAULT_NAME "lcd-backlight" +#define SKY81452_MAX_BRIGHTNESS(SKY81452_CS + 1) + +#define CTZ(b) __builtin_ctz(b) + +static int sky81452_bl_update_status(struct backlight_device *bd) +{ + const struct sky81452_bl_platform_data *pdata = + dev_get_platdata(bd->dev.parent); + const unsigned int brightness = (unsigned int)bd->props.brightness; + struct regmap *regmap = bl_get_data(bd); + int ret; + + if (brightness > 0) { + ret = regmap_write(regmap, SKY81452_REG0, brightness - 1); + if (IS_ERR_VALUE(ret)) + return ret; + +
[PATCH v10 5/6] devicetree: Add vendor prefix for Skyworks Solutions, Inc.
From: Gyungoh Yoo Signed-off-by: Gyungoh Yoo Acked-by: Lee Jones --- Changes v10: Nothing Changes v9: Nothing Changes v8: Nothing Changes v7: Nothing Changes v6: Nothing Changes v5: Nothing Changes v4: Nothing Changes v3: Nothing Changes v2: Added vendor prefix for Skyworks Solutions, Inc. Documentation/devicetree/bindings/vendor-prefixes.txt | 1 + 1 file changed, 1 insertion(+) diff --git a/Documentation/devicetree/bindings/vendor-prefixes.txt b/Documentation/devicetree/bindings/vendor-prefixes.txt index a344ec2..68143f0 100644 --- a/Documentation/devicetree/bindings/vendor-prefixes.txt +++ b/Documentation/devicetree/bindings/vendor-prefixes.txt @@ -140,6 +140,7 @@ sii Seiko Instruments, Inc. silergySilergy Corp. sirf SiRF Technology, Inc. sitronix Sitronix Technology Corporation +skyworks Skyworks Solutions, Inc. smsc Standard Microsystems Corporation snps Synopsys, Inc. solidrun SolidRun -- 1.9.1 -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
[PATCH v10 4/6] devicetree: backlight: Add new SKY81452 backlight binding
From: Gyungoh Yoo Signed-off-by: Gyungoh Yoo Acked-by: Bryan Wu --- Changes v10: Nothing Changes v9: Nothing Changes v8: Renamed property names for backlight with vendor prefix Modified gpio-enable property to generic property for GPIO Made up the example for backlight DT Changes v7: Nothing Changes v6: Nothing Changes v5: Nothing Changes v4: Nothing Changes v3: Nothing Changes v2: Added reg attribute for I2C slave address .../video/backlight/sky81452-backlight.txt | 29 ++ 1 file changed, 29 insertions(+) create mode 100644 Documentation/devicetree/bindings/video/backlight/sky81452-backlight.txt diff --git a/Documentation/devicetree/bindings/video/backlight/sky81452-backlight.txt b/Documentation/devicetree/bindings/video/backlight/sky81452-backlight.txt new file mode 100644 index 000..8daebf5 --- /dev/null +++ b/Documentation/devicetree/bindings/video/backlight/sky81452-backlight.txt @@ -0,0 +1,29 @@ +SKY81452-backlight bindings + +Required properties: +- compatible : Must be "skyworks,sky81452-backlight" + +Optional properties: +- name : Name of backlight device. Default is 'lcd-backlight'. +- gpios: GPIO to use to EN pin. + See Documentation/devicetree/bindings/gpio/gpio.txt +- skyworks,en-channels : Enable mask for current sink channel 1 to 6. +- skyworks,ignore-pwm : Ignore both PWM input +- skyworks,dpwm-mode : Enable DPWM dimming mode, otherwise Analog dimming. +- skyworks,phase-shift : Enable phase shift mode +- skyworks,ovp-level : Over-voltage protection level. + Should be between 14 or 28V. +- skyworks,short-detection-threshold : It should be one of 4, 5, 6 and 7V. +- skyworks,current-limit : It should be 2300mA or 2750mA. + +Example: + + backlight { + compatible = "skyworks,sky81452-backlight"; + name = "pwm-backlight"; + skyworks,en-channels = <0x3f>; + skyworks,ignore-pwm; + skyworks,phase-shift; + skyworks,ovp-level = <20>; + skyworks,current-limit = <2300>; + }; -- 1.9.1 -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
[PATCH v10 3/6] devicetree: mfd: Add new SKY81452 mfd binding
From: Gyungoh Yoo Signed-off-by: Gyungoh Yoo Acked-by: Lee Jones --- Changes v10: Nothing Changes v9: Nothing Changes v8: Made up the example for backlight DT Changes v7: Nothing Changes v6: Nothing Changes v5: Changed DT for regulator : 'lout' node should be defined under 'regulator' Removed compatible string from sky81452-regulator driver Changes v4: Nothing Changes v3: Nothing Changes v2: Added reg attribute for I2C slave address Documentation/devicetree/bindings/mfd/sky81452.txt | 36 ++ 1 file changed, 36 insertions(+) create mode 100644 Documentation/devicetree/bindings/mfd/sky81452.txt diff --git a/Documentation/devicetree/bindings/mfd/sky81452.txt b/Documentation/devicetree/bindings/mfd/sky81452.txt new file mode 100644 index 000..ab71473 --- /dev/null +++ b/Documentation/devicetree/bindings/mfd/sky81452.txt @@ -0,0 +1,36 @@ +SKY81452 bindings + +Required properties: +- compatible : Must be "skyworks,sky81452" +- reg : I2C slave address + +Required child nodes: +- backlight: container node for backlight following the binding + in video/backlight/sky81452-backlight.txt +- regulator: container node for regulators following the binding + in regulator/sky81452-regulator.txt + +Example: + + sky81452@2c { + compatible = "skyworks,sky81452"; + reg = <0x2c>; + + backlight { + compatible = "skyworks,sky81452-backlight"; + name = "pwm-backlight"; + skyworks,en-channels = <0x3f>; + skyworks,ignore-pwm; + skyworks,phase-shift; + skyworks,ovp-level = <20>; + skyworks,current-limit = <2300>; + }; + + regulator { + lout { + regulator-name = "sky81452-lout"; + regulator-min-microvolt = <450>; + regulator-max-microvolt = <800>; + }; + }; + }; -- 1.9.1 -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
[PATCH v10 1/6] mfd: Add support for Skyworks SKY81452 driver
From: Gyungoh Yoo Signed-off-by: Gyungoh Yoo Acked-by: Lee Jones --- Changes v10: Nothing Changes v9: Nothing Changes v8: Nothing Changes v7: Modified licensing text to GPLv2 Changes v6: Added new line character at the end of line of dev_err() Changes v5: Move sky81452-backlight.h to include/linux/platform_data Changes v4: Removed MODULE_VERSION() Modified license to GPLv2 Changes v3: Fixed the backlight name from 'sky81452-bl' to 'sky81452-backlight' Assigned mfd_cell.of_compatible for binding device node Modified error messages Changes v2: Renamed CONFIG_SKY81452 to CONFIG_MFD_SKY81452 Changed the dependency from I2C=y to I2C, for CONFIG_MFD_SKY81452 Added message for exception or errors drivers/mfd/Kconfig | 12 + drivers/mfd/Makefile | 1 + drivers/mfd/sky81452.c | 108 +++ include/linux/mfd/sky81452.h | 31 + 4 files changed, 152 insertions(+) create mode 100644 drivers/mfd/sky81452.c create mode 100644 include/linux/mfd/sky81452.h diff --git a/drivers/mfd/Kconfig b/drivers/mfd/Kconfig index 1456ea7..a54244c 100644 --- a/drivers/mfd/Kconfig +++ b/drivers/mfd/Kconfig @@ -693,6 +693,18 @@ config MFD_SM501_GPIO lines on the SM501. The platform data is used to supply the base number for the first GPIO line to register. +config MFD_SKY81452 + tristate "Skyworks Solutions SKY81452" + select MFD_CORE + select REGMAP_I2C + depends on I2C + help + This is the core driver for the Skyworks SKY81452 backlight and + voltage regulator device. + + This driver can also be built as a module. If so, the module + will be called sky81452. + config MFD_SMSC bool "SMSC ECE1099 series chips" depends on I2C=y diff --git a/drivers/mfd/Makefile b/drivers/mfd/Makefile index 8bd54b1..d9683ea 100644 --- a/drivers/mfd/Makefile +++ b/drivers/mfd/Makefile @@ -174,6 +174,7 @@ obj-$(CONFIG_MFD_STW481X) += stw481x.o obj-$(CONFIG_MFD_IPAQ_MICRO) += ipaq-micro.o obj-$(CONFIG_MFD_MENF21BMC)+= menf21bmc.o obj-$(CONFIG_MFD_HI6421_PMIC) += hi6421-pmic-core.o +obj-$(CONFIG_MFD_SKY81452) += sky81452.o intel-soc-pmic-objs:= intel_soc_pmic_core.o intel_soc_pmic_crc.o obj-$(CONFIG_INTEL_SOC_PMIC) += intel-soc-pmic.o diff --git a/drivers/mfd/sky81452.c b/drivers/mfd/sky81452.c new file mode 100644 index 000..b0c9b04 --- /dev/null +++ b/drivers/mfd/sky81452.c @@ -0,0 +1,108 @@ +/* + * sky81452.c SKY81452 MFD driver + * + * Copyright 2014 Skyworks Solutions Inc. + * Author : Gyungoh Yoo + * + * 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. + * + * This program is distributed in the hope that it will be useful, but + * WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, see <http://www.gnu.org/licenses/>. + */ + +#include +#include +#include +#include +#include +#include +#include +#include +#include + +static const struct regmap_config sky81452_config = { + .reg_bits = 8, + .val_bits = 8, +}; + +static int sky81452_probe(struct i2c_client *client, + const struct i2c_device_id *id) +{ + struct device *dev = >dev; + const struct sky81452_platform_data *pdata = dev_get_platdata(dev); + struct mfd_cell cells[2]; + struct regmap *regmap; + int ret; + + if (!pdata) { + pdata = devm_kzalloc(dev, sizeof(*pdata), GFP_KERNEL); + if (!pdata) + return -ENOMEM; + } + + regmap = devm_regmap_init_i2c(client, _config); + if (IS_ERR(regmap)) { + dev_err(dev, "failed to initialize.err=%ld\n", PTR_ERR(regmap)); + return PTR_ERR(regmap); + } + + i2c_set_clientdata(client, regmap); + + memset(cells, 0, sizeof(cells)); + cells[0].name = "sky81452-backlight"; + cells[0].of_compatible = "skyworks,sky81452-backlight"; + cells[0].platform_data = pdata->bl_pdata; + cells[0].pdata_size = sizeof(*pdata->bl_pdata); + cells[1].name = "sky81452-regulator"; + cells[1].platform_data = pdata->regulator_init_data; + cells[1].pdata_size = sizeof(*pdata->regulator_init_data); + + ret = mfd_add_devices(dev, -1, cells, ARRAY_SIZE(cells), NULL, 0, NULL); + if (ret) + dev_err(dev, "failed to add child devices. err=%d\n", ret); + + return ret; +} + +static int sky81452_remove(struct i2c_client *client) +{ + mfd_r
[PATCH v10 0/6] Add Skyworks SKY81452 device drivers
From: Gyungoh Yoo This patch set includes regulator and backlight driver for SKY81452. Also it includes documents for device tree and module. sky81452-regulator was already applied. So this series doesn't include it. v10: Removed trivial get_brightness implementations for sky81452-backlight v9: Removed the change to remove MODULE_VERSION() for sky81452-regulator v8: Renamed property names for backlight with vendor prefix Modified gpio-enable property to generic property for GPIO Made up the example for backlight DT Changed the DT parsing of regulator using regulator_node and of_match v7: Modified licensing text to GPLv2 Splitted Kconfig renaming from DT patch v6: Added new line character at the end of line of dev_err() v5: Changed DT for regulator : 'lout' node should be defined under 'regulator' Removed compatible string from sky81452-regulator driver Modified sky81452-regulator to return EINVAL when of_node is NULL Move sky81452-backlight.h to include/linux/platform_data v4: Removed MODULE_VERSION() Modified license to GPLv2 Removed calling to backlight_device_unregister() in sky81452-backlight v3: Cleaned-up DBG messages Cleaned-up DT Fixed the backlight name from 'sky81452-bl' to 'sky81452-backlight' Assigned mfd_cell.of_compatible for binding device node Modified error messages Modified sky81452-regulator to return ENODATA when of_node is NULL v2: Split the patches for each sub-system Added 'reg' attribute for I2C address in device tree documents Added 'compatible' attribute in child drivers Renamed CONFIG_SKY81452 to CONFIG_MFD_SKY81452 Changed the dependency from I2C=y to I2C, for CONFIG_MFD_SKY81452 Added message for exception or errors. Added vendor prefix for Skyworks Solutions, Inc. Add SKY81452 to the Trivial Devices list Gyungoh Yoo (6): mfd: Add support for Skyworks SKY81452 driver backlight: Add support Skyworks SKY81452 backlight driver devicetree: mfd: Add new SKY81452 mfd binding devicetree: backlight: Add new SKY81452 backlight binding devicetree: Add vendor prefix for Skyworks Solutions, Inc. devicetree: i2c: Add SKY81452 to the Trivial Devices list .../devicetree/bindings/i2c/trivial-devices.txt| 1 + Documentation/devicetree/bindings/mfd/sky81452.txt | 36 +++ .../devicetree/bindings/vendor-prefixes.txt| 1 + .../video/backlight/sky81452-backlight.txt | 29 ++ drivers/mfd/Kconfig| 12 + drivers/mfd/Makefile | 1 + drivers/mfd/sky81452.c | 108 +++ drivers/video/backlight/Kconfig| 10 + drivers/video/backlight/Makefile | 1 + drivers/video/backlight/sky81452-backlight.c | 334 + include/linux/mfd/sky81452.h | 31 ++ include/linux/platform_data/sky81452-backlight.h | 46 +++ 12 files changed, 610 insertions(+) create mode 100644 Documentation/devicetree/bindings/mfd/sky81452.txt create mode 100644 Documentation/devicetree/bindings/video/backlight/sky81452-backlight.txt create mode 100644 drivers/mfd/sky81452.c create mode 100644 drivers/video/backlight/sky81452-backlight.c create mode 100644 include/linux/mfd/sky81452.h create mode 100644 include/linux/platform_data/sky81452-backlight.h -- 1.9.1 -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
[PATCH v10 6/6] devicetree: i2c: Add SKY81452 to the Trivial Devices list
From: Gyungoh Yoo jack@skyworksinc.com Signed-off-by: Gyungoh Yoo jack@skyworksinc.com --- Changes v10: Nothing Changes v9: Nothing Changes v8: Nothing Changes v7: Nothing Changes v6: Nothing Changes v5: Nothing Changes v4: Nothing Changes v3: Nothing Changes v2: Add SKY81452 to the Trivial Devices list Documentation/devicetree/bindings/i2c/trivial-devices.txt | 1 + 1 file changed, 1 insertion(+) diff --git a/Documentation/devicetree/bindings/i2c/trivial-devices.txt b/Documentation/devicetree/bindings/i2c/trivial-devices.txt index fbde415..122fa1e 100644 --- a/Documentation/devicetree/bindings/i2c/trivial-devices.txt +++ b/Documentation/devicetree/bindings/i2c/trivial-devices.txt @@ -77,6 +77,7 @@ ramtron,24c64 i2c serial eeprom (24cxx) ricoh,rs5c372a I2C bus SERIAL INTERFACE REAL-TIME CLOCK IC samsung,24ad0xd1 S524AD0XF1 (128K/256K-bit Serial EEPROM for Low Power) sii,s35390a2-wire CMOS real-time clock +skyworks,sky81452 Skyworks SKY81452: Six-Channel White LED Driver with Touch Panel Bias Supply st-micro,24c256i2c serial eeprom (24cxx) stm,m41t00 Serial Access TIMEKEEPER stm,m41t62 Serial real-time clock (RTC) with alarm -- 1.9.1 -- To unsubscribe from this list: send the line unsubscribe linux-kernel in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
[PATCH v10 2/6] backlight: Add support Skyworks SKY81452 backlight driver
From: Gyungoh Yoo jack@skyworksinc.com Signed-off-by: Gyungoh Yoo jack@skyworksinc.com Acked-by: Jingoo Han jg1@samsung.com Acked-by: Bryan Wu coolo...@gmail.com --- Changes v10: Removed trivial get_brightness implementations Changes v9: Nothing Changes v8: Renamed property names for backlight with vendor prefix Modified gpio-enable property to generic property for GPIO Changes v7: Modified licensing text to GPLv2 Changes v6: Added new line character at the end of line of dev_err() Changes v5: Move sky81452-backlight.h to include/linux/platform_data Changes v4: Reordering header files for readability Removed calling to backlight_device_unregister() Removed MODULE_VERSION() Modified license to GPLv2 Changes v3: Modified DBG messages Changes v2: Added 'compatible' attribute in the driver Added message for exception or errors drivers/video/backlight/Kconfig | 10 + drivers/video/backlight/Makefile | 1 + drivers/video/backlight/sky81452-backlight.c | 334 +++ include/linux/platform_data/sky81452-backlight.h | 46 4 files changed, 391 insertions(+) create mode 100644 drivers/video/backlight/sky81452-backlight.c create mode 100644 include/linux/platform_data/sky81452-backlight.h diff --git a/drivers/video/backlight/Kconfig b/drivers/video/backlight/Kconfig index 8d03924..2586fdd 100644 --- a/drivers/video/backlight/Kconfig +++ b/drivers/video/backlight/Kconfig @@ -409,6 +409,16 @@ config BACKLIGHT_PANDORA If you have a Pandora console, say Y to enable the backlight driver. +config BACKLIGHT_SKY81452 + tristate Backlight driver for SKY81452 + depends on BACKLIGHT_CLASS_DEVICE MFD_SKY81452 + help + If you have a Skyworks SKY81452, say Y to enable the + backlight driver. + + To compile this driver as a module, choose M here: the module will + be called sky81452-backlight + config BACKLIGHT_TPS65217 tristate TPS65217 Backlight depends on BACKLIGHT_CLASS_DEVICE MFD_TPS65217 diff --git a/drivers/video/backlight/Makefile b/drivers/video/backlight/Makefile index fcd50b73..d67073f 100644 --- a/drivers/video/backlight/Makefile +++ b/drivers/video/backlight/Makefile @@ -50,6 +50,7 @@ obj-$(CONFIG_BACKLIGHT_PANDORA) += pandora_bl.o obj-$(CONFIG_BACKLIGHT_PCF50633) += pcf50633-backlight.o obj-$(CONFIG_BACKLIGHT_PWM)+= pwm_bl.o obj-$(CONFIG_BACKLIGHT_SAHARA) += kb3886_bl.o +obj-$(CONFIG_BACKLIGHT_SKY81452) += sky81452-backlight.o obj-$(CONFIG_BACKLIGHT_TOSA) += tosa_bl.o obj-$(CONFIG_BACKLIGHT_TPS65217) += tps65217_bl.o obj-$(CONFIG_BACKLIGHT_WM831X) += wm831x_bl.o diff --git a/drivers/video/backlight/sky81452-backlight.c b/drivers/video/backlight/sky81452-backlight.c new file mode 100644 index 000..8105597 --- /dev/null +++ b/drivers/video/backlight/sky81452-backlight.c @@ -0,0 +1,334 @@ +/* + * sky81452-backlight.cSKY81452 backlight driver + * + * Copyright 2014 Skyworks Solutions Inc. + * Author : Gyungoh Yoo jack@skyworksinc.com + * + * 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. + * + * This program is distributed in the hope that it will be useful, but + * WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, see http://www.gnu.org/licenses/. + */ + +#include linux/backlight.h +#include linux/err.h +#include linux/gpio.h +#include linux/init.h +#include linux/kernel.h +#include linux/module.h +#include linux/of.h +#include linux/of_gpio.h +#include linux/platform_device.h +#include linux/regmap.h +#include linux/platform_data/sky81452-backlight.h +#include linux/slab.h + +/* registers */ +#define SKY81452_REG0 0x00 +#define SKY81452_REG1 0x01 +#define SKY81452_REG2 0x02 +#define SKY81452_REG4 0x04 +#define SKY81452_REG5 0x05 + +/* bit mask */ +#define SKY81452_CS0xFF +#define SKY81452_EN0x3F +#define SKY81452_IGPW 0x20 +#define SKY81452_PWMMD 0x10 +#define SKY81452_PHASE 0x08 +#define SKY81452_ILIM 0x04 +#define SKY81452_VSHRT 0x03 +#define SKY81452_OCP 0x80 +#define SKY81452_OTMP 0x40 +#define SKY81452_SHRT 0x3F +#define SKY81452_OPN 0x3F + +#define SKY81452_DEFAULT_NAME lcd-backlight +#define SKY81452_MAX_BRIGHTNESS(SKY81452_CS + 1) + +#define CTZ(b) __builtin_ctz(b) + +static int sky81452_bl_update_status(struct backlight_device *bd) +{ + const struct sky81452_bl_platform_data *pdata = + dev_get_platdata(bd-dev.parent); + const unsigned int brightness = (unsigned int)bd-props.brightness; + struct regmap *regmap
[PATCH v10 5/6] devicetree: Add vendor prefix for Skyworks Solutions, Inc.
From: Gyungoh Yoo jack@skyworksinc.com Signed-off-by: Gyungoh Yoo jack@skyworksinc.com Acked-by: Lee Jones lee.jo...@linaro.org --- Changes v10: Nothing Changes v9: Nothing Changes v8: Nothing Changes v7: Nothing Changes v6: Nothing Changes v5: Nothing Changes v4: Nothing Changes v3: Nothing Changes v2: Added vendor prefix for Skyworks Solutions, Inc. Documentation/devicetree/bindings/vendor-prefixes.txt | 1 + 1 file changed, 1 insertion(+) diff --git a/Documentation/devicetree/bindings/vendor-prefixes.txt b/Documentation/devicetree/bindings/vendor-prefixes.txt index a344ec2..68143f0 100644 --- a/Documentation/devicetree/bindings/vendor-prefixes.txt +++ b/Documentation/devicetree/bindings/vendor-prefixes.txt @@ -140,6 +140,7 @@ sii Seiko Instruments, Inc. silergySilergy Corp. sirf SiRF Technology, Inc. sitronix Sitronix Technology Corporation +skyworks Skyworks Solutions, Inc. smsc Standard Microsystems Corporation snps Synopsys, Inc. solidrun SolidRun -- 1.9.1 -- To unsubscribe from this list: send the line unsubscribe linux-kernel in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
[PATCH v10 1/6] mfd: Add support for Skyworks SKY81452 driver
From: Gyungoh Yoo jack@skyworksinc.com Signed-off-by: Gyungoh Yoo jack@skyworksinc.com Acked-by: Lee Jones lee.jo...@linaro.org --- Changes v10: Nothing Changes v9: Nothing Changes v8: Nothing Changes v7: Modified licensing text to GPLv2 Changes v6: Added new line character at the end of line of dev_err() Changes v5: Move sky81452-backlight.h to include/linux/platform_data Changes v4: Removed MODULE_VERSION() Modified license to GPLv2 Changes v3: Fixed the backlight name from 'sky81452-bl' to 'sky81452-backlight' Assigned mfd_cell.of_compatible for binding device node Modified error messages Changes v2: Renamed CONFIG_SKY81452 to CONFIG_MFD_SKY81452 Changed the dependency from I2C=y to I2C, for CONFIG_MFD_SKY81452 Added message for exception or errors drivers/mfd/Kconfig | 12 + drivers/mfd/Makefile | 1 + drivers/mfd/sky81452.c | 108 +++ include/linux/mfd/sky81452.h | 31 + 4 files changed, 152 insertions(+) create mode 100644 drivers/mfd/sky81452.c create mode 100644 include/linux/mfd/sky81452.h diff --git a/drivers/mfd/Kconfig b/drivers/mfd/Kconfig index 1456ea7..a54244c 100644 --- a/drivers/mfd/Kconfig +++ b/drivers/mfd/Kconfig @@ -693,6 +693,18 @@ config MFD_SM501_GPIO lines on the SM501. The platform data is used to supply the base number for the first GPIO line to register. +config MFD_SKY81452 + tristate Skyworks Solutions SKY81452 + select MFD_CORE + select REGMAP_I2C + depends on I2C + help + This is the core driver for the Skyworks SKY81452 backlight and + voltage regulator device. + + This driver can also be built as a module. If so, the module + will be called sky81452. + config MFD_SMSC bool SMSC ECE1099 series chips depends on I2C=y diff --git a/drivers/mfd/Makefile b/drivers/mfd/Makefile index 8bd54b1..d9683ea 100644 --- a/drivers/mfd/Makefile +++ b/drivers/mfd/Makefile @@ -174,6 +174,7 @@ obj-$(CONFIG_MFD_STW481X) += stw481x.o obj-$(CONFIG_MFD_IPAQ_MICRO) += ipaq-micro.o obj-$(CONFIG_MFD_MENF21BMC)+= menf21bmc.o obj-$(CONFIG_MFD_HI6421_PMIC) += hi6421-pmic-core.o +obj-$(CONFIG_MFD_SKY81452) += sky81452.o intel-soc-pmic-objs:= intel_soc_pmic_core.o intel_soc_pmic_crc.o obj-$(CONFIG_INTEL_SOC_PMIC) += intel-soc-pmic.o diff --git a/drivers/mfd/sky81452.c b/drivers/mfd/sky81452.c new file mode 100644 index 000..b0c9b04 --- /dev/null +++ b/drivers/mfd/sky81452.c @@ -0,0 +1,108 @@ +/* + * sky81452.c SKY81452 MFD driver + * + * Copyright 2014 Skyworks Solutions Inc. + * Author : Gyungoh Yoo jack@skyworksinc.com + * + * 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. + * + * This program is distributed in the hope that it will be useful, but + * WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, see http://www.gnu.org/licenses/. + */ + +#include linux/kernel.h +#include linux/module.h +#include linux/init.h +#include linux/err.h +#include linux/slab.h +#include linux/i2c.h +#include linux/regmap.h +#include linux/mfd/core.h +#include linux/mfd/sky81452.h + +static const struct regmap_config sky81452_config = { + .reg_bits = 8, + .val_bits = 8, +}; + +static int sky81452_probe(struct i2c_client *client, + const struct i2c_device_id *id) +{ + struct device *dev = client-dev; + const struct sky81452_platform_data *pdata = dev_get_platdata(dev); + struct mfd_cell cells[2]; + struct regmap *regmap; + int ret; + + if (!pdata) { + pdata = devm_kzalloc(dev, sizeof(*pdata), GFP_KERNEL); + if (!pdata) + return -ENOMEM; + } + + regmap = devm_regmap_init_i2c(client, sky81452_config); + if (IS_ERR(regmap)) { + dev_err(dev, failed to initialize.err=%ld\n, PTR_ERR(regmap)); + return PTR_ERR(regmap); + } + + i2c_set_clientdata(client, regmap); + + memset(cells, 0, sizeof(cells)); + cells[0].name = sky81452-backlight; + cells[0].of_compatible = skyworks,sky81452-backlight; + cells[0].platform_data = pdata-bl_pdata; + cells[0].pdata_size = sizeof(*pdata-bl_pdata); + cells[1].name = sky81452-regulator; + cells[1].platform_data = pdata-regulator_init_data; + cells[1].pdata_size = sizeof(*pdata-regulator_init_data); + + ret = mfd_add_devices(dev, -1, cells, ARRAY_SIZE(cells), NULL, 0, NULL); + if (ret) + dev_err(dev, failed to add child devices
[PATCH v10 0/6] Add Skyworks SKY81452 device drivers
From: Gyungoh Yoo jack@skyworksinc.com This patch set includes regulator and backlight driver for SKY81452. Also it includes documents for device tree and module. sky81452-regulator was already applied. So this series doesn't include it. v10: Removed trivial get_brightness implementations for sky81452-backlight v9: Removed the change to remove MODULE_VERSION() for sky81452-regulator v8: Renamed property names for backlight with vendor prefix Modified gpio-enable property to generic property for GPIO Made up the example for backlight DT Changed the DT parsing of regulator using regulator_node and of_match v7: Modified licensing text to GPLv2 Splitted Kconfig renaming from DT patch v6: Added new line character at the end of line of dev_err() v5: Changed DT for regulator : 'lout' node should be defined under 'regulator' Removed compatible string from sky81452-regulator driver Modified sky81452-regulator to return EINVAL when of_node is NULL Move sky81452-backlight.h to include/linux/platform_data v4: Removed MODULE_VERSION() Modified license to GPLv2 Removed calling to backlight_device_unregister() in sky81452-backlight v3: Cleaned-up DBG messages Cleaned-up DT Fixed the backlight name from 'sky81452-bl' to 'sky81452-backlight' Assigned mfd_cell.of_compatible for binding device node Modified error messages Modified sky81452-regulator to return ENODATA when of_node is NULL v2: Split the patches for each sub-system Added 'reg' attribute for I2C address in device tree documents Added 'compatible' attribute in child drivers Renamed CONFIG_SKY81452 to CONFIG_MFD_SKY81452 Changed the dependency from I2C=y to I2C, for CONFIG_MFD_SKY81452 Added message for exception or errors. Added vendor prefix for Skyworks Solutions, Inc. Add SKY81452 to the Trivial Devices list Gyungoh Yoo (6): mfd: Add support for Skyworks SKY81452 driver backlight: Add support Skyworks SKY81452 backlight driver devicetree: mfd: Add new SKY81452 mfd binding devicetree: backlight: Add new SKY81452 backlight binding devicetree: Add vendor prefix for Skyworks Solutions, Inc. devicetree: i2c: Add SKY81452 to the Trivial Devices list .../devicetree/bindings/i2c/trivial-devices.txt| 1 + Documentation/devicetree/bindings/mfd/sky81452.txt | 36 +++ .../devicetree/bindings/vendor-prefixes.txt| 1 + .../video/backlight/sky81452-backlight.txt | 29 ++ drivers/mfd/Kconfig| 12 + drivers/mfd/Makefile | 1 + drivers/mfd/sky81452.c | 108 +++ drivers/video/backlight/Kconfig| 10 + drivers/video/backlight/Makefile | 1 + drivers/video/backlight/sky81452-backlight.c | 334 + include/linux/mfd/sky81452.h | 31 ++ include/linux/platform_data/sky81452-backlight.h | 46 +++ 12 files changed, 610 insertions(+) create mode 100644 Documentation/devicetree/bindings/mfd/sky81452.txt create mode 100644 Documentation/devicetree/bindings/video/backlight/sky81452-backlight.txt create mode 100644 drivers/mfd/sky81452.c create mode 100644 drivers/video/backlight/sky81452-backlight.c create mode 100644 include/linux/mfd/sky81452.h create mode 100644 include/linux/platform_data/sky81452-backlight.h -- 1.9.1 -- To unsubscribe from this list: send the line unsubscribe linux-kernel in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
[PATCH v10 4/6] devicetree: backlight: Add new SKY81452 backlight binding
From: Gyungoh Yoo jack@skyworksinc.com Signed-off-by: Gyungoh Yoo jack@skyworksinc.com Acked-by: Bryan Wu coolo...@gmail.com --- Changes v10: Nothing Changes v9: Nothing Changes v8: Renamed property names for backlight with vendor prefix Modified gpio-enable property to generic property for GPIO Made up the example for backlight DT Changes v7: Nothing Changes v6: Nothing Changes v5: Nothing Changes v4: Nothing Changes v3: Nothing Changes v2: Added reg attribute for I2C slave address .../video/backlight/sky81452-backlight.txt | 29 ++ 1 file changed, 29 insertions(+) create mode 100644 Documentation/devicetree/bindings/video/backlight/sky81452-backlight.txt diff --git a/Documentation/devicetree/bindings/video/backlight/sky81452-backlight.txt b/Documentation/devicetree/bindings/video/backlight/sky81452-backlight.txt new file mode 100644 index 000..8daebf5 --- /dev/null +++ b/Documentation/devicetree/bindings/video/backlight/sky81452-backlight.txt @@ -0,0 +1,29 @@ +SKY81452-backlight bindings + +Required properties: +- compatible : Must be skyworks,sky81452-backlight + +Optional properties: +- name : Name of backlight device. Default is 'lcd-backlight'. +- gpios: GPIO to use to EN pin. + See Documentation/devicetree/bindings/gpio/gpio.txt +- skyworks,en-channels : Enable mask for current sink channel 1 to 6. +- skyworks,ignore-pwm : Ignore both PWM input +- skyworks,dpwm-mode : Enable DPWM dimming mode, otherwise Analog dimming. +- skyworks,phase-shift : Enable phase shift mode +- skyworks,ovp-level : Over-voltage protection level. + Should be between 14 or 28V. +- skyworks,short-detection-threshold : It should be one of 4, 5, 6 and 7V. +- skyworks,current-limit : It should be 2300mA or 2750mA. + +Example: + + backlight { + compatible = skyworks,sky81452-backlight; + name = pwm-backlight; + skyworks,en-channels = 0x3f; + skyworks,ignore-pwm; + skyworks,phase-shift; + skyworks,ovp-level = 20; + skyworks,current-limit = 2300; + }; -- 1.9.1 -- To unsubscribe from this list: send the line unsubscribe linux-kernel in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
[PATCH v10 3/6] devicetree: mfd: Add new SKY81452 mfd binding
From: Gyungoh Yoo jack@skyworksinc.com Signed-off-by: Gyungoh Yoo jack@skyworksinc.com Acked-by: Lee Jones lee.jo...@linaro.org --- Changes v10: Nothing Changes v9: Nothing Changes v8: Made up the example for backlight DT Changes v7: Nothing Changes v6: Nothing Changes v5: Changed DT for regulator : 'lout' node should be defined under 'regulator' Removed compatible string from sky81452-regulator driver Changes v4: Nothing Changes v3: Nothing Changes v2: Added reg attribute for I2C slave address Documentation/devicetree/bindings/mfd/sky81452.txt | 36 ++ 1 file changed, 36 insertions(+) create mode 100644 Documentation/devicetree/bindings/mfd/sky81452.txt diff --git a/Documentation/devicetree/bindings/mfd/sky81452.txt b/Documentation/devicetree/bindings/mfd/sky81452.txt new file mode 100644 index 000..ab71473 --- /dev/null +++ b/Documentation/devicetree/bindings/mfd/sky81452.txt @@ -0,0 +1,36 @@ +SKY81452 bindings + +Required properties: +- compatible : Must be skyworks,sky81452 +- reg : I2C slave address + +Required child nodes: +- backlight: container node for backlight following the binding + in video/backlight/sky81452-backlight.txt +- regulator: container node for regulators following the binding + in regulator/sky81452-regulator.txt + +Example: + + sky81452@2c { + compatible = skyworks,sky81452; + reg = 0x2c; + + backlight { + compatible = skyworks,sky81452-backlight; + name = pwm-backlight; + skyworks,en-channels = 0x3f; + skyworks,ignore-pwm; + skyworks,phase-shift; + skyworks,ovp-level = 20; + skyworks,current-limit = 2300; + }; + + regulator { + lout { + regulator-name = sky81452-lout; + regulator-min-microvolt = 450; + regulator-max-microvolt = 800; + }; + }; + }; -- 1.9.1 -- To unsubscribe from this list: send the line unsubscribe linux-kernel in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
Re: [PATCH v10 2/6] backlight: Add support Skyworks SKY81452 backlight driver
On Thu, Dec 18, 2014 at 03:09:21PM +0900, Jingoo Han wrote: > On Thursday, December 18, 2014 2:48 PM, Gyungoh Yoo wrote: > > > > From: Gyungoh Yoo > > > > Signed-off-by: Gyungoh Yoo > > Please add the following 'Acked-by's when you send this patch > next time. > > Acked-by: Jingoo Han > Acked-by: Bryan Wu I see. Thank you. > > Best regards, > Jingoo Han > > > --- > > Changes v10: > > Removed trivial get_brightness implementations > > > > Changes v9: > > Nothing > > > > Changes v8: > > Renamed property names for backlight with vendor prefix > > Modified gpio-enable property to generic property for GPIO > > > > Changes v7: > > Modified licensing text to GPLv2 > > > > Changes v6: > > Added new line character at the end of line of dev_err() > > > > Changes v5: > > Move sky81452-backlight.h to include/linux/platform_data > > > > Changes v4: > > Reordering header files for readability > > Removed calling to backlight_device_unregister() > > Removed MODULE_VERSION() > > Modified license to GPLv2 > > > > Changes v3: > > Modified DBG messages > > > > Changes v2: > > Added 'compatible' attribute in the driver > > Added message for exception or errors > > > > drivers/video/backlight/Kconfig | 10 + > > drivers/video/backlight/Makefile | 1 + > > drivers/video/backlight/sky81452-backlight.c | 334 > > +++ > > include/linux/platform_data/sky81452-backlight.h | 46 > > 4 files changed, 391 insertions(+) > > create mode 100644 drivers/video/backlight/sky81452-backlight.c > > create mode 100644 include/linux/platform_data/sky81452-backlight.h > > > > diff --git a/drivers/video/backlight/Kconfig > > b/drivers/video/backlight/Kconfig > > index 8d03924..2586fdd 100644 > > --- a/drivers/video/backlight/Kconfig > > +++ b/drivers/video/backlight/Kconfig > > @@ -409,6 +409,16 @@ config BACKLIGHT_PANDORA > > If you have a Pandora console, say Y to enable the > > backlight driver. > > > > +config BACKLIGHT_SKY81452 > > + tristate "Backlight driver for SKY81452" > > + depends on BACKLIGHT_CLASS_DEVICE && MFD_SKY81452 > > + help > > + If you have a Skyworks SKY81452, say Y to enable the > > + backlight driver. > > + > > + To compile this driver as a module, choose M here: the module will > > + be called sky81452-backlight > > + > > config BACKLIGHT_TPS65217 > > tristate "TPS65217 Backlight" > > depends on BACKLIGHT_CLASS_DEVICE && MFD_TPS65217 > > diff --git a/drivers/video/backlight/Makefile > > b/drivers/video/backlight/Makefile > > index fcd50b73..d67073f 100644 > > --- a/drivers/video/backlight/Makefile > > +++ b/drivers/video/backlight/Makefile > > @@ -50,6 +50,7 @@ obj-$(CONFIG_BACKLIGHT_PANDORA) += pandora_bl.o > > obj-$(CONFIG_BACKLIGHT_PCF50633) += pcf50633-backlight.o > > obj-$(CONFIG_BACKLIGHT_PWM)+= pwm_bl.o > > obj-$(CONFIG_BACKLIGHT_SAHARA) += kb3886_bl.o > > +obj-$(CONFIG_BACKLIGHT_SKY81452) += sky81452-backlight.o > > obj-$(CONFIG_BACKLIGHT_TOSA) += tosa_bl.o > > obj-$(CONFIG_BACKLIGHT_TPS65217) += tps65217_bl.o > > obj-$(CONFIG_BACKLIGHT_WM831X) += wm831x_bl.o > > diff --git a/drivers/video/backlight/sky81452-backlight.c > > b/drivers/video/backlight/sky81452- > > backlight.c > > new file mode 100644 > > index 000..8105597 > > --- /dev/null > > +++ b/drivers/video/backlight/sky81452-backlight.c > > @@ -0,0 +1,334 @@ > > +/* > > + * sky81452-backlight.cSKY81452 backlight driver > > + * > > + * Copyright 2014 Skyworks Solutions Inc. > > + * Author : Gyungoh Yoo > > + * > > + * 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. > > + * > > + * This program is distributed in the hope that it will be useful, but > > + * WITHOUT ANY WARRANTY; without even the implied warranty of > > + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU > > + * General Public License for more details. > > + * > > + * You should have received a copy of the GNU General Public License along > > + * with this program; if not, see <http://www.gnu.org/licenses/>. > &
[PATCH v10 1/6] mfd: Add support for Skyworks SKY81452 driver
From: Gyungoh Yoo Signed-off-by: Gyungoh Yoo Acked-by: Lee Jones --- Changes v10: Nothing Changes v9: Nothing Changes v8: Nothing Changes v7: Modified licensing text to GPLv2 Changes v6: Added new line character at the end of line of dev_err() Changes v5: Move sky81452-backlight.h to include/linux/platform_data Changes v4: Removed MODULE_VERSION() Modified license to GPLv2 Changes v3: Fixed the backlight name from 'sky81452-bl' to 'sky81452-backlight' Assigned mfd_cell.of_compatible for binding device node Modified error messages Changes v2: Renamed CONFIG_SKY81452 to CONFIG_MFD_SKY81452 Changed the dependency from I2C=y to I2C, for CONFIG_MFD_SKY81452 Added message for exception or errors drivers/mfd/Kconfig | 12 + drivers/mfd/Makefile | 1 + drivers/mfd/sky81452.c | 108 +++ include/linux/mfd/sky81452.h | 31 + 4 files changed, 152 insertions(+) create mode 100644 drivers/mfd/sky81452.c create mode 100644 include/linux/mfd/sky81452.h diff --git a/drivers/mfd/Kconfig b/drivers/mfd/Kconfig index 1456ea7..a54244c 100644 --- a/drivers/mfd/Kconfig +++ b/drivers/mfd/Kconfig @@ -693,6 +693,18 @@ config MFD_SM501_GPIO lines on the SM501. The platform data is used to supply the base number for the first GPIO line to register. +config MFD_SKY81452 + tristate "Skyworks Solutions SKY81452" + select MFD_CORE + select REGMAP_I2C + depends on I2C + help + This is the core driver for the Skyworks SKY81452 backlight and + voltage regulator device. + + This driver can also be built as a module. If so, the module + will be called sky81452. + config MFD_SMSC bool "SMSC ECE1099 series chips" depends on I2C=y diff --git a/drivers/mfd/Makefile b/drivers/mfd/Makefile index 8bd54b1..d9683ea 100644 --- a/drivers/mfd/Makefile +++ b/drivers/mfd/Makefile @@ -174,6 +174,7 @@ obj-$(CONFIG_MFD_STW481X) += stw481x.o obj-$(CONFIG_MFD_IPAQ_MICRO) += ipaq-micro.o obj-$(CONFIG_MFD_MENF21BMC)+= menf21bmc.o obj-$(CONFIG_MFD_HI6421_PMIC) += hi6421-pmic-core.o +obj-$(CONFIG_MFD_SKY81452) += sky81452.o intel-soc-pmic-objs:= intel_soc_pmic_core.o intel_soc_pmic_crc.o obj-$(CONFIG_INTEL_SOC_PMIC) += intel-soc-pmic.o diff --git a/drivers/mfd/sky81452.c b/drivers/mfd/sky81452.c new file mode 100644 index 000..b0c9b04 --- /dev/null +++ b/drivers/mfd/sky81452.c @@ -0,0 +1,108 @@ +/* + * sky81452.c SKY81452 MFD driver + * + * Copyright 2014 Skyworks Solutions Inc. + * Author : Gyungoh Yoo + * + * 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. + * + * This program is distributed in the hope that it will be useful, but + * WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, see <http://www.gnu.org/licenses/>. + */ + +#include +#include +#include +#include +#include +#include +#include +#include +#include + +static const struct regmap_config sky81452_config = { + .reg_bits = 8, + .val_bits = 8, +}; + +static int sky81452_probe(struct i2c_client *client, + const struct i2c_device_id *id) +{ + struct device *dev = >dev; + const struct sky81452_platform_data *pdata = dev_get_platdata(dev); + struct mfd_cell cells[2]; + struct regmap *regmap; + int ret; + + if (!pdata) { + pdata = devm_kzalloc(dev, sizeof(*pdata), GFP_KERNEL); + if (!pdata) + return -ENOMEM; + } + + regmap = devm_regmap_init_i2c(client, _config); + if (IS_ERR(regmap)) { + dev_err(dev, "failed to initialize.err=%ld\n", PTR_ERR(regmap)); + return PTR_ERR(regmap); + } + + i2c_set_clientdata(client, regmap); + + memset(cells, 0, sizeof(cells)); + cells[0].name = "sky81452-backlight"; + cells[0].of_compatible = "skyworks,sky81452-backlight"; + cells[0].platform_data = pdata->bl_pdata; + cells[0].pdata_size = sizeof(*pdata->bl_pdata); + cells[1].name = "sky81452-regulator"; + cells[1].platform_data = pdata->regulator_init_data; + cells[1].pdata_size = sizeof(*pdata->regulator_init_data); + + ret = mfd_add_devices(dev, -1, cells, ARRAY_SIZE(cells), NULL, 0, NULL); + if (ret) + dev_err(dev, "failed to add child devices. err=%d\n", ret); + + return ret; +} + +static int sky81452_remove(struct i2c_client *client) +{ + mfd_r
[PATCH v10 4/6] devicetree: backlight: Add new SKY81452 backlight binding
From: Gyungoh Yoo Signed-off-by: Gyungoh Yoo Acked-by: Bryan Wu --- Changes v10: Nothing Changes v9: Nothing Changes v8: Renamed property names for backlight with vendor prefix Modified gpio-enable property to generic property for GPIO Made up the example for backlight DT Changes v7: Nothing Changes v6: Nothing Changes v5: Nothing Changes v4: Nothing Changes v3: Nothing Changes v2: Added reg attribute for I2C slave address .../video/backlight/sky81452-backlight.txt | 29 ++ 1 file changed, 29 insertions(+) create mode 100644 Documentation/devicetree/bindings/video/backlight/sky81452-backlight.txt diff --git a/Documentation/devicetree/bindings/video/backlight/sky81452-backlight.txt b/Documentation/devicetree/bindings/video/backlight/sky81452-backlight.txt new file mode 100644 index 000..8daebf5 --- /dev/null +++ b/Documentation/devicetree/bindings/video/backlight/sky81452-backlight.txt @@ -0,0 +1,29 @@ +SKY81452-backlight bindings + +Required properties: +- compatible : Must be "skyworks,sky81452-backlight" + +Optional properties: +- name : Name of backlight device. Default is 'lcd-backlight'. +- gpios: GPIO to use to EN pin. + See Documentation/devicetree/bindings/gpio/gpio.txt +- skyworks,en-channels : Enable mask for current sink channel 1 to 6. +- skyworks,ignore-pwm : Ignore both PWM input +- skyworks,dpwm-mode : Enable DPWM dimming mode, otherwise Analog dimming. +- skyworks,phase-shift : Enable phase shift mode +- skyworks,ovp-level : Over-voltage protection level. + Should be between 14 or 28V. +- skyworks,short-detection-threshold : It should be one of 4, 5, 6 and 7V. +- skyworks,current-limit : It should be 2300mA or 2750mA. + +Example: + + backlight { + compatible = "skyworks,sky81452-backlight"; + name = "pwm-backlight"; + skyworks,en-channels = <0x3f>; + skyworks,ignore-pwm; + skyworks,phase-shift; + skyworks,ovp-level = <20>; + skyworks,current-limit = <2300>; + }; -- 1.9.1 -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
[PATCH v10 5/6] devicetree: Add vendor prefix for Skyworks Solutions, Inc.
From: Gyungoh Yoo Signed-off-by: Gyungoh Yoo --- Changes v10: Nothing Changes v9: Nothing Changes v8: Nothing Changes v7: Nothing Changes v6: Nothing Changes v5: Nothing Changes v4: Nothing Changes v3: Nothing Changes v2: Added vendor prefix for Skyworks Solutions, Inc. Documentation/devicetree/bindings/vendor-prefixes.txt | 1 + 1 file changed, 1 insertion(+) diff --git a/Documentation/devicetree/bindings/vendor-prefixes.txt b/Documentation/devicetree/bindings/vendor-prefixes.txt index a344ec2..68143f0 100644 --- a/Documentation/devicetree/bindings/vendor-prefixes.txt +++ b/Documentation/devicetree/bindings/vendor-prefixes.txt @@ -140,6 +140,7 @@ sii Seiko Instruments, Inc. silergySilergy Corp. sirf SiRF Technology, Inc. sitronix Sitronix Technology Corporation +skyworks Skyworks Solutions, Inc. smsc Standard Microsystems Corporation snps Synopsys, Inc. solidrun SolidRun -- 1.9.1 -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
[PATCH v10 3/6] devicetree: mfd: Add new SKY81452 mfd binding
From: Gyungoh Yoo Signed-off-by: Gyungoh Yoo --- Changes v10: Nothing Changes v9: Nothing Changes v8: Made up the example for backlight DT Changes v7: Nothing Changes v6: Nothing Changes v5: Changed DT for regulator : 'lout' node should be defined under 'regulator' Removed compatible string from sky81452-regulator driver Changes v4: Nothing Changes v3: Nothing Changes v2: Added reg attribute for I2C slave address Documentation/devicetree/bindings/mfd/sky81452.txt | 36 ++ 1 file changed, 36 insertions(+) create mode 100644 Documentation/devicetree/bindings/mfd/sky81452.txt diff --git a/Documentation/devicetree/bindings/mfd/sky81452.txt b/Documentation/devicetree/bindings/mfd/sky81452.txt new file mode 100644 index 000..ab71473 --- /dev/null +++ b/Documentation/devicetree/bindings/mfd/sky81452.txt @@ -0,0 +1,36 @@ +SKY81452 bindings + +Required properties: +- compatible : Must be "skyworks,sky81452" +- reg : I2C slave address + +Required child nodes: +- backlight: container node for backlight following the binding + in video/backlight/sky81452-backlight.txt +- regulator: container node for regulators following the binding + in regulator/sky81452-regulator.txt + +Example: + + sky81452@2c { + compatible = "skyworks,sky81452"; + reg = <0x2c>; + + backlight { + compatible = "skyworks,sky81452-backlight"; + name = "pwm-backlight"; + skyworks,en-channels = <0x3f>; + skyworks,ignore-pwm; + skyworks,phase-shift; + skyworks,ovp-level = <20>; + skyworks,current-limit = <2300>; + }; + + regulator { + lout { + regulator-name = "sky81452-lout"; + regulator-min-microvolt = <450>; + regulator-max-microvolt = <800>; + }; + }; + }; -- 1.9.1 -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
[PATCH v10 2/6] backlight: Add support Skyworks SKY81452 backlight driver
From: Gyungoh Yoo Signed-off-by: Gyungoh Yoo --- Changes v10: Removed trivial get_brightness implementations Changes v9: Nothing Changes v8: Renamed property names for backlight with vendor prefix Modified gpio-enable property to generic property for GPIO Changes v7: Modified licensing text to GPLv2 Changes v6: Added new line character at the end of line of dev_err() Changes v5: Move sky81452-backlight.h to include/linux/platform_data Changes v4: Reordering header files for readability Removed calling to backlight_device_unregister() Removed MODULE_VERSION() Modified license to GPLv2 Changes v3: Modified DBG messages Changes v2: Added 'compatible' attribute in the driver Added message for exception or errors drivers/video/backlight/Kconfig | 10 + drivers/video/backlight/Makefile | 1 + drivers/video/backlight/sky81452-backlight.c | 334 +++ include/linux/platform_data/sky81452-backlight.h | 46 4 files changed, 391 insertions(+) create mode 100644 drivers/video/backlight/sky81452-backlight.c create mode 100644 include/linux/platform_data/sky81452-backlight.h diff --git a/drivers/video/backlight/Kconfig b/drivers/video/backlight/Kconfig index 8d03924..2586fdd 100644 --- a/drivers/video/backlight/Kconfig +++ b/drivers/video/backlight/Kconfig @@ -409,6 +409,16 @@ config BACKLIGHT_PANDORA If you have a Pandora console, say Y to enable the backlight driver. +config BACKLIGHT_SKY81452 + tristate "Backlight driver for SKY81452" + depends on BACKLIGHT_CLASS_DEVICE && MFD_SKY81452 + help + If you have a Skyworks SKY81452, say Y to enable the + backlight driver. + + To compile this driver as a module, choose M here: the module will + be called sky81452-backlight + config BACKLIGHT_TPS65217 tristate "TPS65217 Backlight" depends on BACKLIGHT_CLASS_DEVICE && MFD_TPS65217 diff --git a/drivers/video/backlight/Makefile b/drivers/video/backlight/Makefile index fcd50b73..d67073f 100644 --- a/drivers/video/backlight/Makefile +++ b/drivers/video/backlight/Makefile @@ -50,6 +50,7 @@ obj-$(CONFIG_BACKLIGHT_PANDORA) += pandora_bl.o obj-$(CONFIG_BACKLIGHT_PCF50633) += pcf50633-backlight.o obj-$(CONFIG_BACKLIGHT_PWM)+= pwm_bl.o obj-$(CONFIG_BACKLIGHT_SAHARA) += kb3886_bl.o +obj-$(CONFIG_BACKLIGHT_SKY81452) += sky81452-backlight.o obj-$(CONFIG_BACKLIGHT_TOSA) += tosa_bl.o obj-$(CONFIG_BACKLIGHT_TPS65217) += tps65217_bl.o obj-$(CONFIG_BACKLIGHT_WM831X) += wm831x_bl.o diff --git a/drivers/video/backlight/sky81452-backlight.c b/drivers/video/backlight/sky81452-backlight.c new file mode 100644 index 000..8105597 --- /dev/null +++ b/drivers/video/backlight/sky81452-backlight.c @@ -0,0 +1,334 @@ +/* + * sky81452-backlight.cSKY81452 backlight driver + * + * Copyright 2014 Skyworks Solutions Inc. + * Author : Gyungoh Yoo + * + * 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. + * + * This program is distributed in the hope that it will be useful, but + * WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, see <http://www.gnu.org/licenses/>. + */ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +/* registers */ +#define SKY81452_REG0 0x00 +#define SKY81452_REG1 0x01 +#define SKY81452_REG2 0x02 +#define SKY81452_REG4 0x04 +#define SKY81452_REG5 0x05 + +/* bit mask */ +#define SKY81452_CS0xFF +#define SKY81452_EN0x3F +#define SKY81452_IGPW 0x20 +#define SKY81452_PWMMD 0x10 +#define SKY81452_PHASE 0x08 +#define SKY81452_ILIM 0x04 +#define SKY81452_VSHRT 0x03 +#define SKY81452_OCP 0x80 +#define SKY81452_OTMP 0x40 +#define SKY81452_SHRT 0x3F +#define SKY81452_OPN 0x3F + +#define SKY81452_DEFAULT_NAME "lcd-backlight" +#define SKY81452_MAX_BRIGHTNESS(SKY81452_CS + 1) + +#define CTZ(b) __builtin_ctz(b) + +static int sky81452_bl_update_status(struct backlight_device *bd) +{ + const struct sky81452_bl_platform_data *pdata = + dev_get_platdata(bd->dev.parent); + const unsigned int brightness = (unsigned int)bd->props.brightness; + struct regmap *regmap = bl_get_data(bd); + int ret; + + if (brightness > 0) { + ret = regmap_write(regmap, SKY81452_REG0, brightness - 1); + if (IS_ERR_VALUE(ret)) + return ret; + +
[PATCH v10 6/6] devicetree: i2c: Add SKY81452 to the Trivial Devices list
From: Gyungoh Yoo Signed-off-by: Gyungoh Yoo --- Changes v10: Nothing Changes v9: Nothing Changes v8: Nothing Changes v7: Nothing Changes v6: Nothing Changes v5: Nothing Changes v4: Nothing Changes v3: Nothing Changes v2: Add SKY81452 to the Trivial Devices list Documentation/devicetree/bindings/i2c/trivial-devices.txt | 1 + 1 file changed, 1 insertion(+) diff --git a/Documentation/devicetree/bindings/i2c/trivial-devices.txt b/Documentation/devicetree/bindings/i2c/trivial-devices.txt index fbde415..122fa1e 100644 --- a/Documentation/devicetree/bindings/i2c/trivial-devices.txt +++ b/Documentation/devicetree/bindings/i2c/trivial-devices.txt @@ -77,6 +77,7 @@ ramtron,24c64 i2c serial eeprom (24cxx) ricoh,rs5c372a I2C bus SERIAL INTERFACE REAL-TIME CLOCK IC samsung,24ad0xd1 S524AD0XF1 (128K/256K-bit Serial EEPROM for Low Power) sii,s35390a2-wire CMOS real-time clock +skyworks,sky81452 Skyworks SKY81452: Six-Channel White LED Driver with Touch Panel Bias Supply st-micro,24c256i2c serial eeprom (24cxx) stm,m41t00 Serial Access TIMEKEEPER stm,m41t62 Serial real-time clock (RTC) with alarm -- 1.9.1 -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
[PATCH v10 0/6] Add Skyworks SKY81452 device drivers
From: Gyungoh Yoo This patch set includes regulator and backlight driver for SKY81452. Also it includes documents for device tree and module. sky81452-regulator was already applied. So this series doesn't include it. v10: Removed trivial get_brightness implementations for sky81452-backlight v9: Removed the change to remove MODULE_VERSION() for sky81452-regulator v8: Renamed property names for backlight with vendor prefix Modified gpio-enable property to generic property for GPIO Made up the example for backlight DT Changed the DT parsing of regulator using regulator_node and of_match v7: Modified licensing text to GPLv2 Splitted Kconfig renaming from DT patch v6: Added new line character at the end of line of dev_err() v5: Changed DT for regulator : 'lout' node should be defined under 'regulator' Removed compatible string from sky81452-regulator driver Modified sky81452-regulator to return EINVAL when of_node is NULL Move sky81452-backlight.h to include/linux/platform_data v4: Removed MODULE_VERSION() Modified license to GPLv2 Removed calling to backlight_device_unregister() in sky81452-backlight v3: Cleaned-up DBG messages Cleaned-up DT Fixed the backlight name from 'sky81452-bl' to 'sky81452-backlight' Assigned mfd_cell.of_compatible for binding device node Modified error messages Modified sky81452-regulator to return ENODATA when of_node is NULL v2: Split the patches for each sub-system Added 'reg' attribute for I2C address in device tree documents Added 'compatible' attribute in child drivers Renamed CONFIG_SKY81452 to CONFIG_MFD_SKY81452 Changed the dependency from I2C=y to I2C, for CONFIG_MFD_SKY81452 Added message for exception or errors. Added vendor prefix for Skyworks Solutions, Inc. Add SKY81452 to the Trivial Devices list Gyungoh Yoo (6): mfd: Add support for Skyworks SKY81452 driver backlight: Add support Skyworks SKY81452 backlight driver devicetree: mfd: Add new SKY81452 mfd binding devicetree: backlight: Add new SKY81452 backlight binding devicetree: Add vendor prefix for Skyworks Solutions, Inc. devicetree: i2c: Add SKY81452 to the Trivial Devices list .../devicetree/bindings/i2c/trivial-devices.txt| 1 + Documentation/devicetree/bindings/mfd/sky81452.txt | 36 +++ .../devicetree/bindings/vendor-prefixes.txt| 1 + .../video/backlight/sky81452-backlight.txt | 29 ++ drivers/mfd/Kconfig| 12 + drivers/mfd/Makefile | 1 + drivers/mfd/sky81452.c | 108 +++ drivers/video/backlight/Kconfig| 10 + drivers/video/backlight/Makefile | 1 + drivers/video/backlight/sky81452-backlight.c | 334 + include/linux/mfd/sky81452.h | 31 ++ include/linux/platform_data/sky81452-backlight.h | 46 +++ 12 files changed, 610 insertions(+) create mode 100644 Documentation/devicetree/bindings/mfd/sky81452.txt create mode 100644 Documentation/devicetree/bindings/video/backlight/sky81452-backlight.txt create mode 100644 drivers/mfd/sky81452.c create mode 100644 drivers/video/backlight/sky81452-backlight.c create mode 100644 include/linux/mfd/sky81452.h create mode 100644 include/linux/platform_data/sky81452-backlight.h -- 1.9.1 -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
[PATCH v10 0/6] Add Skyworks SKY81452 device drivers
From: Gyungoh Yoo jack@skyworksinc.com This patch set includes regulator and backlight driver for SKY81452. Also it includes documents for device tree and module. sky81452-regulator was already applied. So this series doesn't include it. v10: Removed trivial get_brightness implementations for sky81452-backlight v9: Removed the change to remove MODULE_VERSION() for sky81452-regulator v8: Renamed property names for backlight with vendor prefix Modified gpio-enable property to generic property for GPIO Made up the example for backlight DT Changed the DT parsing of regulator using regulator_node and of_match v7: Modified licensing text to GPLv2 Splitted Kconfig renaming from DT patch v6: Added new line character at the end of line of dev_err() v5: Changed DT for regulator : 'lout' node should be defined under 'regulator' Removed compatible string from sky81452-regulator driver Modified sky81452-regulator to return EINVAL when of_node is NULL Move sky81452-backlight.h to include/linux/platform_data v4: Removed MODULE_VERSION() Modified license to GPLv2 Removed calling to backlight_device_unregister() in sky81452-backlight v3: Cleaned-up DBG messages Cleaned-up DT Fixed the backlight name from 'sky81452-bl' to 'sky81452-backlight' Assigned mfd_cell.of_compatible for binding device node Modified error messages Modified sky81452-regulator to return ENODATA when of_node is NULL v2: Split the patches for each sub-system Added 'reg' attribute for I2C address in device tree documents Added 'compatible' attribute in child drivers Renamed CONFIG_SKY81452 to CONFIG_MFD_SKY81452 Changed the dependency from I2C=y to I2C, for CONFIG_MFD_SKY81452 Added message for exception or errors. Added vendor prefix for Skyworks Solutions, Inc. Add SKY81452 to the Trivial Devices list Gyungoh Yoo (6): mfd: Add support for Skyworks SKY81452 driver backlight: Add support Skyworks SKY81452 backlight driver devicetree: mfd: Add new SKY81452 mfd binding devicetree: backlight: Add new SKY81452 backlight binding devicetree: Add vendor prefix for Skyworks Solutions, Inc. devicetree: i2c: Add SKY81452 to the Trivial Devices list .../devicetree/bindings/i2c/trivial-devices.txt| 1 + Documentation/devicetree/bindings/mfd/sky81452.txt | 36 +++ .../devicetree/bindings/vendor-prefixes.txt| 1 + .../video/backlight/sky81452-backlight.txt | 29 ++ drivers/mfd/Kconfig| 12 + drivers/mfd/Makefile | 1 + drivers/mfd/sky81452.c | 108 +++ drivers/video/backlight/Kconfig| 10 + drivers/video/backlight/Makefile | 1 + drivers/video/backlight/sky81452-backlight.c | 334 + include/linux/mfd/sky81452.h | 31 ++ include/linux/platform_data/sky81452-backlight.h | 46 +++ 12 files changed, 610 insertions(+) create mode 100644 Documentation/devicetree/bindings/mfd/sky81452.txt create mode 100644 Documentation/devicetree/bindings/video/backlight/sky81452-backlight.txt create mode 100644 drivers/mfd/sky81452.c create mode 100644 drivers/video/backlight/sky81452-backlight.c create mode 100644 include/linux/mfd/sky81452.h create mode 100644 include/linux/platform_data/sky81452-backlight.h -- 1.9.1 -- To unsubscribe from this list: send the line unsubscribe linux-kernel in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
[PATCH v10 5/6] devicetree: Add vendor prefix for Skyworks Solutions, Inc.
From: Gyungoh Yoo jack@skyworksinc.com Signed-off-by: Gyungoh Yoo jack@skyworksinc.com --- Changes v10: Nothing Changes v9: Nothing Changes v8: Nothing Changes v7: Nothing Changes v6: Nothing Changes v5: Nothing Changes v4: Nothing Changes v3: Nothing Changes v2: Added vendor prefix for Skyworks Solutions, Inc. Documentation/devicetree/bindings/vendor-prefixes.txt | 1 + 1 file changed, 1 insertion(+) diff --git a/Documentation/devicetree/bindings/vendor-prefixes.txt b/Documentation/devicetree/bindings/vendor-prefixes.txt index a344ec2..68143f0 100644 --- a/Documentation/devicetree/bindings/vendor-prefixes.txt +++ b/Documentation/devicetree/bindings/vendor-prefixes.txt @@ -140,6 +140,7 @@ sii Seiko Instruments, Inc. silergySilergy Corp. sirf SiRF Technology, Inc. sitronix Sitronix Technology Corporation +skyworks Skyworks Solutions, Inc. smsc Standard Microsystems Corporation snps Synopsys, Inc. solidrun SolidRun -- 1.9.1 -- To unsubscribe from this list: send the line unsubscribe linux-kernel in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
[PATCH v10 3/6] devicetree: mfd: Add new SKY81452 mfd binding
From: Gyungoh Yoo jack@skyworksinc.com Signed-off-by: Gyungoh Yoo jack@skyworksinc.com --- Changes v10: Nothing Changes v9: Nothing Changes v8: Made up the example for backlight DT Changes v7: Nothing Changes v6: Nothing Changes v5: Changed DT for regulator : 'lout' node should be defined under 'regulator' Removed compatible string from sky81452-regulator driver Changes v4: Nothing Changes v3: Nothing Changes v2: Added reg attribute for I2C slave address Documentation/devicetree/bindings/mfd/sky81452.txt | 36 ++ 1 file changed, 36 insertions(+) create mode 100644 Documentation/devicetree/bindings/mfd/sky81452.txt diff --git a/Documentation/devicetree/bindings/mfd/sky81452.txt b/Documentation/devicetree/bindings/mfd/sky81452.txt new file mode 100644 index 000..ab71473 --- /dev/null +++ b/Documentation/devicetree/bindings/mfd/sky81452.txt @@ -0,0 +1,36 @@ +SKY81452 bindings + +Required properties: +- compatible : Must be skyworks,sky81452 +- reg : I2C slave address + +Required child nodes: +- backlight: container node for backlight following the binding + in video/backlight/sky81452-backlight.txt +- regulator: container node for regulators following the binding + in regulator/sky81452-regulator.txt + +Example: + + sky81452@2c { + compatible = skyworks,sky81452; + reg = 0x2c; + + backlight { + compatible = skyworks,sky81452-backlight; + name = pwm-backlight; + skyworks,en-channels = 0x3f; + skyworks,ignore-pwm; + skyworks,phase-shift; + skyworks,ovp-level = 20; + skyworks,current-limit = 2300; + }; + + regulator { + lout { + regulator-name = sky81452-lout; + regulator-min-microvolt = 450; + regulator-max-microvolt = 800; + }; + }; + }; -- 1.9.1 -- To unsubscribe from this list: send the line unsubscribe linux-kernel in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
[PATCH v10 2/6] backlight: Add support Skyworks SKY81452 backlight driver
From: Gyungoh Yoo jack@skyworksinc.com Signed-off-by: Gyungoh Yoo jack@skyworksinc.com --- Changes v10: Removed trivial get_brightness implementations Changes v9: Nothing Changes v8: Renamed property names for backlight with vendor prefix Modified gpio-enable property to generic property for GPIO Changes v7: Modified licensing text to GPLv2 Changes v6: Added new line character at the end of line of dev_err() Changes v5: Move sky81452-backlight.h to include/linux/platform_data Changes v4: Reordering header files for readability Removed calling to backlight_device_unregister() Removed MODULE_VERSION() Modified license to GPLv2 Changes v3: Modified DBG messages Changes v2: Added 'compatible' attribute in the driver Added message for exception or errors drivers/video/backlight/Kconfig | 10 + drivers/video/backlight/Makefile | 1 + drivers/video/backlight/sky81452-backlight.c | 334 +++ include/linux/platform_data/sky81452-backlight.h | 46 4 files changed, 391 insertions(+) create mode 100644 drivers/video/backlight/sky81452-backlight.c create mode 100644 include/linux/platform_data/sky81452-backlight.h diff --git a/drivers/video/backlight/Kconfig b/drivers/video/backlight/Kconfig index 8d03924..2586fdd 100644 --- a/drivers/video/backlight/Kconfig +++ b/drivers/video/backlight/Kconfig @@ -409,6 +409,16 @@ config BACKLIGHT_PANDORA If you have a Pandora console, say Y to enable the backlight driver. +config BACKLIGHT_SKY81452 + tristate Backlight driver for SKY81452 + depends on BACKLIGHT_CLASS_DEVICE MFD_SKY81452 + help + If you have a Skyworks SKY81452, say Y to enable the + backlight driver. + + To compile this driver as a module, choose M here: the module will + be called sky81452-backlight + config BACKLIGHT_TPS65217 tristate TPS65217 Backlight depends on BACKLIGHT_CLASS_DEVICE MFD_TPS65217 diff --git a/drivers/video/backlight/Makefile b/drivers/video/backlight/Makefile index fcd50b73..d67073f 100644 --- a/drivers/video/backlight/Makefile +++ b/drivers/video/backlight/Makefile @@ -50,6 +50,7 @@ obj-$(CONFIG_BACKLIGHT_PANDORA) += pandora_bl.o obj-$(CONFIG_BACKLIGHT_PCF50633) += pcf50633-backlight.o obj-$(CONFIG_BACKLIGHT_PWM)+= pwm_bl.o obj-$(CONFIG_BACKLIGHT_SAHARA) += kb3886_bl.o +obj-$(CONFIG_BACKLIGHT_SKY81452) += sky81452-backlight.o obj-$(CONFIG_BACKLIGHT_TOSA) += tosa_bl.o obj-$(CONFIG_BACKLIGHT_TPS65217) += tps65217_bl.o obj-$(CONFIG_BACKLIGHT_WM831X) += wm831x_bl.o diff --git a/drivers/video/backlight/sky81452-backlight.c b/drivers/video/backlight/sky81452-backlight.c new file mode 100644 index 000..8105597 --- /dev/null +++ b/drivers/video/backlight/sky81452-backlight.c @@ -0,0 +1,334 @@ +/* + * sky81452-backlight.cSKY81452 backlight driver + * + * Copyright 2014 Skyworks Solutions Inc. + * Author : Gyungoh Yoo jack@skyworksinc.com + * + * 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. + * + * This program is distributed in the hope that it will be useful, but + * WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, see http://www.gnu.org/licenses/. + */ + +#include linux/backlight.h +#include linux/err.h +#include linux/gpio.h +#include linux/init.h +#include linux/kernel.h +#include linux/module.h +#include linux/of.h +#include linux/of_gpio.h +#include linux/platform_device.h +#include linux/regmap.h +#include linux/platform_data/sky81452-backlight.h +#include linux/slab.h + +/* registers */ +#define SKY81452_REG0 0x00 +#define SKY81452_REG1 0x01 +#define SKY81452_REG2 0x02 +#define SKY81452_REG4 0x04 +#define SKY81452_REG5 0x05 + +/* bit mask */ +#define SKY81452_CS0xFF +#define SKY81452_EN0x3F +#define SKY81452_IGPW 0x20 +#define SKY81452_PWMMD 0x10 +#define SKY81452_PHASE 0x08 +#define SKY81452_ILIM 0x04 +#define SKY81452_VSHRT 0x03 +#define SKY81452_OCP 0x80 +#define SKY81452_OTMP 0x40 +#define SKY81452_SHRT 0x3F +#define SKY81452_OPN 0x3F + +#define SKY81452_DEFAULT_NAME lcd-backlight +#define SKY81452_MAX_BRIGHTNESS(SKY81452_CS + 1) + +#define CTZ(b) __builtin_ctz(b) + +static int sky81452_bl_update_status(struct backlight_device *bd) +{ + const struct sky81452_bl_platform_data *pdata = + dev_get_platdata(bd-dev.parent); + const unsigned int brightness = (unsigned int)bd-props.brightness; + struct regmap *regmap = bl_get_data(bd); + int ret; + + if (brightness 0
[PATCH v10 6/6] devicetree: i2c: Add SKY81452 to the Trivial Devices list
From: Gyungoh Yoo jack@skyworksinc.com Signed-off-by: Gyungoh Yoo jack@skyworksinc.com --- Changes v10: Nothing Changes v9: Nothing Changes v8: Nothing Changes v7: Nothing Changes v6: Nothing Changes v5: Nothing Changes v4: Nothing Changes v3: Nothing Changes v2: Add SKY81452 to the Trivial Devices list Documentation/devicetree/bindings/i2c/trivial-devices.txt | 1 + 1 file changed, 1 insertion(+) diff --git a/Documentation/devicetree/bindings/i2c/trivial-devices.txt b/Documentation/devicetree/bindings/i2c/trivial-devices.txt index fbde415..122fa1e 100644 --- a/Documentation/devicetree/bindings/i2c/trivial-devices.txt +++ b/Documentation/devicetree/bindings/i2c/trivial-devices.txt @@ -77,6 +77,7 @@ ramtron,24c64 i2c serial eeprom (24cxx) ricoh,rs5c372a I2C bus SERIAL INTERFACE REAL-TIME CLOCK IC samsung,24ad0xd1 S524AD0XF1 (128K/256K-bit Serial EEPROM for Low Power) sii,s35390a2-wire CMOS real-time clock +skyworks,sky81452 Skyworks SKY81452: Six-Channel White LED Driver with Touch Panel Bias Supply st-micro,24c256i2c serial eeprom (24cxx) stm,m41t00 Serial Access TIMEKEEPER stm,m41t62 Serial real-time clock (RTC) with alarm -- 1.9.1 -- To unsubscribe from this list: send the line unsubscribe linux-kernel in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
[PATCH v10 4/6] devicetree: backlight: Add new SKY81452 backlight binding
From: Gyungoh Yoo jack@skyworksinc.com Signed-off-by: Gyungoh Yoo jack@skyworksinc.com Acked-by: Bryan Wu coolo...@gmail.com --- Changes v10: Nothing Changes v9: Nothing Changes v8: Renamed property names for backlight with vendor prefix Modified gpio-enable property to generic property for GPIO Made up the example for backlight DT Changes v7: Nothing Changes v6: Nothing Changes v5: Nothing Changes v4: Nothing Changes v3: Nothing Changes v2: Added reg attribute for I2C slave address .../video/backlight/sky81452-backlight.txt | 29 ++ 1 file changed, 29 insertions(+) create mode 100644 Documentation/devicetree/bindings/video/backlight/sky81452-backlight.txt diff --git a/Documentation/devicetree/bindings/video/backlight/sky81452-backlight.txt b/Documentation/devicetree/bindings/video/backlight/sky81452-backlight.txt new file mode 100644 index 000..8daebf5 --- /dev/null +++ b/Documentation/devicetree/bindings/video/backlight/sky81452-backlight.txt @@ -0,0 +1,29 @@ +SKY81452-backlight bindings + +Required properties: +- compatible : Must be skyworks,sky81452-backlight + +Optional properties: +- name : Name of backlight device. Default is 'lcd-backlight'. +- gpios: GPIO to use to EN pin. + See Documentation/devicetree/bindings/gpio/gpio.txt +- skyworks,en-channels : Enable mask for current sink channel 1 to 6. +- skyworks,ignore-pwm : Ignore both PWM input +- skyworks,dpwm-mode : Enable DPWM dimming mode, otherwise Analog dimming. +- skyworks,phase-shift : Enable phase shift mode +- skyworks,ovp-level : Over-voltage protection level. + Should be between 14 or 28V. +- skyworks,short-detection-threshold : It should be one of 4, 5, 6 and 7V. +- skyworks,current-limit : It should be 2300mA or 2750mA. + +Example: + + backlight { + compatible = skyworks,sky81452-backlight; + name = pwm-backlight; + skyworks,en-channels = 0x3f; + skyworks,ignore-pwm; + skyworks,phase-shift; + skyworks,ovp-level = 20; + skyworks,current-limit = 2300; + }; -- 1.9.1 -- To unsubscribe from this list: send the line unsubscribe linux-kernel in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
[PATCH v10 1/6] mfd: Add support for Skyworks SKY81452 driver
From: Gyungoh Yoo jack@skyworksinc.com Signed-off-by: Gyungoh Yoo jack@skyworksinc.com Acked-by: Lee Jones lee.jo...@linaro.org --- Changes v10: Nothing Changes v9: Nothing Changes v8: Nothing Changes v7: Modified licensing text to GPLv2 Changes v6: Added new line character at the end of line of dev_err() Changes v5: Move sky81452-backlight.h to include/linux/platform_data Changes v4: Removed MODULE_VERSION() Modified license to GPLv2 Changes v3: Fixed the backlight name from 'sky81452-bl' to 'sky81452-backlight' Assigned mfd_cell.of_compatible for binding device node Modified error messages Changes v2: Renamed CONFIG_SKY81452 to CONFIG_MFD_SKY81452 Changed the dependency from I2C=y to I2C, for CONFIG_MFD_SKY81452 Added message for exception or errors drivers/mfd/Kconfig | 12 + drivers/mfd/Makefile | 1 + drivers/mfd/sky81452.c | 108 +++ include/linux/mfd/sky81452.h | 31 + 4 files changed, 152 insertions(+) create mode 100644 drivers/mfd/sky81452.c create mode 100644 include/linux/mfd/sky81452.h diff --git a/drivers/mfd/Kconfig b/drivers/mfd/Kconfig index 1456ea7..a54244c 100644 --- a/drivers/mfd/Kconfig +++ b/drivers/mfd/Kconfig @@ -693,6 +693,18 @@ config MFD_SM501_GPIO lines on the SM501. The platform data is used to supply the base number for the first GPIO line to register. +config MFD_SKY81452 + tristate Skyworks Solutions SKY81452 + select MFD_CORE + select REGMAP_I2C + depends on I2C + help + This is the core driver for the Skyworks SKY81452 backlight and + voltage regulator device. + + This driver can also be built as a module. If so, the module + will be called sky81452. + config MFD_SMSC bool SMSC ECE1099 series chips depends on I2C=y diff --git a/drivers/mfd/Makefile b/drivers/mfd/Makefile index 8bd54b1..d9683ea 100644 --- a/drivers/mfd/Makefile +++ b/drivers/mfd/Makefile @@ -174,6 +174,7 @@ obj-$(CONFIG_MFD_STW481X) += stw481x.o obj-$(CONFIG_MFD_IPAQ_MICRO) += ipaq-micro.o obj-$(CONFIG_MFD_MENF21BMC)+= menf21bmc.o obj-$(CONFIG_MFD_HI6421_PMIC) += hi6421-pmic-core.o +obj-$(CONFIG_MFD_SKY81452) += sky81452.o intel-soc-pmic-objs:= intel_soc_pmic_core.o intel_soc_pmic_crc.o obj-$(CONFIG_INTEL_SOC_PMIC) += intel-soc-pmic.o diff --git a/drivers/mfd/sky81452.c b/drivers/mfd/sky81452.c new file mode 100644 index 000..b0c9b04 --- /dev/null +++ b/drivers/mfd/sky81452.c @@ -0,0 +1,108 @@ +/* + * sky81452.c SKY81452 MFD driver + * + * Copyright 2014 Skyworks Solutions Inc. + * Author : Gyungoh Yoo jack@skyworksinc.com + * + * 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. + * + * This program is distributed in the hope that it will be useful, but + * WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, see http://www.gnu.org/licenses/. + */ + +#include linux/kernel.h +#include linux/module.h +#include linux/init.h +#include linux/err.h +#include linux/slab.h +#include linux/i2c.h +#include linux/regmap.h +#include linux/mfd/core.h +#include linux/mfd/sky81452.h + +static const struct regmap_config sky81452_config = { + .reg_bits = 8, + .val_bits = 8, +}; + +static int sky81452_probe(struct i2c_client *client, + const struct i2c_device_id *id) +{ + struct device *dev = client-dev; + const struct sky81452_platform_data *pdata = dev_get_platdata(dev); + struct mfd_cell cells[2]; + struct regmap *regmap; + int ret; + + if (!pdata) { + pdata = devm_kzalloc(dev, sizeof(*pdata), GFP_KERNEL); + if (!pdata) + return -ENOMEM; + } + + regmap = devm_regmap_init_i2c(client, sky81452_config); + if (IS_ERR(regmap)) { + dev_err(dev, failed to initialize.err=%ld\n, PTR_ERR(regmap)); + return PTR_ERR(regmap); + } + + i2c_set_clientdata(client, regmap); + + memset(cells, 0, sizeof(cells)); + cells[0].name = sky81452-backlight; + cells[0].of_compatible = skyworks,sky81452-backlight; + cells[0].platform_data = pdata-bl_pdata; + cells[0].pdata_size = sizeof(*pdata-bl_pdata); + cells[1].name = sky81452-regulator; + cells[1].platform_data = pdata-regulator_init_data; + cells[1].pdata_size = sizeof(*pdata-regulator_init_data); + + ret = mfd_add_devices(dev, -1, cells, ARRAY_SIZE(cells), NULL, 0, NULL); + if (ret) + dev_err(dev, failed to add child devices
Re: [PATCH v10 2/6] backlight: Add support Skyworks SKY81452 backlight driver
On Thu, Dec 18, 2014 at 03:09:21PM +0900, Jingoo Han wrote: On Thursday, December 18, 2014 2:48 PM, Gyungoh Yoo wrote: From: Gyungoh Yoo jack@skyworksinc.com Signed-off-by: Gyungoh Yoo jack@skyworksinc.com Please add the following 'Acked-by's when you send this patch next time. Acked-by: Jingoo Han jg1@samsung.com Acked-by: Bryan Wu coolo...@gmail.com I see. Thank you. Best regards, Jingoo Han --- Changes v10: Removed trivial get_brightness implementations Changes v9: Nothing Changes v8: Renamed property names for backlight with vendor prefix Modified gpio-enable property to generic property for GPIO Changes v7: Modified licensing text to GPLv2 Changes v6: Added new line character at the end of line of dev_err() Changes v5: Move sky81452-backlight.h to include/linux/platform_data Changes v4: Reordering header files for readability Removed calling to backlight_device_unregister() Removed MODULE_VERSION() Modified license to GPLv2 Changes v3: Modified DBG messages Changes v2: Added 'compatible' attribute in the driver Added message for exception or errors drivers/video/backlight/Kconfig | 10 + drivers/video/backlight/Makefile | 1 + drivers/video/backlight/sky81452-backlight.c | 334 +++ include/linux/platform_data/sky81452-backlight.h | 46 4 files changed, 391 insertions(+) create mode 100644 drivers/video/backlight/sky81452-backlight.c create mode 100644 include/linux/platform_data/sky81452-backlight.h diff --git a/drivers/video/backlight/Kconfig b/drivers/video/backlight/Kconfig index 8d03924..2586fdd 100644 --- a/drivers/video/backlight/Kconfig +++ b/drivers/video/backlight/Kconfig @@ -409,6 +409,16 @@ config BACKLIGHT_PANDORA If you have a Pandora console, say Y to enable the backlight driver. +config BACKLIGHT_SKY81452 + tristate Backlight driver for SKY81452 + depends on BACKLIGHT_CLASS_DEVICE MFD_SKY81452 + help + If you have a Skyworks SKY81452, say Y to enable the + backlight driver. + + To compile this driver as a module, choose M here: the module will + be called sky81452-backlight + config BACKLIGHT_TPS65217 tristate TPS65217 Backlight depends on BACKLIGHT_CLASS_DEVICE MFD_TPS65217 diff --git a/drivers/video/backlight/Makefile b/drivers/video/backlight/Makefile index fcd50b73..d67073f 100644 --- a/drivers/video/backlight/Makefile +++ b/drivers/video/backlight/Makefile @@ -50,6 +50,7 @@ obj-$(CONFIG_BACKLIGHT_PANDORA) += pandora_bl.o obj-$(CONFIG_BACKLIGHT_PCF50633) += pcf50633-backlight.o obj-$(CONFIG_BACKLIGHT_PWM)+= pwm_bl.o obj-$(CONFIG_BACKLIGHT_SAHARA) += kb3886_bl.o +obj-$(CONFIG_BACKLIGHT_SKY81452) += sky81452-backlight.o obj-$(CONFIG_BACKLIGHT_TOSA) += tosa_bl.o obj-$(CONFIG_BACKLIGHT_TPS65217) += tps65217_bl.o obj-$(CONFIG_BACKLIGHT_WM831X) += wm831x_bl.o diff --git a/drivers/video/backlight/sky81452-backlight.c b/drivers/video/backlight/sky81452- backlight.c new file mode 100644 index 000..8105597 --- /dev/null +++ b/drivers/video/backlight/sky81452-backlight.c @@ -0,0 +1,334 @@ +/* + * sky81452-backlight.cSKY81452 backlight driver + * + * Copyright 2014 Skyworks Solutions Inc. + * Author : Gyungoh Yoo jack@skyworksinc.com + * + * 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. + * + * This program is distributed in the hope that it will be useful, but + * WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, see http://www.gnu.org/licenses/. + */ + +#include linux/backlight.h +#include linux/err.h +#include linux/gpio.h +#include linux/init.h +#include linux/kernel.h +#include linux/module.h +#include linux/of.h +#include linux/of_gpio.h +#include linux/platform_device.h +#include linux/regmap.h +#include linux/platform_data/sky81452-backlight.h +#include linux/slab.h + +/* registers */ +#define SKY81452_REG0 0x00 +#define SKY81452_REG1 0x01 +#define SKY81452_REG2 0x02 +#define SKY81452_REG4 0x04 +#define SKY81452_REG5 0x05 + +/* bit mask */ +#define SKY81452_CS0xFF +#define SKY81452_EN0x3F +#define SKY81452_IGPW 0x20 +#define SKY81452_PWMMD 0x10 +#define SKY81452_PHASE 0x08 +#define SKY81452_ILIM 0x04 +#define SKY81452_VSHRT 0x03 +#define
Re: [PATCH v10 2/6] backlight: Add support Skyworks SKY81452 backlight driver
On Wed, Dec 03, 2014 at 11:02:29AM +0100, Oliver Neukum wrote: > On Wed, 2014-12-03 at 16:05 +0900, gyun...@gmail.com wrote: > > +static ssize_t sky81452_bl_store_enable(struct device *dev, > > + struct device_attribute *attr, const char *buf, size_t > > count) > > +{ > > + struct regmap *regmap = bl_get_data(to_backlight_device(dev)); > > + unsigned long value; > > + int ret; > > + > > + ret = kstrtoul(buf, 16, ); > > + if (IS_ERR_VALUE(ret)) > > + return ret; > > + > > + ret = regmap_update_bits(regmap, SKY81452_REG1, SKY81452_EN, > > + value << CTZ(SKY81452_EN)); > > No range checking for value? Avaiable range is from 0 to SKY81452_EN. regmap_update_bits() is masking the value. > > > + if (IS_ERR_VALUE(ret)) > > + return ret; > > + > > + return count; > > +} > > Regards > Oliver > > -- > Oliver Neukum > -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
Re: [PATCH v10 2/6] backlight: Add support Skyworks SKY81452 backlight driver
On Wed, Dec 03, 2014 at 11:02:29AM +0100, Oliver Neukum wrote: On Wed, 2014-12-03 at 16:05 +0900, gyun...@gmail.com wrote: +static ssize_t sky81452_bl_store_enable(struct device *dev, + struct device_attribute *attr, const char *buf, size_t count) +{ + struct regmap *regmap = bl_get_data(to_backlight_device(dev)); + unsigned long value; + int ret; + + ret = kstrtoul(buf, 16, value); + if (IS_ERR_VALUE(ret)) + return ret; + + ret = regmap_update_bits(regmap, SKY81452_REG1, SKY81452_EN, + value CTZ(SKY81452_EN)); No range checking for value? Avaiable range is from 0 to SKY81452_EN. regmap_update_bits() is masking the value. + if (IS_ERR_VALUE(ret)) + return ret; + + return count; +} Regards Oliver -- Oliver Neukum oneu...@suse.de -- To unsubscribe from this list: send the line unsubscribe linux-kernel in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
[PATCH v10 4/6] devicetree: backlight: Add new SKY81452 backlight binding
From: Gyungoh Yoo Signed-off-by: Gyungoh Yoo Acked-by: Bryan Wu --- Changes v10: Nothing Changes v9: Nothing Changes v8: Renamed property names for backlight with vendor prefix Modified gpio-enable property to generic property for GPIO Made up the example for backlight DT Changes v7: Nothing Changes v6: Nothing Changes v5: Nothing Changes v4: Nothing Changes v3: Nothing Changes v2: Added reg attribute for I2C slave address .../video/backlight/sky81452-backlight.txt | 29 ++ 1 file changed, 29 insertions(+) create mode 100644 Documentation/devicetree/bindings/video/backlight/sky81452-backlight.txt diff --git a/Documentation/devicetree/bindings/video/backlight/sky81452-backlight.txt b/Documentation/devicetree/bindings/video/backlight/sky81452-backlight.txt new file mode 100644 index 000..8daebf5 --- /dev/null +++ b/Documentation/devicetree/bindings/video/backlight/sky81452-backlight.txt @@ -0,0 +1,29 @@ +SKY81452-backlight bindings + +Required properties: +- compatible : Must be "skyworks,sky81452-backlight" + +Optional properties: +- name : Name of backlight device. Default is 'lcd-backlight'. +- gpios: GPIO to use to EN pin. + See Documentation/devicetree/bindings/gpio/gpio.txt +- skyworks,en-channels : Enable mask for current sink channel 1 to 6. +- skyworks,ignore-pwm : Ignore both PWM input +- skyworks,dpwm-mode : Enable DPWM dimming mode, otherwise Analog dimming. +- skyworks,phase-shift : Enable phase shift mode +- skyworks,ovp-level : Over-voltage protection level. + Should be between 14 or 28V. +- skyworks,short-detection-threshold : It should be one of 4, 5, 6 and 7V. +- skyworks,current-limit : It should be 2300mA or 2750mA. + +Example: + + backlight { + compatible = "skyworks,sky81452-backlight"; + name = "pwm-backlight"; + skyworks,en-channels = <0x3f>; + skyworks,ignore-pwm; + skyworks,phase-shift; + skyworks,ovp-level = <20>; + skyworks,current-limit = <2300>; + }; -- 1.9.1 -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
[PATCH v10 5/6] devicetree: Add vendor prefix for Skyworks Solutions, Inc.
From: Gyungoh Yoo Signed-off-by: Gyungoh Yoo --- Changes v10: Nothing Changes v9: Nothing Changes v8: Nothing Changes v7: Nothing Changes v6: Nothing Changes v5: Nothing Changes v4: Nothing Changes v3: Nothing Changes v2: Added vendor prefix for Skyworks Solutions, Inc. Documentation/devicetree/bindings/vendor-prefixes.txt | 1 + 1 file changed, 1 insertion(+) diff --git a/Documentation/devicetree/bindings/vendor-prefixes.txt b/Documentation/devicetree/bindings/vendor-prefixes.txt index a344ec2..68143f0 100644 --- a/Documentation/devicetree/bindings/vendor-prefixes.txt +++ b/Documentation/devicetree/bindings/vendor-prefixes.txt @@ -140,6 +140,7 @@ sii Seiko Instruments, Inc. silergySilergy Corp. sirf SiRF Technology, Inc. sitronix Sitronix Technology Corporation +skyworks Skyworks Solutions, Inc. smsc Standard Microsystems Corporation snps Synopsys, Inc. solidrun SolidRun -- 1.9.1 -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
[PATCH v10 2/6] backlight: Add support Skyworks SKY81452 backlight driver
From: Gyungoh Yoo Signed-off-by: Gyungoh Yoo --- Changes v10: Removed trivial get_brightness implementations Changes v9: Nothing Changes v8: Renamed property names for backlight with vendor prefix Modified gpio-enable property to generic property for GPIO Changes v7: Modified licensing text to GPLv2 Changes v6: Added new line character at the end of line of dev_err() Changes v5: Move sky81452-backlight.h to include/linux/platform_data Changes v4: Reordering header files for readability Removed calling to backlight_device_unregister() Removed MODULE_VERSION() Modified license to GPLv2 Changes v3: Modified DBG messages Changes v2: Added 'compatible' attribute in the driver Added message for exception or errors drivers/video/backlight/Kconfig | 10 + drivers/video/backlight/Makefile | 1 + drivers/video/backlight/sky81452-backlight.c | 334 +++ include/linux/platform_data/sky81452-backlight.h | 46 4 files changed, 391 insertions(+) create mode 100644 drivers/video/backlight/sky81452-backlight.c create mode 100644 include/linux/platform_data/sky81452-backlight.h diff --git a/drivers/video/backlight/Kconfig b/drivers/video/backlight/Kconfig index 8d03924..2586fdd 100644 --- a/drivers/video/backlight/Kconfig +++ b/drivers/video/backlight/Kconfig @@ -409,6 +409,16 @@ config BACKLIGHT_PANDORA If you have a Pandora console, say Y to enable the backlight driver. +config BACKLIGHT_SKY81452 + tristate "Backlight driver for SKY81452" + depends on BACKLIGHT_CLASS_DEVICE && MFD_SKY81452 + help + If you have a Skyworks SKY81452, say Y to enable the + backlight driver. + + To compile this driver as a module, choose M here: the module will + be called sky81452-backlight + config BACKLIGHT_TPS65217 tristate "TPS65217 Backlight" depends on BACKLIGHT_CLASS_DEVICE && MFD_TPS65217 diff --git a/drivers/video/backlight/Makefile b/drivers/video/backlight/Makefile index fcd50b73..d67073f 100644 --- a/drivers/video/backlight/Makefile +++ b/drivers/video/backlight/Makefile @@ -50,6 +50,7 @@ obj-$(CONFIG_BACKLIGHT_PANDORA) += pandora_bl.o obj-$(CONFIG_BACKLIGHT_PCF50633) += pcf50633-backlight.o obj-$(CONFIG_BACKLIGHT_PWM)+= pwm_bl.o obj-$(CONFIG_BACKLIGHT_SAHARA) += kb3886_bl.o +obj-$(CONFIG_BACKLIGHT_SKY81452) += sky81452-backlight.o obj-$(CONFIG_BACKLIGHT_TOSA) += tosa_bl.o obj-$(CONFIG_BACKLIGHT_TPS65217) += tps65217_bl.o obj-$(CONFIG_BACKLIGHT_WM831X) += wm831x_bl.o diff --git a/drivers/video/backlight/sky81452-backlight.c b/drivers/video/backlight/sky81452-backlight.c new file mode 100644 index 000..8105597 --- /dev/null +++ b/drivers/video/backlight/sky81452-backlight.c @@ -0,0 +1,334 @@ +/* + * sky81452-backlight.cSKY81452 backlight driver + * + * Copyright 2014 Skyworks Solutions Inc. + * Author : Gyungoh Yoo + * + * 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. + * + * This program is distributed in the hope that it will be useful, but + * WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, see <http://www.gnu.org/licenses/>. + */ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +/* registers */ +#define SKY81452_REG0 0x00 +#define SKY81452_REG1 0x01 +#define SKY81452_REG2 0x02 +#define SKY81452_REG4 0x04 +#define SKY81452_REG5 0x05 + +/* bit mask */ +#define SKY81452_CS0xFF +#define SKY81452_EN0x3F +#define SKY81452_IGPW 0x20 +#define SKY81452_PWMMD 0x10 +#define SKY81452_PHASE 0x08 +#define SKY81452_ILIM 0x04 +#define SKY81452_VSHRT 0x03 +#define SKY81452_OCP 0x80 +#define SKY81452_OTMP 0x40 +#define SKY81452_SHRT 0x3F +#define SKY81452_OPN 0x3F + +#define SKY81452_DEFAULT_NAME "lcd-backlight" +#define SKY81452_MAX_BRIGHTNESS(SKY81452_CS + 1) + +#define CTZ(b) __builtin_ctz(b) + +static int sky81452_bl_update_status(struct backlight_device *bd) +{ + const struct sky81452_bl_platform_data *pdata = + dev_get_platdata(bd->dev.parent); + const unsigned int brightness = (unsigned int)bd->props.brightness; + struct regmap *regmap = bl_get_data(bd); + int ret; + + if (brightness > 0) { + ret = regmap_write(regmap, SKY81452_REG0, brightness - 1); + if (IS_ERR_VALUE(ret)) + return ret; + +
[PATCH v10 1/6] mfd: Add support for Skyworks SKY81452 driver
From: Gyungoh Yoo Signed-off-by: Gyungoh Yoo Acked-by: Lee Jones --- Changes v10: Nothing Changes v9: Nothing Changes v8: Nothing Changes v7: Modified licensing text to GPLv2 Changes v6: Added new line character at the end of line of dev_err() Changes v5: Move sky81452-backlight.h to include/linux/platform_data Changes v4: Removed MODULE_VERSION() Modified license to GPLv2 Changes v3: Fixed the backlight name from 'sky81452-bl' to 'sky81452-backlight' Assigned mfd_cell.of_compatible for binding device node Modified error messages Changes v2: Renamed CONFIG_SKY81452 to CONFIG_MFD_SKY81452 Changed the dependency from I2C=y to I2C, for CONFIG_MFD_SKY81452 Added message for exception or errors drivers/mfd/Kconfig | 12 + drivers/mfd/Makefile | 1 + drivers/mfd/sky81452.c | 108 +++ include/linux/mfd/sky81452.h | 31 + 4 files changed, 152 insertions(+) create mode 100644 drivers/mfd/sky81452.c create mode 100644 include/linux/mfd/sky81452.h diff --git a/drivers/mfd/Kconfig b/drivers/mfd/Kconfig index 1456ea7..a54244c 100644 --- a/drivers/mfd/Kconfig +++ b/drivers/mfd/Kconfig @@ -693,6 +693,18 @@ config MFD_SM501_GPIO lines on the SM501. The platform data is used to supply the base number for the first GPIO line to register. +config MFD_SKY81452 + tristate "Skyworks Solutions SKY81452" + select MFD_CORE + select REGMAP_I2C + depends on I2C + help + This is the core driver for the Skyworks SKY81452 backlight and + voltage regulator device. + + This driver can also be built as a module. If so, the module + will be called sky81452. + config MFD_SMSC bool "SMSC ECE1099 series chips" depends on I2C=y diff --git a/drivers/mfd/Makefile b/drivers/mfd/Makefile index 8bd54b1..d9683ea 100644 --- a/drivers/mfd/Makefile +++ b/drivers/mfd/Makefile @@ -174,6 +174,7 @@ obj-$(CONFIG_MFD_STW481X) += stw481x.o obj-$(CONFIG_MFD_IPAQ_MICRO) += ipaq-micro.o obj-$(CONFIG_MFD_MENF21BMC)+= menf21bmc.o obj-$(CONFIG_MFD_HI6421_PMIC) += hi6421-pmic-core.o +obj-$(CONFIG_MFD_SKY81452) += sky81452.o intel-soc-pmic-objs:= intel_soc_pmic_core.o intel_soc_pmic_crc.o obj-$(CONFIG_INTEL_SOC_PMIC) += intel-soc-pmic.o diff --git a/drivers/mfd/sky81452.c b/drivers/mfd/sky81452.c new file mode 100644 index 000..b0c9b04 --- /dev/null +++ b/drivers/mfd/sky81452.c @@ -0,0 +1,108 @@ +/* + * sky81452.c SKY81452 MFD driver + * + * Copyright 2014 Skyworks Solutions Inc. + * Author : Gyungoh Yoo + * + * 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. + * + * This program is distributed in the hope that it will be useful, but + * WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, see <http://www.gnu.org/licenses/>. + */ + +#include +#include +#include +#include +#include +#include +#include +#include +#include + +static const struct regmap_config sky81452_config = { + .reg_bits = 8, + .val_bits = 8, +}; + +static int sky81452_probe(struct i2c_client *client, + const struct i2c_device_id *id) +{ + struct device *dev = >dev; + const struct sky81452_platform_data *pdata = dev_get_platdata(dev); + struct mfd_cell cells[2]; + struct regmap *regmap; + int ret; + + if (!pdata) { + pdata = devm_kzalloc(dev, sizeof(*pdata), GFP_KERNEL); + if (!pdata) + return -ENOMEM; + } + + regmap = devm_regmap_init_i2c(client, _config); + if (IS_ERR(regmap)) { + dev_err(dev, "failed to initialize.err=%ld\n", PTR_ERR(regmap)); + return PTR_ERR(regmap); + } + + i2c_set_clientdata(client, regmap); + + memset(cells, 0, sizeof(cells)); + cells[0].name = "sky81452-backlight"; + cells[0].of_compatible = "skyworks,sky81452-backlight"; + cells[0].platform_data = pdata->bl_pdata; + cells[0].pdata_size = sizeof(*pdata->bl_pdata); + cells[1].name = "sky81452-regulator"; + cells[1].platform_data = pdata->regulator_init_data; + cells[1].pdata_size = sizeof(*pdata->regulator_init_data); + + ret = mfd_add_devices(dev, -1, cells, ARRAY_SIZE(cells), NULL, 0, NULL); + if (ret) + dev_err(dev, "failed to add child devices. err=%d\n", ret); + + return ret; +} + +static int sky81452_remove(struct i2c_client *client) +{ + mfd_r
[PATCH v10 3/6] devicetree: mfd: Add new SKY81452 mfd binding
From: Gyungoh Yoo Signed-off-by: Gyungoh Yoo --- Changes v10: Nothing Changes v9: Nothing Changes v8: Made up the example for backlight DT Changes v7: Nothing Changes v6: Nothing Changes v5: Changed DT for regulator : 'lout' node should be defined under 'regulator' Removed compatible string from sky81452-regulator driver Changes v4: Nothing Changes v3: Nothing Changes v2: Added reg attribute for I2C slave address Documentation/devicetree/bindings/mfd/sky81452.txt | 36 ++ 1 file changed, 36 insertions(+) create mode 100644 Documentation/devicetree/bindings/mfd/sky81452.txt diff --git a/Documentation/devicetree/bindings/mfd/sky81452.txt b/Documentation/devicetree/bindings/mfd/sky81452.txt new file mode 100644 index 000..ab71473 --- /dev/null +++ b/Documentation/devicetree/bindings/mfd/sky81452.txt @@ -0,0 +1,36 @@ +SKY81452 bindings + +Required properties: +- compatible : Must be "skyworks,sky81452" +- reg : I2C slave address + +Required child nodes: +- backlight: container node for backlight following the binding + in video/backlight/sky81452-backlight.txt +- regulator: container node for regulators following the binding + in regulator/sky81452-regulator.txt + +Example: + + sky81452@2c { + compatible = "skyworks,sky81452"; + reg = <0x2c>; + + backlight { + compatible = "skyworks,sky81452-backlight"; + name = "pwm-backlight"; + skyworks,en-channels = <0x3f>; + skyworks,ignore-pwm; + skyworks,phase-shift; + skyworks,ovp-level = <20>; + skyworks,current-limit = <2300>; + }; + + regulator { + lout { + regulator-name = "sky81452-lout"; + regulator-min-microvolt = <450>; + regulator-max-microvolt = <800>; + }; + }; + }; -- 1.9.1 -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
[PATCH v10 6/6] devicetree: i2c: Add SKY81452 to the Trivial Devices list
From: Gyungoh Yoo Signed-off-by: Gyungoh Yoo --- Changes v10: Nothing Changes v9: Nothing Changes v8: Nothing Changes v7: Nothing Changes v6: Nothing Changes v5: Nothing Changes v4: Nothing Changes v3: Nothing Changes v2: Add SKY81452 to the Trivial Devices list Documentation/devicetree/bindings/i2c/trivial-devices.txt | 1 + 1 file changed, 1 insertion(+) diff --git a/Documentation/devicetree/bindings/i2c/trivial-devices.txt b/Documentation/devicetree/bindings/i2c/trivial-devices.txt index fbde415..122fa1e 100644 --- a/Documentation/devicetree/bindings/i2c/trivial-devices.txt +++ b/Documentation/devicetree/bindings/i2c/trivial-devices.txt @@ -77,6 +77,7 @@ ramtron,24c64 i2c serial eeprom (24cxx) ricoh,rs5c372a I2C bus SERIAL INTERFACE REAL-TIME CLOCK IC samsung,24ad0xd1 S524AD0XF1 (128K/256K-bit Serial EEPROM for Low Power) sii,s35390a2-wire CMOS real-time clock +skyworks,sky81452 Skyworks SKY81452: Six-Channel White LED Driver with Touch Panel Bias Supply st-micro,24c256i2c serial eeprom (24cxx) stm,m41t00 Serial Access TIMEKEEPER stm,m41t62 Serial real-time clock (RTC) with alarm -- 1.9.1 -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/