12 Sep, 2013

14 commits

  • Convert the composition of devm_request_mem_region and devm_ioremap to a
    single call to devm_ioremap_resource. The associated call to
    platform_get_resource is also simplified and moved next to the new call
    to devm_ioremap_resource.

    This was done using a combination of the semantic patches
    devm_ioremap_resource.cocci and devm_request_and_ioremap.cocci, found in
    the scripts/coccinelle/api directory.

    In rtc-lpc32xx.c and rtc-mv.c, the local variable size is no longer needed.

    In rtc-ds1511.c the size field of the local structure is not useful any
    more, and is deleted.

    Signed-off-by: Julia Lawall
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Julia Lawall
     
  • Let RTC core decide if the retrieved time is invalid, instead of
    processing errors in the driver.

    Signed-off-by: Alexander Shiyan
    Cc: Jingoo Han
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Alexander Shiyan
     
  • Private field "rtc" is not used outside "probe", so there is no reason to
    keep it.

    Signed-off-by: Alexander Shiyan
    Cc: Jingoo Han
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Alexander Shiyan
     
  • Replace devm_request_mem_region() and devm_ioremap() with
    devm_ioremap_resource().

    Signed-off-by: Alexander Shiyan
    Cc: Jingoo Han
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Alexander Shiyan
     
  • enable_irq_wake() might fail, if so, we will see kernel warning in resume
    entries due to it always calls disable_irq_wake().

    WARNING: at kernel/irq/manage.c:529 irq_set_irq_wake+0xc4/0xf0()
    Unbalanced IRQ 52 wake disable
    Modules linked in: ipv6 libcomposite configfs
    CPU: 0 PID: 1591 Comm: ash Tainted: G W 3.10.0-00854-gdbd86d4-dirty #100
    (unwind_backtrace+0x0/0xf8) from (show_stack+0x10/0x14)
    (show_stack+0x10/0x14) from (warn_slowpath_common+0x54/0x68)
    (warn_slowpath_common+0x54/0x68) from (warn_slowpath_fmt+0x30/0x40)
    (warn_slowpath_fmt+0x30/0x40) from (irq_set_irq_wake+0xc4/0xf0)
    (irq_set_irq_wake+0xc4/0xf0) from (sirfsoc_rtc_restore+0x30/0x38)
    (sirfsoc_rtc_restore+0x30/0x38) from (platform_pm_restore+0x2c/0x50)
    (platform_pm_restore+0x2c/0x50) from (dpm_run_callback.clone.6+0x30/0xb0)
    (dpm_run_callback.clone.6+0x30/0xb0) from (device_resume+0x88/0x134)
    (device_resume+0x88/0x134) from (dpm_resume+0x114/0x230)
    (dpm_resume+0x114/0x230) from (hibernation_snapshot+0x178/0x1d0)
    (hibernation_snapshot+0x178/0x1d0) from (hibernate+0x130/0x1dc)
    (hibernate+0x130/0x1dc) from (state_store+0xb4/0xc0)
    (state_store+0xb4/0xc0) from (kobj_attr_store+0x14/0x20)
    (kobj_attr_store+0x14/0x20) from (sysfs_write_file+0xfc/0x17c)
    (sysfs_write_file+0xfc/0x17c) from (vfs_write+0xc8/0x194)
    (vfs_write+0xc8/0x194) from (SyS_write+0x40/0x6c)
    (SyS_write+0x40/0x6c) from (ret_fast_syscall+0x0/0x30)

    To avoid unbalanced "IRQ wake disable", ensure that disable_irq_wake() is
    called only when enable_irq_wake() have been successfully enabled.

    Signed-off-by: Xianglong Du
    Signed-off-by: Barry Song
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Xianglong Du
     
  • check_rtc_access_enable() returns pointer, thus NULL should be used
    instead of 0 in order to fix the following sparse warning:

    drivers/rtc/rtc-nuc900.c:102:16: warning: Using plain integer as NULL pointer

    Signed-off-by: Jingoo Han
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Jingoo Han
     
  • Fix a read of the wrong register when checking whether the RTC timer has
    reached the alarm time.

    Signed-off-by: Sangjung Woo
    Signed-off-by: Myugnjoo Ham
    Reviewed-by: Jonghwa Lee
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Sangjung Woo
     
  • Stop processing hid input when registering the RTC fails and handle a NULL
    returned from devm_rtc_device_register() as a failure too.

    Signed-off-by: Alexander Holler
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Alexander Holler
     
  • Palmas series device like TPS65913, TPS80036 supports the backup battery
    for powering the RTC when no other energy source is available.

    The backup battery is optional, connected to the VBACKUP pin, and can be
    nonrechargeable or rechargeable. The rechargeable battery can be charged
    from the system supply using the backup battery charger.

    Add support for enabling charging of this backup battery. Also add the DT
    binding document and the new properties to have this support.

    Signed-off-by: Laxman Dewangan
    Reviewed-by: Felipe Balbi
    Acked-by: Kumar Gala
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Laxman Dewangan
     
  • On some platforms (like AM33xx), a special register (RTC_IRQWAKEEN) is
    available to enable Alarm Wakeup feature. This register needs to be
    properly handled for the rtcwake to work properly.

    Platforms using such IP should set "ti,am3352-rtc" in rtc device dt
    compatibility node.

    Signed-off-by: Hebbar Gururaja
    Acked-by: Kevin Hilman
    Acked-by: Sekhar Nori
    Cc: Grant Likely
    Cc: Rob Herring
    Cc: Rob Landley
    Cc: Alessandro Zummo
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Hebbar Gururaja
     
  • Add RTC driver for MOXA ART SoCs.

    Signed-off-by: Jonas Jensen
    Reviewed-by: Mark Brown
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Jonas Jensen
     
  • The 'remove' function is empty and does not do anything. Delete it.

    Signed-off-by: Sachin Kamat
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Sachin Kamat
     
  • In order to get the module automatically loaded by hotplug mechanisms a
    MODULE_DEVICE_TABLE is needed.

    Therefore add one.

    This makes it also possible to use a module name other than
    HID-SENSOR-2000a0 which isn't very descriptive in kernel messages.

    Signed-off-by: Alexander Holler
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Alexander Holler
     
  • Convert drivers/rtc/rtc-cmos to use dev_pm_ops instead of legacy pm_ops.
    This patch depends on pnp driver bus ops change to invoke pnp_driver
    dev_pm_ops.

    Signed-off-by: Shuah Khan
    Cc: Matthew Garrett
    Cc: Leonidas Da Silva Barbosa
    Cc: Ashley Lai
    Cc: Rajiv Andrade
    Cc: Marcel Selhorst
    Cc: Sirrix AG
    Cc: Alessandro Zummo
    Cc: "Rafael J. Wysocki"
    Cc: Bjorn Helgaas
    Cc: Grant Likely
    Cc: Rob Herring
    Cc: Peter Hüwe
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Shuah Khan
     

