30 May, 2012

1 commit

  • The leds timer trigger does not currently have an interface to activate a
    one shot timer. The current support allows for setting two timers, one
    for specifying how long a state to be on, and the second for how long the
    state to be off. The delay_on value specifies the time period an LED
    should stay in on state, followed by a delay_off value that specifies how
    long the LED should stay in off state. The on and off cycle repeats until
    the trigger gets deactivated. There is no provision for one time
    activation to implement features that require an on or off state to be
    held just once and then stay in the original state forever.

    Without one shot timer interface, user space can still use timer trigger
    to set a timer to hold a state, however when user space application
    crashes or goes away without deactivating the timer, the hardware will be
    left in that state permanently.

    As a specific example of this use-case, let's look at vibrate feature on
    phones. Vibrate function on phones is implemented using PWM pins on SoC
    or PMIC. There is a need to activate one shot timer to control the
    vibrate feature, to prevent user space crashes leaving the phone in
    vibrate mode permanently causing the battery to drain.

    This trigger exports three properties, activate, state, and duration When
    transient trigger is activated these properties are set to default values.

    - duration allows setting timer value in msecs. The initial value is 0.
    - activate allows activating and deactivating the timer specified by
    duration as needed. The initial and default value is 0. This will allow
    duration to be set after trigger activation.
    - state allows user to specify a transient state to be held for the specified
    duration.

    Signed-off-by: Shuah Khan
    Cc: Jonas Bonn
    Cc: Richard Purdie
    Cc: NeilBrown
    Cc: Bryan Wu
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Shuah Khan
     

24 Mar, 2012

3 commits

  • The lp5521 has autonomous operation mode without external control.
    Using lp5521_platform_data, various led patterns can be configurable.
    For supporting this feature, new functions and device attribute are
    added.

    Structure of lp5521_led_pattern: 3 channels are supported - red, green
    and blue. Pattern(s) of each channel and numbers of pattern(s) are
    defined in the pla= tform data. Pattern data are hexa codes which
    include pattern commands such like set pwm, wait, ramp up/down, branch
    and so on.

    Pattern mode functions:
    * lp5521_clear_program_memory
    Before running new led pattern, program memory should be cleared.
    * lp5521_write_program_memory
    Pattern data updated in the program memory via the i2c.
    * lp5521_get_pattern
    Get pattern from predefined in the platform data.
    * lp5521_run_led_pattern
    Stop current pattern or run new pattern.
    Transition time is required between different operation mode.

    Device attribute - 'led_pattern': To load specific led pattern, new device
    attribute is added.

    When the lp5521 driver is unloaded, stop current led pattern mode.

    Documentation updated : description about how to define the led patterns
    and example.

    [akpm@linux-foundation.org: checkpatch fixes]
    Signed-off-by: Milo(Woogyom) Kim
    Acked-by: Linus Walleij
    Cc: Arun MURTHY
    Cc: Srinidhi Kasagar
    Cc: Richard Purdie
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Kim, Milo
     
  • The value of CONFIG register(Addr 08h) is configurable. For supporting
    this feature, update_config is added in the platform data. If
    'update_config' is not defined, the default value is 'LP5521_PWRSAVE_EN |
    LP5521_CP_MODE_AUTO | LP5521_R_TO_BATT'.

    To define CONFIG register in the platform data, the bit definitions were
    mo= ved to the header file.

    Documentation updated : description about 'update_config' and example.

    Signed-off-by: Milo(Woogyom) Kim
    Acked-by: Linus Walleij
    Cc: Arun MURTHY
    Cc: Srinidhi Kasagar
    Cc: Richard Purdie
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Kim, Milo
     
  • The name of each led channel can be configurable. For the compatibility,
    the name is set to default value(xx:channelN) when 'name' is not defined.

    Signed-off-by: Milo(Woogyom) Kim
    Acked-by: Linus Walleij
    Cc: Arun MURTHY
    Cc: Srinidhi Kasagar
    Cc: Richard Purdie
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Kim, Milo
     

05 Nov, 2011

1 commit


05 Apr, 2011

1 commit


12 Nov, 2010

1 commit