20 Jul, 2016

1 commit


20 May, 2016

1 commit

  • This fix alters the ordering of the IRQ and device registrations in the RTC
    driver probe function. This change will apply to the RTC driver that supports
    both DA9052 and DA9053 PMICs.

    A problem could occur with the existing RTC driver if:

    A system is started from a cold boot using the PMIC RTC IRQ to initiate a
    power on operation. For instance, if an RTC alarm is used to start a
    platform from power off.
    The existing driver IRQ is requested before the device has been properly
    registered.

    i.e.
    ret = da9052_request_irq()
    comes before
    rtc->rtc = devm_rtc_device_register();

    In this case, an interrupt exists before the device has been registered and
    the IRQ handler can be called immediately: this can happen be before the
    memory for rtc->rtc has been allocated. The IRQ handler da9052_rtc_irq()
    contains the function call:

    rtc_update_irq(rtc->rtc, 1, RTC_IRQF | RTC_AF);

    which in turn tries to access the unavailable rtc->rtc.

    The fix is to reorder the functions inside the RTC probe. The IRQ is
    requested after the RTC device resource has been registered so that
    da9052_request_irq() is the last thing to happen.

    Signed-off-by: Steve Twiss
    Signed-off-by: Alexandre Belloni

    Steve Twiss
     

17 Apr, 2015

3 commits


20 Oct, 2014

1 commit


07 Jun, 2014

1 commit

  • Setting the alarm to a time not on a minute boundary results in repeated
    interrupts being generated by the DA9052/3 PMIC device until the kernel
    RTC core sees that the alarm has rung. Sometimes the number and frequency
    of interrupts can cause the kernel to disable the IRQ line used by the
    DA9052/3 PMIC with disasterous consequences. This patch fixes the
    problem.

    Even though the DA9052/3 PMIC is capable generating periodic interrupts,
    ie TICKS, the method used to distinguish RTC_AF from RTC_PF events was
    flawed and can not work in conjunction with the regmap_irq kernel core.
    Thus that flawed detection has also been removed by the DA9052/3 PMIC RTC
    driver's irq handler, so that it no longer reports the wrong type of event
    to the kernel RTC core.

    The internal static functions within the DA9052/3 PMIC RTC driver have
    been changed to pass the 'da9052_rtc' structure instead of the 'da9052'
    because there is no backwards pointer from the 'da9052' structure.

    This patch fixes the three issues described above. The first is serious
    because usiing the RTC alarm set to a non minute boundary will eventually
    cause all component drivers that depend on the interrupt line to fail.
    The solution adopted is to round up to alarm time to the next highest
    minute.

    The second bug, reporting a RTC_PF event instead of an RTC_AF event turns
    out to not matter with the current implementation of the kernel RTC core
    as it seems to ignore the event type. However, should that change in the
    future it is better to fix the issue now and not have 'problems waiting to
    happen'

    The third set of changes are to make the da9052_rtc structure available to
    all the local internal functions in the driver. This was done during
    testing so that diagnostic data could be stored there. Should the
    solution to the first issue be found not acceptable, then the alternative
    of using the TICKS interrupt at the fixed one second interval in order to
    step to the exact second of the requested alarm requires an extra (alarm
    time) piece of data to be stored. In devices that use the alarm function
    to wake up from sleep, accuracy to the second will result in the device
    being awake for up to nearly a minute longer than expected.

    Signed-off-by: Anthony Olech
    Cc: David Dajun Chen
    Cc: Alessandro Zummo
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Anthony Olech
     

04 Apr, 2014

1 commit


16 Jul, 2013

1 commit


04 Jul, 2013

3 commits


30 Apr, 2013

1 commit


23 Mar, 2013

1 commit


22 Feb, 2013

1 commit


04 Jan, 2013

1 commit

  • CONFIG_HOTPLUG is going away as an option. As a result, the __dev*
    markings need to be removed.

    This change removes the use of __devinit, __devexit_p, __devinitdata,
    __devinitconst, and __devexit from these drivers.

    Based on patches originally written by Bill Pemberton, but redone by me
    in order to handle some of the coding style issues better, by hand.

    Cc: Bill Pemberton
    Cc: Alessandro Zummo
    Cc: Srinidhi Kasagar
    Cc: Linus Walleij
    Cc: Mike Frysinger
    Cc: Wan ZongShun
    Cc: Guan Xuetao
    Cc: Mark Brown
    Signed-off-by: Greg Kroah-Hartman

    Greg Kroah-Hartman
     

31 Jul, 2012

1 commit


24 Mar, 2012

1 commit

  • RTC Driver for Dialog Semiconductor DA9052/53 PMICs.

    This patch is functionally tested on Samsung SMDKV6410.

    [akpm@linux-foundation.org: clean up file header layout, remove unneeded initialisation of local arrays]
    Signed-off-by: David Dajun Chen
    Signed-off-by: Ashish Jangam
    Cc: Paul Gortmaker
    Cc: David Dajun Chen
    Cc: Samuel Ortiz
    Cc: Alessandro Zummo
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Ashish Jangam