05 Sep, 2013

1 commit

  • Pull PTR_RET() removal patches from Rusty Russell:
    "PTR_RET() is a weird name, and led to some confusing usage. We ended
    up with PTR_ERR_OR_ZERO(), and replacing or fixing all the usages.

    This has been sitting in linux-next for a whole cycle"

    [ There are still some PTR_RET users scattered about, with some of them
    possibly being new, but most of them existing in Rusty's tree too. We
    have that

    #define PTR_RET(p) PTR_ERR_OR_ZERO(p)

    thing in , so they continue to work for now - Linus ]

    * tag 'PTR_RET-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/rusty/linux:
    GFS2: Replace PTR_RET with PTR_ERR_OR_ZERO
    Btrfs: volume: Replace PTR_RET with PTR_ERR_OR_ZERO
    drm/cma: Replace PTR_RET with PTR_ERR_OR_ZERO
    sh_veu: Replace PTR_RET with PTR_ERR_OR_ZERO
    dma-buf: Replace PTR_RET with PTR_ERR_OR_ZERO
    drivers/rtc: Replace PTR_RET with PTR_ERR_OR_ZERO
    mm/oom_kill: remove weird use of ERR_PTR()/PTR_ERR().
    staging/zcache: don't use PTR_RET().
    remoteproc: don't use PTR_RET().
    pinctrl: don't use PTR_RET().
    acpi: Replace weird use of PTR_RET.
    s390: Replace weird use of PTR_RET.
    PTR_RET is now PTR_ERR_OR_ZERO(): Replace most.
    PTR_RET is now PTR_ERR_OR_ZERO

    Linus Torvalds
     

