29 Jun, 2016

1 commit

  • The LP8556 datasheet describes an EN/VDDIO input, which serves "both as
    a chip enable and as a power supply reference for PWM, SDA, and SCL
    inputs." The LP8556 that I'm testing doesn't respond properly if I try
    to talk I2C to it too quickly after enabling VDDIO, and the LP8555
    datasheet mentions a t_RESPONSE delay of up to 1 millisecond.

    Support this EN/VDDIO by adding a regulator property to the binding;
    enabling this regulator at probe time; and sleeping for 1 to 2ms, if the
    EN/VDDIO regulator was provided.

    Signed-off-by: Brian Norris
    Acked-by: Rob Herring
    Acked-by: Milo Kim
    Reviewed-by: Stephen Barber
    Signed-off-by: Lee Jones

    Brian Norris
     

26 May, 2016

1 commit

  • …erry.reding/linux-pwm

    Pull pwm updates from Thierry Reding:
    "This set of changes introduces an atomic API to the PWM subsystem.
    This is influenced by the DRM atomic API that was introduced a while
    back, though it is obviously a lot simpler. The fundamental idea
    remains the same, though: drivers provide a single callback to
    implement the atomic configuration of a PWM channel.

    As a side-effect the PWM subsystem gains the ability for initial state
    retrieval, so that the logical state mirrors that of the hardware.
    Many use-cases don't care about this, but for others it is essential.

    These new features require changes in all users, which these patches
    take care of. The core is transitioned to use the atomic callback if
    available and provides a fallback mechanism for other drivers.

    Changes to transition users and drivers to the atomic API are
    postponed to v4.8"

    * tag 'pwm/for-4.7-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/thierry.reding/linux-pwm: (30 commits)
    pwm: Add information about polarity, duty cycle and period to debugfs
    pwm: Switch to the atomic API
    pwm: Update documentation
    pwm: Add core infrastructure to allow atomic updates
    pwm: Add hardware readout infrastructure
    pwm: Move the enabled/disabled info into pwm_state
    pwm: Introduce the pwm_state concept
    pwm: Keep PWM state in sync with hardware state
    ARM: Explicitly apply PWM config extracted from pwm_args
    drm: i915: Explicitly apply PWM config extracted from pwm_args
    input: misc: pwm-beeper: Explicitly apply PWM config extracted from pwm_args
    input: misc: max8997: Explicitly apply PWM config extracted from pwm_args
    backlight: lm3630a: explicitly apply PWM config extracted from pwm_args
    backlight: lp855x: Explicitly apply PWM config extracted from pwm_args
    backlight: lp8788: Explicitly apply PWM config extracted from pwm_args
    backlight: pwm_bl: Use pwm_get_args() where appropriate
    fbdev: ssd1307fb: Use pwm_get_args() where appropriate
    regulator: pwm: Use pwm_get_args() where appropriate
    leds: pwm: Use pwm_get_args() where appropriate
    input: misc: max77693: Use pwm_get_args() where appropriate
    ...

    Linus Torvalds
     

17 May, 2016

6 commits


05 May, 2016

2 commits


11 Jan, 2016

