Skip to content

Commit

Permalink
Merge tag 'pwm/for-3.13-rc1' of git://git.kernel.org/pub/scm/linux/ke…
Browse files Browse the repository at this point in the history
…rnel/git/thierry.reding/linux-pwm

Pull pwm changes from Thierry Reding:
 "Mostly bug fixes and clean up.  There is a new driver, which is
  actually moving a custom PWM driver from drivers/misc.

  The majority of the patches are enhancements to the device tree
  support in the pwm-backlight driver.  Backlights can now additionally
  be powered using a regulator and enabled using a GPIO in addition to
  just the PWM input"

* tag 'pwm/for-3.13-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/thierry.reding/linux-pwm: (30 commits)
  Documentation/pwm: Update supported SoC name for pwm-samsung
  pwm: samsung: Fix kernel warning while unexporting a channel
  MAINTAINERS: Move PWM subsystem tree to kernel.org
  Documentation/pwm: Fix trivial typos
  pwm-backlight: Remove unused variable
  pwm_backlight: avoid short blank screen while doing hibernation
  pwm-backlight: Fix brightness adjustment
  pwm: add ep93xx PWM support
  pwm-backlight: Allow for non-increasing brightness levels
  pwm-backlight: Add power supply support
  pwm-backlight: Use new enable_gpio field
  unicore32: Initialize PWM backlight enable_gpio field
  ARM: shmobile: Initialize PWM backlight enable_gpio field
  ARM: SAMSUNG: Initialize PWM backlight enable_gpio field
  ARM: pxa: Initialize PWM backlight enable_gpio field
  ARM: OMAP: Initialize PWM backlight enable_gpio field
  pwm-backlight: Add optional enable GPIO
  pwm-backlight: Track enable state
  pwm-backlight: Refactor backlight power on/off
  pwm-backlight: Improve readability
  ...
  • Loading branch information
torvalds committed Nov 16, 2013
2 parents 449bf8d + 1b3f25c commit 0bde729
Show file tree
Hide file tree
Showing 51 changed files with 433 additions and 392 deletions.
2 changes: 1 addition & 1 deletion Documentation/devicetree/bindings/pwm/pwm-samsung.txt
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ Required properties:
samsung,s5pc100-pwm - for 32-bit timers present on S5PC100, S5PV210,
Exynos4210 rev0 SoCs
samsung,exynos4210-pwm - for 32-bit timers present on Exynos4210,
Exynos4x12 and Exynos5250 SoCs
Exynos4x12, Exynos5250 and Exynos5420 SoCs
- reg: base address and size of register area
- interrupts: list of timer interrupts (one interrupt per timer, starting at
timer 0)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,16 @@ Required properties:
last value in the array represents a 100% duty cycle (brightest).
- default-brightness-level: the default brightness level (index into the
array defined by the "brightness-levels" property)
- power-supply: regulator for supply voltage

Optional properties:
- pwm-names: a list of names for the PWM devices specified in the
"pwms" property (see PWM binding[0])
- enable-gpios: contains a single GPIO specifier for the GPIO which enables
and disables the backlight (see GPIO binding[1])

[0]: Documentation/devicetree/bindings/pwm/pwm.txt
[1]: Documentation/devicetree/bindings/gpio/gpio.txt

Example:

Expand All @@ -25,4 +29,7 @@ Example:

brightness-levels = <0 4 8 16 32 64 128 255>;
default-brightness-level = <6>;

power-supply = <&vdd_bl_reg>;
enable-gpios = <&gpio 58 0>;
};
4 changes: 2 additions & 2 deletions Documentation/pwm.txt
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ New users should use the pwm_get() function and pass to it the consumer
device or a consumer name. pwm_put() is used to free the PWM device. Managed
variants of these functions, devm_pwm_get() and devm_pwm_put(), also exist.

After being requested a PWM has to be configured using:
After being requested, a PWM has to be configured using:

