History log of /linux-master/drivers/rtc/rtc-palmas.c
Revision Date Author Comments
# a7f9864e 04-Mar-2023 Uwe Kleine-König <u.kleine-koenig@pengutronix.de>

rtc: palmas: Convert to platform remove callback returning void

The .remove() callback for a platform driver returns an int which makes
many driver authors wrongly assume it's possible to do error handling by
returning an error code. However the value returned is (mostly) ignored
and this typically results in resource leaks. To improve here there is a
quest to make the remove callback return void. In the first step of this
quest all drivers are converted to .remove_new() which already returns
void.

Trivially convert this driver from always returning zero in the remove
callback to the void returning variant.

Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Link: https://lore.kernel.org/r/20230304133028.2135435-23-u.kleine-koenig@pengutronix.de
Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>


# 1d9539ed 07-Jul-2021 Nobuhiro Iwamatsu <nobuhiro1.iwamatsu@toshiba.co.jp>

rtc: palmas: convert to SPDX identifier

Use SPDX-License-Identifier instead of a verbose license text.

Signed-off-by: Nobuhiro Iwamatsu <nobuhiro1.iwamatsu@toshiba.co.jp>
Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
Link: https://lore.kernel.org/r/20210707075804.337458-5-nobuhiro1.iwamatsu@toshiba.co.jp


# 34c7b3ac 31-Aug-2016 Julia Lawall <julia.lawall@lip6.fr>

rtc: constify rtc_class_ops structures

Check for rtc_class_ops structures that are only passed to
devm_rtc_device_register, rtc_device_register,
platform_device_register_data, all of which declare the corresponding
parameter as const. Declare rtc_class_ops structures that have these
properties as const.

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

// <smpl>
@r disable optional_qualifier@
identifier i;
position p;
@@
static struct rtc_class_ops i@p = { ... };

@ok@
identifier r.i;
expression e1,e2,e3,e4;
position p;
@@
(
devm_rtc_device_register(e1,e2,&i@p,e3)
|
rtc_device_register(e1,e2,&i@p,e3)
|
platform_device_register_data(e1,e2,e3,&i@p,e4)
)

@bad@
position p != {r.p,ok.p};
identifier r.i;
@@
i@p

@depends on !bad disable optional_qualifier@
identifier r.i;
@@
static
+const
struct rtc_class_ops i = { ... };
// </smpl>

Signed-off-by: Julia Lawall <Julia.Lawall@lip6.fr>
Acked-by: Baruch Siach <baruch@tkos.co.il>
Acked-by: Hans Ulli Kroll <ulli.kroll@googlemail.com>
Acked-by: Linus Walleij <linus.walleij@linaro.org>
Acked-by: Thierry Reding <treding@nvidia.com>
Signed-off-by: Alexandre Belloni <alexandre.belloni@free-electrons.com>


# b3be3f6a 26-Feb-2016 Grygorii Strashko <grygorii.strashko@ti.com>

rtc: palmas: Drop IRQF_EARLY_RESUME flag

Palams RTC IRQ is nested threaded and wired to the Palmas inerrupt
controller. So, this flag is not required for nested irqs anymore,
since commit 3c646f2c6aa9 ("genirq: Don't suspend nested_thread irqs
over system suspend") was merged.

Cc: Alessandro Zummo <a.zummo@towertech.it>
Cc: Alexandre Belloni <alexandre.belloni@free-electrons.com>
Cc: Tony Lindgren <tony@atomide.com>
Cc: Lee Jones <lee.jones@linaro.org>
Cc: Nishanth Menon <nm@ti.com>
Signed-off-by: Grygorii Strashko <grygorii.strashko@ti.com>
Signed-off-by: Alexandre Belloni <alexandre.belloni@free-electrons.com>


# d200c79b 29-May-2015 Laxman Dewangan <ldewangan@nvidia.com>

rtc: palmas: Initialise bb_charging flag before using it

Initialise the variable high_bb_charging before using it to avoid
configuring wrong value and fix following compilation warning:

/*
rtc-palmas.c: In function ‘palmas_rtc_probe’:
rtc-palmas.c:242:7: warning: ‘high_bb_charging’ may be used
uninitialized in this function
*/

Signed-off-by: Laxman Dewangan <ldewangan@nvidia.com>
Signed-off-by: Alexandre Belloni <alexandre.belloni@free-electrons.com>


# 0929ae37 20-Oct-2014 Wolfram Sang <wsa@kernel.org>

rtc: drop owner assignment from platform_drivers

A platform_driver does not need to set an owner, it will be populated by the
driver core.

Signed-off-by: Wolfram Sang <wsa@the-dreams.de>


# 7abe3f54 06-Jun-2014 Jingoo Han <jg1.han@samsung.com>

rtc: rtc-palmas: make of_device_id array const

Make of_device_id array const, because all OF functions handle it as
const.

Signed-off-by: Jingoo Han <jg1.han@samsung.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>


# 3f93822d 03-Apr-2014 Jingoo Han <jg1.han@samsung.com>

drivers/rtc/rtc-palmas.c: use SIMPLE_DEV_PM_OPS macro

Use SIMPLE_DEV_PM_OPS macro in order to make the code simpler.

Signed-off-by: Jingoo Han <jg1.han@samsung.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>


# 666a584d 11-Sep-2013 Laxman Dewangan <ldewangan@nvidia.com>

drivers/rtc/rtc-palmas.c: support for backup battery charging

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 <ldewangan@nvidia.com>
Reviewed-by: Felipe Balbi <balbi@ti.com>
Acked-by: Kumar Gala <galak@codeaurora.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>


# 2c5a5b30 03-Jul-2013 Wei Ni <wni@nvidia.com>

drivers/rtc/rtc-palmas.c: init wakeup before device register

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

Signed-off-by: Wei Ni <wni@nvidia.com>
Acked-by: Laxman Dewangan <ldewangan@nvidia.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>


# 0288d2e3 29-Apr-2013 Laxman Dewangan <ldewangan@nvidia.com>

drivers/rtc/rtc-palmas.c: add dt support

Add of_device_id table for Palma RTC to be enable the driver from DT file.

The driver can be registered from DT file as:
palmas: tps65913@58 {
:::::::::::
palmas_rtc {
compatible = "ti,palmas-rtc";
interrupt-parent = <&palmas>;
interrupts = <8 0>;
};
};

Signed-off-by: Laxman Dewangan <ldewangan@nvidia.com>
Acked-by: Grant Likely <grant.likely@secretlab.ca>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>


# 27971335 29-Apr-2013 Jingoo Han <jg1.han@samsung.com>

rtc: rtc-palmas: use devm_rtc_device_register() and devm_request_threaded_irq()

devm_rtc_device_register() is device managed and makes cleanup
paths simpler.

Also, use devm_request_threaded_irq() to make cleanup paths more simple.

Signed-off-by: Jingoo Han <jg1.han@samsung.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>


# 0101e53c 03-Jan-2013 Laxman Dewangan <ldewangan@nvidia.com>

rtc: palmas: Add RTC driver Palmas series PMIC

TI Palmas series PMIC support the RTC and alarm functionality.
Add RTC driver with alarm support for this device.

Signed-off-by: Laxman Dewangan <ldewangan@nvidia.com>
Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>