04 Sep, 2013

1 commit

  • Pull driver core patches from Greg KH:
    "Here's the big driver core pull request for 3.12-rc1.

    Lots of tiny changes here fixing up the way sysfs attributes are
    created, to try to make drivers simpler, and fix a whole class race
    conditions with creations of device attributes after the device was
    announced to userspace.

    All the various pieces are acked by the different subsystem
    maintainers"

    * tag 'driver-core-3.12-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/driver-core: (119 commits)
    firmware loader: fix pending_fw_head list corruption
    drivers/base/memory.c: introduce help macro to_memory_block
    dynamic debug: line queries failing due to uninitialized local variable
    sysfs: sysfs_create_groups returns a value.
    debugfs: provide debugfs_create_x64() when disabled
    rbd: convert bus code to use bus_groups
    firmware: dcdbas: use binary attribute groups
    sysfs: add sysfs_create/remove_groups for when SYSFS is not enabled
    driver core: add #include to core files.
    HID: convert bus code to use dev_groups
    Input: serio: convert bus code to use drv_groups
    Input: gameport: convert bus code to use drv_groups
    driver core: firmware: use __ATTR_RW()
    driver core: core: use DEVICE_ATTR_RO
    driver core: bus: use DRIVER_ATTR_WO()
    driver core: create write-only attribute macros for devices and drivers
    sysfs: create __ATTR_WO()
    driver-core: platform: convert bus code to use dev_groups
    workqueue: convert bus code to use dev_groups
    MEI: convert bus code to use dev_groups
    ...

    Linus Torvalds
     

14 Aug, 2013

1 commit


01 Aug, 2013

1 commit


30 Jul, 2013

1 commit


16 Jul, 2013

1 commit


11 Jul, 2013