int pwm_config(struct pwm_device *pwm, int duty_ns, int period_ns);

Expand Down Expand Up @@ -94,7 +94,7 @@ for new drivers to use the generic PWM framework.
A new PWM controller/chip can be added using pwmchip_add() and removed
again with pwmchip_remove(). pwmchip_add() takes a filled in struct
pwm_chip as argument which provides a description of the PWM chip, the
number of PWM devices provider by the chip and the chip-specific
number of PWM devices provided by the chip and the chip-specific
implementation of the supported PWM operations to the framework.

Locking
Expand Down
3 changes: 1 addition & 2 deletions MAINTAINERS
Original file line number Diff line number Diff line change
Expand Up @@ -6785,8 +6785,7 @@ PWM SUBSYSTEM
M: Thierry Reding <[email protected]>
L: [email protected]
S: Maintained
W: http://gitorious.org/linux-pwm
T: git git://gitorious.org/linux-pwm/linux-pwm.git
T: git git://git.kernel.org/pub/scm/linux/kernel/git/thierry.reding/linux-pwm.git
F: Documentation/pwm.txt
F: Documentation/devicetree/bindings/pwm/
F: include/linux/pwm.h
Expand Down
1 change: 1 addition & 0 deletions arch/arm/mach-pxa/cm-x300.c
Original file line number Diff line number Diff line change
Expand Up @@ -310,6 +310,7 @@ static struct platform_pwm_backlight_data cm_x300_backlight_data = {
.max_brightness = 100,
.dft_brightness = 100,
.pwm_period_ns = 10000,
.enable_gpio = -1,
};