7 commits

  • If pwm is requested by legacy pwm_request() and if the following
    backlight_device_register() call fails, add pwm_free() clean-up.

    Signed-off-by: Vladimir Zapolskiy
    Signed-off-by: Lee Jones

    Vladimir Zapolskiy
     
  • A recent patch I did fixed two potential uses of uninitialized
    variables in the adp8870 and adp8860 drivers. Unfortunately,
    I missed another one:

    drivers/video/backlight/adp8860_bl.c: In function 'adp8860_bl_ambient_light_level_show':
    drivers/video/backlight/adp8860_bl.c:570:11: warning: 'reg_val' may be used uninitialized in this function

    This does the same change as before in one additional function,
    and also changes the check for the return value in a way that
    avoids another false positive warning with a similar message.

    Signed-off-by: Arnd Bergmann
    Fixes: 6be3a5a9cd91 ("backlight: adp88x0: Fix uninitialized variable use")
    Acked-by: Michael Hennerich
    Acked-by: Jingoo Han
    Signed-off-by: Lee Jones

    Arnd Bergmann
     
  • There are situations where the backlight should be on at boot time
    (e.g. if the boot loader already turned the display on). The DT
    bindings specify the "default-on" property for that purpose.
    Currently, the initial state of the GPIO at request time is always
    set to logical off (high or low depending on whether it is an
    active high or low GPIO). Since the GPIO is requested as an output,
    the GPIO will be driven low for a short period of time, which leads
    to a flickering display in the above use-case.

    Initialize the GPIO depending on the default-on property to be
    logical on or off.

    Signed-off-by: Stefan Agner
    Signed-off-by: Lee Jones

    Stefan Agner
     
  • Commit ee65ad0e2a9e ("backlight: pwm_bl: Avoid backlight flicker when
    probed from DT") tries to dereference the device of_node pointer
    unconditionally, causing a NULL pointer dereference on non-dt platforms.
    Fix it by replacing the phandle variable with a node variable and
    by checking that for NULL before dereferencing it.

    Reported-by: Robert Jarzmik
    Signed-off-by: Philipp Zabel
    Acked-by: Thierry Reding
    Tested-by: Robert Jarzmik
    Signed-off-by: Lee Jones

    Philipp Zabel
     
  • The device table is required to load modules based on modaliases.

    Signed-off-by: Enric Balletbo i Serra
    Signed-off-by: Lee Jones

    Enric Balletbo i Serra
     
  • If the driver is probed from the device tree, and there is a phandle
    property set on it, and the enable GPIO is already configured as output,
    and the backlight is currently disabled, keep it disabled.
    If all these conditions are met, assume there will be some other driver
    that can enable the backlight at the appropriate time.

    Signed-off-by: Philipp Zabel
    Reviewed-by: Christian Gmeiner
    Tested-by: Heiko Stuebner
    Signed-off-by: Lee Jones

    Philipp Zabel
     
  • gcc correctly warns about both the adp8860 and adp8870 backlight
    drivers using an uninitialized variable in their error handling
    path:

    drivers/video/backlight/adp8870_bl.c: In function 'adp8870_bl_ambient_light_zone_store':
    drivers/video/backlight/adp8870_bl.c:811:11: warning: 'reg_val' may be used uninitialized in this function

    This changes the code to only write back the data if it was
    correctly read to start with.

    As a side-note, the drivers are mostly identical, so I think they
    should really be merged into one file to avoid having to fix every
    bug twice.

    Signed-off-by: Arnd Bergmann
    Acked-by: Michael Hennerich
    Signed-off-by: Lee Jones

    Arnd Bergmann
     

07 Nov, 2015

1 commit

  • Pull backlight updates from Lee Jones:
    "New Device Support
    - None

    New Functionality:
    - None

    Core Frameworks:
    - Reject legacy PWM request for device defined in DT

    Fix-ups:
    - Remove unnecessary MODULE_ALIAS(); adp8860_bl, adp8870_bl
    - Simplify code: pm8941-wled
    - Supply default-brightness logic; pm8941-wled

    Bug Fixes:
    - Clean up OF node; 88pm860x_bl
    - Ensure struct is zeroed; lp855x_bl"

    * tag 'backlight-for-linus-4.4' of git://git.kernel.org/pub/scm/linux/kernel/git/lee/backlight:
    backlight: pm8941-wled: Add default-brightness property
    backlight: pm8941-wled: Fix ptr_ret.cocci warnings
    backlight: pwm: Reject legacy PWM request for device defined in DT
    backlight: 88pm860x_bl: Add missing of_node_put
    backlight: adp8870: Remove unnecessary MODULE_ALIAS()
    backlight: adp8860: Remove unnecessary MODULE_ALIAS()
    backlight: lp855x: Make sure props struct is zeroed

    Linus Torvalds
     

31 Oct, 2015

1 commit


28 Oct, 2015

1 commit


27 Oct, 2015

1 commit


15 Oct, 2015

2 commits

  • Platform PWM backlight data provided by board's device tree should be
    complete enough to successfully request a pwm device using pwm_get()
    API. This change fixes a bug, when an arbitrary (first found) PWM is
    connected to a "pwm-backlight" compatible device, when explicit PWM
    device reference is not given.

    Documentation/devicetree/bindings/video/backlight/pwm-backlight.txt
    already describes "pwms" as a required property, instead of blind
    selection of a potentially wrong PWM reject legacy PWM device
    registration request, leave legacy API only for non-dt cases.

    Based on initial implementation done by Dmitry Eremin-Solenikov.

    Reported-by: Dmitry Eremin-Solenikov
    Signed-off-by: Vladimir Zapolskiy
    Acked-by: Thierry Reding
    Acked-by: Nicolas Ferre
    Tested-by: Robert Jarzmik
    Signed-off-by: Lee Jones

    Vladimir Zapolskiy
     
  • for_each_child_of_node performs an of_node_get on each iteration, so
    a break out of the loop requires an of_node_put.

    The semantic patch that fixes this problem is as follows
    (http://coccinelle.lip6.fr):

    //
    @@
    expression root,e;
    local idexpression child;
    iterator name for_each_child_of_node;
    @@

    for_each_child_of_node(root, child) {
    ... when != of_node_put(child)
    when != e = child
    + of_node_put(child);
    ? break;
    ...
    }
    ... when != child
    //

    Signed-off-by: Julia Lawall
    Signed-off-by: Lee Jones

    Julia Lawall
     

05 Oct, 2015

3 commits


25 Aug, 2015

5 commits

  • The I2C core always reports the MODALIAS uevent as "i2c:"
    regardless of the mechanism that was used to register the device
    (i.e: OF or board code) and the table that is used later to match
    the driver with the device (i.e: I2C id table or OF match table).

    So drivers needs to export the I2C id table and this be built into
    the module or udev won't have the necessary information to autoload
    the needed driver module when the device is added.

    Signed-off-by: Javier Martinez Canillas
    Signed-off-by: Lee Jones

    Javier Martinez Canillas
     
  • The backlight_device_unregister() function tests whether its argument
    is NULL and then returns immediately. Thus the test around the call is
    not needed.

    This issue was detected by using the Coccinelle software.

    Signed-off-by: Markus Elfring
    Acked-by: Jingoo Han
    Signed-off-by: Lee Jones

    Markus Elfring
     
  • IS_ERR_VALUE() makes sense only *if* there could be valid values in
    negative error range.

    Signed-off-by: Axel Lin
    Signed-off-by: Lee Jones

    Axel Lin
     
  • The Qualcomm PM8941 WLED block is used for backlight and should therefor
    be in the backlight framework and not in the LED framework. This moves
    the driver and adapts to the backlight api instead.

    Signed-off-by: Bjorn Andersson
    Tested-by: Rob Clark
    Acked-by: Jacek Anaszewski
    Acked-by: Jingoo Han
    Signed-off-by: Lee Jones

    Bjorn Andersson
     
  • LP855x backlight device can be enabled by external VDD input. The
    'supply' data is used for this purpose. It's kind of private data
    which runs internally, so there is no reason to expose to the
    platform data.

    And devm_regulator_get() is moved from _parse_dt() to _probe().
    Regulator consumer(lp855x) can control regulator not only from DT
    but also from platform data configuration in a source file such
    like board-*.c.

    Signed-off-by: Milo Kim
    Acked-by: Sean Paul
    Acked-by: Jingoo Han
    Signed-off-by: Lee Jones

    Milo Kim
     

25 Jun, 2015

1 commit

  • Pull backlight updates from Lee Jones:
    "Changes to existing drivers:

    - supply MODULE_DEVICE_TABLE() to ensure probing
    - constify struct; da9052_bl
    - enable compile test; lcd_l4f00242t03, lcd_lms283fg05, backlight_gpio
    - suspend/resume bugfix; lp855x_bl
    - devm_gpiod_get_optional() API fixup; pwm_bl
    - error handling fixup; backlight"

    * tag 'backlight-for-linus-4.2' of git://git.kernel.org/pub/scm/linux/kernel/git/lee/backlight:
    backlight: Change the return type of backlight_update_status() to int
    backlight: pwm_bl: Simplify usage of devm_gpiod_get_optional
    backlight: lp855x: Don't clear level on suspend/blank
    backlight: Allow compile test of GPIO consumers if !GPIOLIB
    video: backlight: da9052: Constify platform_device_id
    gpio-backlight: Discover driver during boot time

    Linus Torvalds
     

23 Jun, 2015

5 commits


26 May, 2015

1 commit


15 Apr, 2015

1 commit


09 Apr, 2015

1 commit