1 commit

  • Pull MFD update from Samuel Ortiz:
    "For the 3.11 merge we only have one new MFD driver for the Kontron
    PLD.

    But we also have:
    - Support for the TPS659038 PMIC from the palmas driver.
    - Intel's Coleto Creek and Avoton SoCs support from the lpc_ich
    driver.
    - RTL8411B support from the rtsx driver.
    - More DT support for the Arizona, max8998, twl4030-power and the
    ti_am335x_tsadc drivers.
    - The SSBI driver move under MFD.
    - A conversion to the devm_* API for most of the MFD drivers.
    - The twl4030-power got split from twl-core into its own module.
    - A major ti_am335x_adc cleanup, leading to a proper DT support.
    - Our regular arizona and wm* updates and cleanups from the Wolfson
    folks.
    - A better error handling and initialization, and a regulator
    subdevice addition for the 88pm80x driver.
    - A bulk platform_set_drvdata() call removal that's no longer need
    since commit 0998d0631001 ("device-core: Ensure drvdata = NULL when
    no driver is bound")

    * tag 'mfd-3.11-1' of git://git.kernel.org/pub/scm/linux/kernel/git/sameo/mfd-next: (102 commits)
    mfd: sec: Provide max_register to regmap
    mfd: wm8994: Remove duplicate check for active JACKDET
    MAINTAINERS: Add include directory to MFD file patterns
    mfd: sec: Remove fields not used since regmap conversion
    watchdog: Kontron PLD watchdog timer driver
    mfd: max8998: Add support for Device Tree
    regulator: max8998: Use arrays for specifying voltages in platform data
    mfd: max8998: Add irq domain support
    regulator: palmas: Add TPS659038 support
    mfd: Kontron PLD mfd driver
    mfd: palmas: Add TPS659038 PMIC support
    mfd: palmas: Add SMPS10_BOOST feature
    mfd: palmas: Check if irq is valid
    mfd: lpc_ich: iTCO_wdt patch for Intel Coleto Creek DeviceIDs
    mfd: twl-core: Change TWL6025 references to TWL6032
    mfd: davinci_voicecodec: Fix build breakage
    mfd: vexpress: Make the driver optional for arm and arm64
    mfd: htc-egpio: Use devm_ioremap_nocache() instead of ioremap_nocache()
    mfd: davinci_voicecodec: Convert to use devm_* APIs
    mfd: twl4030-power: Fix relocking on error
    ...

    Linus Torvalds
     

10 Jul, 2013

1 commit


04 Jul, 2013

18 commits

  • On CSR SiRFprimaII/atlasVI, there is a programmable 16-bit divider
    (RTC_DIV) that divides the input 32.768KHz clock to the frequency that
    users need (E.g. 1 Hz). The divided real-time clock will be used to
    drive a 32-bit counter (RTC_COUNTER) that provides users with the actual
    time.

    In each cycle of the divided real-time clock, there is a Hertz interrupt
    generated to the RISC. Users can also configure an alarm (RTC_ALARM).
    When RTC_COUNTER matches the alarm, there will be an alarm interrupt
    generated to the RISC.

    The system RTC can generate an alarm wake-up signal to notify the power
    controller to wake up from power saving mode.

    Signed-off-by: Xianglong Du
    Signed-off-by: Barry Song
    Cc: Jingoo Han
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Xianglong Du
     
  • Use module_platform_driver_probe() macro which makes the code smaller and
    simpler.

    Signed-off-by: Fabio Porcedda
    Cc: Alessandro Zummo
    Cc: Jingoo Han
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Fabio Porcedda
     
  • rtc-omap driver modules is used both by OMAP1/2, Davinci SoC platforms.

    However, rtc wake support on OMAP1 is broken. Hence the
    device_init_wakeup() was removed from rtc-omap driver and moved to
    platform board files that supported it (DA850/OMAP-L138). [1]

    However, recently [2] it was suggested that driver should always do a
    device_init_wakeup(dev, true). Platforms that don't want/need
    wakeup support can disable it from userspace via:

    echo disabled > /sys/devices/.../power/wakeup

    Also, with the new DT boot-up, board file doesn't exist and hence there
    is no way to have device wakeup support rtc.

    The fix for above issues, is to hard code device_init_wakeup() inside
    driver and let platforms that don't need this, handle it through the
    sysfs power entry.

    [1]
    https://patchwork.kernel.org/patch/136731/

    [2]
    http://www.mail-archive.com/davinci-linux-open-source@linux.
    davincidsp.com/msg26077.html

    Signed-off-by: Hebbar Gururaja
    Cc: Alessandro Zummo
    Acked-by: Kevin Hilman
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Hebbar Gururaja
     
  • Added support for NXP PCF2127 RTC (i2c).

    [akpm@linux-foundation.org: fix typo, fix warnings]
    Signed-off-by: Renaud Cerrato
    Cc: Jingoo Han
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Renaud Cerrato
     
  • Enable dev as wakeup device before calling rtc_device_register(), so that
    it can create the "wakealarm" sysfs.

    Signed-off-by: Wei Ni
    Acked-by: Laxman Dewangan
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Wei Ni
     
  • Convert drivers/rtc/class to use dev_pm_ops for power management and
    remove Legacy PM ops hooks. With this change, rtc class registers
    suspend/resume callbacks via class->pm (dev_pm_ops) instead of Legacy
    class->suspend/resume. When __device_suspend() runs call-backs, it will
    find class->pm ops for the rtc class.

    Signed-off-by: Shuah Khan
    Signed-off-by: Jingoo Han
    Cc: Shuah Khan
    Cc: Alessandro Zummo
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Shuah Khan
     
  • The usage of strict_strtoul() is not preferred, because strict_strtoul()
    is obsolete. Thus, kstrtoul() should be used.

    Signed-off-by: Jingoo Han
    Reviewed-by: Andy Shevchenko
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Jingoo Han
     
  • If rtc->irq_task is non-NULL and task is NULL, they always
    rtc_irq_set_freq(), whenever err is set to -EBUSY it will then immediately
    be set to -EACCES, misleading the caller as to the underlying problem.

    Signed-off-by: Chris Brand
    Acked-by: Alessandro Zummo
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Chris Brand
     
  • Use module_platform_driver() to register the platform driver.

    Signed-off-by: Peter Ujfalusi
    Acked-by: Kevin Hilman
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Peter Ujfalusi
     
  • Initialize the rtc_reg_map in platform_driver's probe function instead at
    module_init time. This way we can make sure that the twl-core has been
    already probed and initialized (twl_priv->twl_id is valid) since the
    platform device for the RTC driver will be created by the twl-core after
    it finished its init.

    Reported-by: Christoph Fritz
    Signed-off-by: Peter Ujfalusi
    Tested-by: Kevin Hilman
    Tested-by: Grygorii Strashko
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Peter Ujfalusi
     
  • The bios may clear the rtc control register when resuming the system. Since the
    cmos interrupt handler may now be run before the rtc_cmos is resumed, this can
    cause the interrupt handler to ignore an alarm since the alarm bit is not set in
    the rtc control register. To work around this, check if the rtc_cmos is
    suspended and use the stored value for the rtc control register.

    Signed-off-by: Derek Basehore
    Reviewed-by: Sameer Nanda
    Cc: Alessandro Zummo
    Cc: Jingoo Han
    Cc: Steven Rostedt
    Cc: John Stultz
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Derek Basehore
     
  • Currently, the RTC IRQ is never wakeup-enabled so is not capable of
    bringing the system out of suspend.

    On OMAP platforms, we have gotten by without this because the TWL RTC is
    on an I2C-connected chip which is capable of waking up the OMAP via the IO
    ring when the OMAP is in low-power states.

    However, if the OMAP suspends without hitting the low-power states (and
    the IO ring is not enabled), RTC wakeups will not work because the IRQ is
    not wakeup enabled.

    To fix, ensure the RTC IRQ is wakeup enabled whenever the RTC alarm is
    set.

    Signed-off-by: Kevin Hilman
    Cc: Alessandro Zummo
    Cc: Tony Lindgren
    Cc: Grygorii Strashko
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Kevin Hilman
     
  • Use of PTR_RET() simplifies the code.

    Signed-off-by: Sachin Kamat
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Sachin Kamat
     
  • Use of PTR_RET() simplifies the code.

    Signed-off-by: Sachin Kamat
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Sachin Kamat
     
  • Use of PTR_RET() simplifies the code.

    Signed-off-by: Sachin Kamat
    Cc: Thomas Bogendoerfer
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Sachin Kamat
     
  • Use of PTR_RET() simplifies the code.

    Signed-off-by: Sachin Kamat
    Cc: Roman Fietze
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Sachin Kamat
     
  • Use of PTR_RET() simplifies the code.

    Signed-off-by: Sachin Kamat
    Cc: David Dajun Chen
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Sachin Kamat
     
  • Use the wrapper functions for getting and setting the driver data using
    platform_device instead of using dev_{get,set}_drvdata() with &pdev->dev,
    so we can directly pass a struct platform_device.

    Signed-off-by: Jingoo Han
    Cc: Grant Likely
    Cc: Rob Herring
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Jingoo Han