static struct platform_device cm_x300_backlight_device = {
Expand Down
1 change: 1 addition & 0 deletions arch/arm/mach-pxa/colibri-pxa270-income.c
Original file line number Diff line number Diff line change
Expand Up @@ -189,6 +189,7 @@ static struct platform_pwm_backlight_data income_backlight_data = {
.max_brightness = 0x3ff,
.dft_brightness = 0x1ff,
.pwm_period_ns = 1000000,
.enable_gpio = -1,
};

static struct platform_device income_backlight = {
Expand Down
1 change: 1 addition & 0 deletions arch/arm/mach-pxa/ezx.c
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@ static struct platform_pwm_backlight_data ezx_backlight_data = {
.max_brightness = 1023,
.dft_brightness = 1023,
.pwm_period_ns = 78770,
.enable_gpio = -1,
};

static struct platform_device ezx_backlight_device = {
Expand Down
1 change: 1 addition & 0 deletions arch/arm/mach-pxa/hx4700.c
Original file line number Diff line number Diff line change
Expand Up @@ -561,6 +561,7 @@ static struct platform_pwm_backlight_data backlight_data = {
.max_brightness = 200,
.dft_brightness = 100,
.pwm_period_ns = 30923,
.enable_gpio = -1,
};

static struct platform_device backlight = {
Expand Down
1 change: 1 addition & 0 deletions arch/arm/mach-pxa/lpd270.c
Original file line number Diff line number Diff line change
Expand Up @@ -269,6 +269,7 @@ static struct platform_pwm_backlight_data lpd270_backlight_data = {
.max_brightness = 1,
.dft_brightness = 1,
.pwm_period_ns = 78770,
.enable_gpio = -1,
};

static struct platform_device lpd270_backlight_device = {
Expand Down
1 change: 1 addition & 0 deletions arch/arm/mach-pxa/magician.c
Original file line number Diff line number Diff line change
Expand Up @@ -378,6 +378,7 @@ static struct platform_pwm_backlight_data backlight_data = {
.max_brightness = 272,
.dft_brightness = 100,
.pwm_period_ns = 30923,
.enable_gpio = -1,
.init = magician_backlight_init,
.notify = magician_backlight_notify,
.exit = magician_backlight_exit,
Expand Down
1 change: 1 addition & 0 deletions arch/arm/mach-pxa/mainstone.c
Original file line number Diff line number Diff line change
Expand Up @@ -338,6 +338,7 @@ static struct platform_pwm_backlight_data mainstone_backlight_data = {
.max_brightness = 1023,
.dft_brightness = 1023,
.pwm_period_ns = 78770,
.enable_gpio = -1,
};

static struct platform_device mainstone_backlight_device = {
Expand Down
1 change: 1 addition & 0 deletions arch/arm/mach-pxa/mioa701.c
Original file line number Diff line number Diff line change
Expand Up @@ -186,6 +186,7 @@ static struct platform_pwm_backlight_data mioa701_backlight_data = {
.max_brightness = 100,
.dft_brightness = 50,
.pwm_period_ns = 4000 * 1024, /* Fl = 250kHz */
.enable_gpio = -1,
};

/*
Expand Down
1 change: 1 addition & 0 deletions arch/arm/mach-pxa/palm27x.c
Original file line number Diff line number Diff line change
Expand Up @@ -322,6 +322,7 @@ static struct platform_pwm_backlight_data palm27x_backlight_data = {
.max_brightness = 0xfe,
.dft_brightness = 0x7e,
.pwm_period_ns = 3500 * 1024,
.enable_gpio = -1,
.init = palm27x_backlight_init,
.notify = palm27x_backlight_notify,
.exit = palm27x_backlight_exit,
Expand Down
35 changes: 1 addition & 34 deletions arch/arm/mach-pxa/palmtc.c
Original file line number Diff line number Diff line change
Expand Up @@ -166,45 +166,12 @@ static inline void palmtc_keys_init(void) {}
* Backlight
******************************************************************************/
#if defined(CONFIG_BACKLIGHT_PWM) || defined(CONFIG_BACKLIGHT_PWM_MODULE)
static int palmtc_backlight_init(struct device *dev)
{
int ret;

ret = gpio_request(GPIO_NR_PALMTC_BL_POWER, "BL POWER");
if (ret)
goto err;
ret = gpio_direction_output(GPIO_NR_PALMTC_BL_POWER, 1);
if (ret)
goto err2;

return 0;

err2:
gpio_free(GPIO_NR_PALMTC_BL_POWER);
err:
return ret;
}

static int palmtc_backlight_notify(struct device *dev, int brightness)
{
/* backlight is on when GPIO16 AF0 is high */
gpio_set_value(GPIO_NR_PALMTC_BL_POWER, brightness);
return brightness;
}

static void palmtc_backlight_exit(struct device *dev)
{
gpio_free(GPIO_NR_PALMTC_BL_POWER);
}

static struct platform_pwm_backlight_data palmtc_backlight_data = {
.pwm_id = 1,
.max_brightness = PALMTC_MAX_INTENSITY,
.dft_brightness = PALMTC_MAX_INTENSITY,
.pwm_period_ns = PALMTC_PERIOD_NS,
.init = palmtc_backlight_init,
.notify = palmtc_backlight_notify,
.exit = palmtc_backlight_exit,
.enable_gpio = GPIO_NR_PALMTC_BL_POWER,
};

static struct platform_device palmtc_backlight = {
Expand Down
1 change: 1 addition & 0 deletions arch/arm/mach-pxa/palmte2.c
Original file line number Diff line number Diff line change
Expand Up @@ -165,6 +165,7 @@ static struct platform_pwm_backlight_data palmte2_backlight_data = {
.max_brightness = PALMTE2_MAX_INTENSITY,
.dft_brightness = PALMTE2_MAX_INTENSITY,
.pwm_period_ns = PALMTE2_PERIOD_NS,
.enable_gpio = -1,
.init = palmte2_backlight_init,
.notify = palmte2_backlight_notify,
.exit = palmte2_backlight_exit,
Expand Down
1 change: 1 addition & 0 deletions arch/arm/mach-pxa/pcm990-baseboard.c
Original file line number Diff line number Diff line change
Expand Up @@ -153,6 +153,7 @@ static struct platform_pwm_backlight_data pcm990_backlight_data = {
.max_brightness = 1023,
.dft_brightness = 1023,
.pwm_period_ns = 78770,
.enable_gpio = -1,
};

static struct platform_device pcm990_backlight_device = {
Expand Down
1 change: 1 addition & 0 deletions arch/arm/mach-pxa/raumfeld.c
Original file line number Diff line number Diff line change
Expand Up @@ -539,6 +539,7 @@ static struct platform_pwm_backlight_data raumfeld_pwm_backlight_data = {
.dft_brightness = 100,
/* 10000 ns = 10 ms ^= 100 kHz */
.pwm_period_ns = 10000,
.enable_gpio = -1,
};

static struct platform_device raumfeld_pwm_backlight_device = {
Expand Down
2 changes: 2 additions & 0 deletions arch/arm/mach-pxa/tavorevb.c
Original file line number Diff line number Diff line change
Expand Up @@ -175,13 +175,15 @@ static struct platform_pwm_backlight_data tavorevb_backlight_data[] = {
.max_brightness = 100,
.dft_brightness = 100,
.pwm_period_ns = 100000,
.enable_gpio = -1,
},
[1] = {
/* secondary backlight */
.pwm_id = 0,
.max_brightness = 100,
.dft_brightness = 100,
.pwm_period_ns = 100000,
.enable_gpio = -1,
},
};

Expand Down
1 change: 1 addition & 0 deletions arch/arm/mach-pxa/viper.c
Original file line number Diff line number Diff line change
Expand Up @@ -401,6 +401,7 @@ static struct platform_pwm_backlight_data viper_backlight_data = {
.max_brightness = 100,
.dft_brightness = 100,
.pwm_period_ns = 1000000,
.enable_gpio = -1,
.init = viper_backlight_init,
.notify = viper_backlight_notify,
.exit = viper_backlight_exit,
Expand Down
2 changes: 2 additions & 0 deletions arch/arm/mach-pxa/z2.c
Original file line number Diff line number Diff line change
Expand Up @@ -206,13 +206,15 @@ static struct platform_pwm_backlight_data z2_backlight_data[] = {
.max_brightness = 1023,
.dft_brightness = 0,
.pwm_period_ns = 1260320,
.enable_gpio = -1,
},
[1] = {
/* LCD Backlight */
.pwm_id = 2,
.max_brightness = 1023,
.dft_brightness = 512,
.pwm_period_ns = 1260320,
.enable_gpio = -1,
},
};

Expand Down
1 change: 1 addition & 0 deletions arch/arm/mach-pxa/zylonite.c
Original file line number Diff line number Diff line change
Expand Up @@ -125,6 +125,7 @@ static struct platform_pwm_backlight_data zylonite_backlight_data = {
.max_brightness = 100,
.dft_brightness = 100,
.pwm_period_ns = 10000,
.enable_gpio = -1,
};

static struct platform_device zylonite_backlight_device = {
Expand Down
1 change: 1 addition & 0 deletions arch/arm/mach-s3c24xx/mach-h1940.c
Original file line number Diff line number Diff line change
Expand Up @@ -504,6 +504,7 @@ static struct platform_pwm_backlight_data backlight_data = {
.dft_brightness = 50,
/* tcnt = 0x31 */
.pwm_period_ns = 36296,
.enable_gpio = -1,
.init = h1940_backlight_init,
.notify = h1940_backlight_notify,
.exit = h1940_backlight_exit,
Expand Down
1 change: 1 addition & 0 deletions arch/arm/mach-s3c24xx/mach-rx1950.c
Original file line number Diff line number Diff line change
Expand Up @@ -522,6 +522,7 @@ static struct platform_pwm_backlight_data rx1950_backlight_data = {
.max_brightness = 24,
.dft_brightness = 4,
.pwm_period_ns = 48000,
.enable_gpio = -1,
.init = rx1950_backlight_init,
.notify = rx1950_backlight_notify,
.exit = rx1950_backlight_exit,
Expand Down
1 change: 1 addition & 0 deletions arch/arm/mach-s3c64xx/mach-crag6410.c
Original file line number Diff line number Diff line change
Expand Up @@ -114,6 +114,7 @@ static struct platform_pwm_backlight_data crag6410_backlight_data = {
.max_brightness = 1000,
.dft_brightness = 600,
.pwm_period_ns = 100000, /* about 1kHz */
.enable_gpio = -1,
};

static struct platform_device crag6410_backlight_device = {
Expand Down
1 change: 1 addition & 0 deletions arch/arm/mach-s3c64xx/mach-hmt.c
Original file line number Diff line number Diff line change
Expand Up @@ -114,6 +114,7 @@ static struct platform_pwm_backlight_data hmt_backlight_data = {
.max_brightness = 100 * 256,
.dft_brightness = 40 * 256,
.pwm_period_ns = 1000000000 / (100 * 256 * 20),
.enable_gpio = -1,
.init = hmt_bl_init,
.notify = hmt_bl_notify,
.exit = hmt_bl_exit,
Expand Down
1 change: 1 addition & 0 deletions arch/arm/mach-s3c64xx/mach-smartq.c
Original file line number Diff line number Diff line change
Expand Up @@ -151,6 +151,7 @@ static struct platform_pwm_backlight_data smartq_backlight_data = {
.max_brightness = 1000,
.dft_brightness = 600,
.pwm_period_ns = 1000000000 / (1000 * 20),
.enable_gpio = -1,
.init = smartq_bl_init,
};

Expand Down
1 change: 1 addition & 0 deletions arch/arm/mach-s3c64xx/mach-smdk6410.c
Original file line number Diff line number Diff line change
Expand Up @@ -625,6 +625,7 @@ static struct samsung_bl_gpio_info smdk6410_bl_gpio_info = {

static struct platform_pwm_backlight_data smdk6410_bl_data = {
.pwm_id = 1,
.enable_gpio = -1,
};

static struct s3c_hsotg_plat smdk6410_hsotg_pdata;
Expand Down
1 change: 1 addition & 0 deletions arch/arm/mach-s5p64x0/mach-smdk6440.c
Original file line number Diff line number Diff line change
Expand Up @@ -223,6 +223,7 @@ static struct samsung_bl_gpio_info smdk6440_bl_gpio_info = {

static struct platform_pwm_backlight_data smdk6440_bl_data = {
.pwm_id = 1,
.enable_gpio = -1,
};

static void __init smdk6440_map_io(void)
Expand Down
1 change: 1 addition & 0 deletions arch/arm/mach-s5p64x0/mach-smdk6450.c
Original file line number Diff line number Diff line change
Expand Up @@ -242,6 +242,7 @@ static struct samsung_bl_gpio_info smdk6450_bl_gpio_info = {

static struct platform_pwm_backlight_data smdk6450_bl_data = {
.pwm_id = 1,
.enable_gpio = -1,
};

static void __init smdk6450_map_io(void)
Expand Down
1 change: 1 addition & 0 deletions arch/arm/mach-s5pc100/mach-smdkc100.c
Original file line number Diff line number Diff line change
Expand Up @@ -216,6 +216,7 @@ static struct samsung_bl_gpio_info smdkc100_bl_gpio_info = {

static struct platform_pwm_backlight_data smdkc100_bl_data = {
.pwm_id = 0,
.enable_gpio = -1,
};

static void __init smdkc100_map_io(void)
Expand Down
1 change: 1 addition & 0 deletions arch/arm/mach-s5pv210/mach-smdkv210.c
Original file line number Diff line number Diff line change
Expand Up @@ -279,6 +279,7 @@ static struct samsung_bl_gpio_info smdkv210_bl_gpio_info = {
static struct platform_pwm_backlight_data smdkv210_bl_data = {
.pwm_id = 3,
.pwm_period_ns = 1000,
.enable_gpio = -1,
};

static void __init smdkv210_map_io(void)
Expand Down
1 change: 1 addition & 0 deletions arch/arm/mach-shmobile/board-armadillo800eva.c
Original file line number Diff line number Diff line change
Expand Up @@ -423,6 +423,7 @@ static struct platform_pwm_backlight_data pwm_backlight_data = {
.max_brightness = 255,
.dft_brightness = 255,
.pwm_period_ns = 33333, /* 30kHz */
.enable_gpio = -1,
};

static struct platform_device pwm_backlight_device = {
Expand Down
5 changes: 5 additions & 0 deletions arch/arm/plat-samsung/dev-backlight.c
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,7 @@ static struct samsung_bl_drvdata samsung_dfl_bl_data __initdata = {
.max_brightness = 255,
.dft_brightness = 255,
.pwm_period_ns = 78770,
.enable_gpio = -1,
.init = samsung_bl_init,
.exit = samsung_bl_exit,
},
Expand Down Expand Up @@ -121,6 +122,10 @@ void __init samsung_bl_set(struct samsung_bl_gpio_info *gpio_info,
samsung_bl_data->lth_brightness = bl_data->lth_brightness;
if (bl_data->pwm_period_ns)
samsung_bl_data->pwm_period_ns = bl_data->pwm_period_ns;
if (bl_data->enable_gpio >= 0)
samsung_bl_data->enable_gpio = bl_data->enable_gpio;
if (bl_data->enable_gpio_flags)
samsung_bl_data->enable_gpio_flags = bl_data->enable_gpio_flags;
if (bl_data->init)
samsung_bl_data->init = bl_data->init;
if (bl_data->notify)
Expand Down
1 change: 1 addition & 0 deletions arch/unicore32/kernel/puv3-nb0916.c
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@ static struct platform_pwm_backlight_data nb0916_backlight_data = {
.max_brightness = 100,
.dft_brightness = 100,
.pwm_period_ns = 70 * 1024,
.enable_gpio = -1,
};

static struct gpio_keys_button nb0916_gpio_keys[] = {
Expand Down
13 changes: 0 additions & 13 deletions drivers/misc/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -381,19 +381,6 @@ config HMC6352
This driver provides support for the Honeywell HMC6352 compass,
providing configuration and heading data via sysfs.

config EP93XX_PWM
tristate "EP93xx PWM support"
depends on ARCH_EP93XX
help
This option enables device driver support for the PWM channels
on the Cirrus EP93xx processors. The EP9307 chip only has one
PWM channel all the others have two, the second channel is an
alternate function of the EGPIO14 pin. A sysfs interface is
provided to control the PWM channels.

To compile this driver as a module, choose M here: the module will
be called ep93xx_pwm.

config DS1682
tristate "Dallas DS1682 Total Elapsed Time Recorder with Alarm"
depends on I2C
Expand Down
1 change: 0 additions & 1 deletion drivers/misc/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,6 @@ obj-$(CONFIG_APDS9802ALS) += apds9802als.o
obj-$(CONFIG_ISL29003) += isl29003.o
obj-$(CONFIG_ISL29020) += isl29020.o
obj-$(CONFIG_SENSORS_TSL2550) += tsl2550.o
obj-$(CONFIG_EP93XX_PWM) += ep93xx_pwm.o
obj-$(CONFIG_DS1682) += ds1682.o
obj-$(CONFIG_TI_DAC7512) += ti_dac7512.o
obj-$(CONFIG_C2PORT) += c2port/
Expand Down
Loading

0 comments on commit 0bde729

Please sign in to comment.