1. 09 5月, 2017 1 次提交
  2. 04 1月, 2016 1 次提交
  3. 28 8月, 2015 1 次提交
    • M
      leds:lp55xx: use the private data instead of updating I2C device platform data · ed133352
      Milo Kim 提交于
      Currently, lp55xx_of_populate_pdata() allocates lp55xx_platform_data if
      it's null. And it parses the DT and copies values into the
      'client->dev.platform_data'. This may have architectural issue.
      Platform data is configurable through the DT or I2C board info inside the
      platform area. However, lp55xx common driver changes this configuration
      when it is loaded. So 'client->dev.platform_data' is not null anymore.
      Eventually, the driver initialization is not identical when it's unloaded
      and loaded again.
      The lp55xx common driver should use the private data, 'lp55xx_chip->pdata'
      instead of changing the original platform data.
      
      So, lp55xx_of_populate_pdata() is modified as follows.
      * Do not update 'dev->platform_data'. Return the pointer of new allocated
         lp55xx_platform_data. Then the driver points it to private data,
         'lp55xx_chip->pdata'.
      * Each lp55xx driver checks the pointer and handles an error case.
      
      Then, original platform data configuration will be kept regardless of
      loading or unloading the driver.
      The driver allocates the memory and copies them from the DT if it's NULL.
      After the driver is loaded again, 'client->dev.platform_data' is same as
      initial load, so the driver is initialized identically.
      
      Cc: Toshi Kikuchi <toshik@chromium.org>
      Cc: linux-leds@vger.kernel.org
      Signed-off-by: NMilo Kim <milo.kim@ti.com>
      Signed-off-by: NJacek Anaszewski <j.anaszewski@samsung.com>
      ed133352
  4. 28 2月, 2014 1 次提交
  5. 28 1月, 2014 1 次提交
    • M
      leds: lp5521/5523: Fix multiple engine usage bug · 28c9266b
      Milo Kim 提交于
      Whenever the engine is loaded by the user-application, the operation mode is
      reset first. But it has a problem in case of multiple engine used because
      previous engine settings are cleared.
      The driver should update not whole 8bits but each engine bit by masking.
      
      On the other hands, whole engines should be reset when the driver is unloaded
      and on initializing the LP5523 driver.
      So, new functions are used for this handling - lp5521/5523_stop_all_engines().
      
      Cc: Pali Rohár <pali.rohar@gmail.com>
      Signed-off-by: NMilo Kim <milo.kim@ti.com>
      Signed-off-by: NBryan Wu <cooloney@gmail.com>
      28c9266b
  6. 11 1月, 2014 1 次提交
  7. 27 8月, 2013 3 次提交
    • M
      leds: lp5521: remove unnecessary writing commands · 1eca0b3a
      Milo Kim 提交于
      This patch reduces the number of programming commands.
      
      (Count of sending commands)
      Old code: 32 + program size (32 counts for clearing program memory)
      New code: 32
      
      Pattern buffer is initialized to 0 in this function.
      Just update new program data and remaining buffers are filled with 0.
      So it's needless to clear whole area.
      Signed-off-by: NMilo Kim <milo.kim@ti.com>
      Signed-off-by: NBryan Wu <cooloney@gmail.com>
      1eca0b3a
    • M
      leds: lp5521: restore legacy device attributes · c0e5e9b5
      Milo Kim 提交于
      git commit 9ce7cb17
      may cause an application confict, engineN_mode and engineN_load.
      This interface should be maintained for compatibility.
      
      Restored device attributes are 'engineN_mode' and 'engineN_load'.
      A 'selftest' attribute macro is replaced with LP55xx common macro.
      
      Use a mutex in lp5521_update_program_memory()
      : This function is called when an user-application writes a 'engineN_load' file
      or pattern data is loaded from generic firmware interface.
      So, writing program memory should be protected.
      If an error occurs on accessing this area, just it returns as -EINVAL quickly.
      This error code is exact same as old driver function, lp5521_do_store_load()
      because it should be kept for an user-application compatibility.
      Even the driver is changed, we can use the application without re-compiling
      sources.
      
      'led_pattern' attribute is not included
      : engineN_mode and _load were created for custom user-application.
      'led_pattern' is an exception. I added this attribute not for custom application
      but for simple test. Now it is used only in LP5562 driver, not LP5521.
      Signed-off-by: NMilo Kim <milo.kim@ti.com>
      Signed-off-by: NBryan Wu <cooloney@gmail.com>
      c0e5e9b5
    • J
      leds: use dev_get_platdata() · 87aae1ea
      Jingoo Han 提交于
      Use the wrapper function for retrieving the platform data instead of
      accessing dev->platform_data directly.
      Signed-off-by: NJingoo Han <jg1.han@samsung.com>
      Signed-off-by: NBryan Wu <cooloney@gmail.com>
      87aae1ea
  8. 21 6月, 2013 2 次提交
  9. 02 4月, 2013 2 次提交
    • K
      leds: lp55xx: configure the clock detection · 81f2a5b4
      Kim, Milo 提交于
      Now LP55xx provides automatic clock detection API, lp55xx_is_extclk_used().
      The clock configuration can be done by the driver itself.
      
      (a) Concept
      The default value is set by each driver with clock selection.
      The internal clock selection bit is updated in case that the external clock
      is not detected or clock rate is not 32KHz.
      
      (b) Change on LP55xx platform data
      The clock configuration is done automatically, so no need to define
      'update_config' in the platform side.
      Correlated information are removed in the documentations and header.
      
      (c) Definitions moved from header to driver files
      CONFIG register values are moved each driver, LP5521 and LP5562.
      Not necessary definitions are removed also.
      Signed-off-by: NMilo(Woogyom) Kim <milo.kim@ti.com>
      Signed-off-by: NBryan Wu <cooloney@gmail.com>
      81f2a5b4
    • K
      leds: lp55xx: fix the sysfs read operation · 24d32128
      Kim, Milo 提交于
      According to a sysfs documentation(Documentation/filesystem/sysfs.txt),
      scnprintf() should be used in a read operation method.
      It guarantees safe buffer size(PAGE_SIZE) which is allocated by the sysfs.
      Signed-off-by: NMilo(Woogyom) Kim <milo.kim@ti.com>
      Signed-off-by: NBryan Wu <cooloney@gmail.com>
      24d32128
  10. 07 2月, 2013 27 次提交