History log of /drivers/rtc/rtc-max77686.c
Revision Date Author Comments
a20cd88e20e59ce11ebca84fac769654193c51e0 14-Oct-2014 Javier Martinez Canillas <javier.martinez@collabora.co.uk> rtc: max77686: Use ffs() to calculate tm_wday

max77686_rtc_calculate_wday() is used to calculate the day of the week
to be filled in struct rtc_time but that function only calculates the
number of bits shifted. So the ffs() function can be used to find the
first bit set instead of a special function.

[akpm@linux-foundation.org: add comment clarifying ffs() use]
Signed-off-by: Javier Martinez Canillas <javier.martinez@collabora.co.uk>
Cc: Joe Perches <joe@perches.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
ea33c31b621e296356ab74ea0237ba7761f2287e 14-Oct-2014 Javier Martinez Canillas <javier.martinez@collabora.co.uk> rtc: max77686: remove unneeded info log

If devm_rtc_device_register() fails a dev_err() is already reported so
there is no need to do an additional dev_info().

Signed-off-by: Javier Martinez Canillas <javier.martinez@collabora.co.uk>
Cc: Doug Anderson <dianders@chromium.org>
Cc: Krzysztof Kozlowski <k.kozlowski@samsung.com>
Cc: Alessandro Zummo <a.zummo@towertech.it>
Cc: Olof Johansson <olof@lixom.net>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
1745d6d3bc181800ba2e0930ab15432b3e2755ff 14-Oct-2014 Javier Martinez Canillas <javier.martinez@collabora.co.uk> rtc: max77686: fail to probe if no RTC regmap irqchip is set

The max77686 mfd driver adds a regmap IRQ chip which creates an IRQ
domain that is used to map the virtual RTC alarm1 interrupt.

The RTC driver assumes that this will always be true since the PMIC IRQ
is a required property according to the max77686 DT binding doc. If an
"interrupts" property is not defined for a max77686 PMIC, then the mfd
probe function will fail and the RTC platform driver will never be
probed.

But even when it is not possible to probe the rtc-max77686 driver
without a regmap IRQ chip, it's better to explicitly check if the IRQ
chip data is not NULL and gracefully fail instead of getting an OOPS.

Signed-off-by: Javier Martinez Canillas <javier.martinez@collabora.co.uk>
Reported-by: Krzysztof Kozlowski <k.kozlowski@samsung.com>
Cc: Doug Anderson <dianders@chromium.org>
Cc: Alessandro Zummo <a.zummo@towertech.it>
Cc: Olof Johansson <olof@lixom.net>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
6b50fac5ddb9748487aab3c5f8d323da01a6648f 14-Oct-2014 Javier Martinez Canillas <javier.martinez@collabora.co.uk> rtc: max77686: remove dead code for SMPL and WTSR

The MAX77686 RTC chip has two features called SMPL (Sudden Momentary
Power Loss) and WTSR (Watchdog Timeout and Software Resets). Support
for these features seems to be implemented in the driver but compilation
is disabled using a C pre-processor conditional.

This code has been disabled since the driver was original merged in
commit fca1dd031a28 ("rtc: max77686: add Maxim 77686 driver").

So, since this code has never been built, let's just remove it.

Signed-off-by: Javier Martinez Canillas <javier.martinez@collabora.co.uk>
Reviewed-by: Krzysztof Kozlowski <k.kozlowski@samsung.com>
Cc: Doug Anderson <dianders@chromium.org>
Cc: Alessandro Zummo <a.zummo@towertech.it>
Cc: Olof Johansson <olof@lixom.net>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
e7f7fc73693e0a9de693f261d63aa681f7979c33 14-Oct-2014 Doug Anderson <dianders@chromium.org> rtc: max77686: Allow the max77686 rtc to wakeup the system

This series add support for the Real Time clock present in the Maxim 77802
Power Managment IC. The version number is quite high because it
previously was part of a bigger series [0] that aimed to add support for
all the devices in the max77802 PMIC. But now that the max77802
dependencies were already merged for 3.17, the series were split but I
kept the version numbering.

While working on the max77802 rtc support a lot of feedback was given and
the issues pointed out also apply to a driver for a similar PMIC RTC
(max77686). So patches 01/06 to 05/06 in the series are cleanups for the
max77686 driver and patch 06/06 adds the support for the max77802 RTC.

The series were tested on an Exynos5250 Snow (max77686) and
Exynos5420 Peach Pit (max77802) machines.

This patch (of 6):

The max77686 includes an RTC that keeps power during suspend. It's
convenient to be able to use it as a wakeup source.

Signed-off-by: Doug Anderson <dianders@chromium.org>
Signed-off-by: Javier Martinez Canillas <javier.martinez@collabora.co.uk>
Reviewed-by: Krzysztof Kozlowski <k.kozlowski@samsung.com>
Cc: Alessandro Zummo <a.zummo@towertech.it>
Cc: Olof Johansson <olof@lixom.net>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
6f1c1e71d933f58a6248f1681aededdd407f32a8 04-Jul-2014 Javier Martinez Canillas <javier.martinez@collabora.co.uk> mfd: max77686: Convert to use regmap_irq

By using the generic IRQ support in the Register map API, it
is possible to get rid max77686-irq.c and simplify the code.

Suggested-by: Krzysztof Kozlowski <k.kozlowski@samsung.com>
Signed-off-by: Javier Martinez Canillas <javier.martinez@collabora.co.uk>
Reviewed-by: Doug Anderson <dianders@chromium.org>
Tested-by: Doug Anderson <dianders@chromium.org>
Signed-off-by: Lee Jones <lee.jones@linaro.org>
1748cbf7f7c464593232cde914f5a103181a83b5 11-Sep-2013 Sangjung Woo <sangjung.woo@samsung.com> drivers/rtc/rtc-max77686.c: Fix wrong register

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

Signed-off-by: Sangjung Woo <sangjung.woo@samsung.com>
Signed-off-by: Myugnjoo Ham <myungjoo.ham@samsung.com>
Reviewed-by: Jonghwa Lee <jonghwa3.lee@samsung.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
eda328fbe3e1f82a12d56ffae3112086e2f1c578 04-Jul-2013 Sachin Kamat <sachin.kamat@linaro.org> drivers/rtc/rtc-max77686.c: remove empty function

After the switch to devm_* functions and the removal of
rtc_device_unregister(), the 'remove' function does not do anything.
Delete it.

Signed-off-by: Sachin Kamat <sachin.kamat@linaro.org>
Cc: Chiwoong Byun <woong.byun@samsung.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
cdf5f4ac63785e48d93137566d003d6c839b1259 04-Jul-2013 Sachin Kamat <sachin.kamat@linaro.org> drivers/rtc/rtc-max77686.c: remove space before semicolon

Fixes the following warning:

WARNING: space prohibited before semicolon

Signed-off-by: Sachin Kamat <sachin.kamat@linaro.org>
Cc: Jingoo Han <jg1.han@samsung.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
7f391f54cdbc68a9617642c2141c696ed368f594 30-Apr-2013 Sachin Kamat <sachin.kamat@linaro.org> drivers/rtc/rtc-max77686.c: use devm_regmap_init_i2c()

This driver already uses other devm_* APIs.
Convert regmap_init_i2c too.

Signed-off-by: Sachin Kamat <sachin.kamat@linaro.org>
Cc: Chiwoong Byun <woong.byun@samsung.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
ad819039f1aa5c5179ecdfb035ed2864d93e741e 30-Apr-2013 Sachin Kamat <sachin.kamat@linaro.org> drivers/rtc/rtc-max77686.c: fix incorrect return value on error

'ret' was not initialized to error code before returning. While
at it also remove some redundant code and cleanup.

Signed-off-by: Sachin Kamat <sachin.kamat@linaro.org>
Cc: Chiwoong Byun <woong.byun@samsung.com>
Cc: Jonghwa Lee <jonghwa3.lee@samsung.com>
Cc: Laxman dewangan <ldewangan@nvidia.com>
Cc: Venu Byravarasu <vbyravarasu@nvidia.com>
Cc: Jingoo Han <jg1.han@samsung.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
f56950ec3a8dc093db724bf1c1611a12c85fb260 30-Apr-2013 Jingoo Han <jg1.han@samsung.com> rtc: rtc-max77686: use devm_rtc_device_register()

devm_rtc_device_register() is device managed and makes cleanup
paths simpler. Also, this patch uses devm_request_threaded_irq().

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>
e2bf1151edcdb44e9e871e90e7331dc760c9f856 30-Apr-2013 Jingoo Han <jg1.han@samsung.com> drivers/rtc/rtc-max77686.c: use dev_info()/dev_emerg() instead of pr_info()/pr_emerg()

dev_info()/dev_emerg() are preferred to pr_info()/pr_emerg().

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>
ac60bf31210f7b388ea2c1de62ef573a45f49a0f 30-Apr-2013 Jingoo Han <jg1.han@samsung.com> drivers/rtc/rtc-max77686.c: fix indentation of bit definitions

Fix indentation of bit definitions to enhance the readability.

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>
0f64f853fc622a0b0c7ab255f8605ae40aa45d84 30-Apr-2013 Jingoo Han <jg1.han@samsung.com> drivers/rtc/rtc-max77686.c: use devm_kzalloc()

Use devm_kzalloc() 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>
f5b1d3c5d022aeb994f94ed3372102e057925c6a 30-Apr-2013 Jingoo Han <jg1.han@samsung.com> drivers/rtc/rtc-max77686.c: add missing module author name

Add missing module author name to MODULE_AUTHOR macro.

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>
0c58ff587738c25e4402a51df6575230e7f099e1 30-Apr-2013 Jingoo Han <jg1.han@samsung.com> drivers/rtc/rtc-max77686.c: use module_platform_driver()

Use module_platform_driver() macro which makes the code smaller and
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>
3cebeb53d921c2079be0f1bf20f8cae68c20ecc0 22-Feb-2013 Jingoo Han <jg1.han@samsung.com> rtc: max77686: use dev_info() instead of printk()

Fix the checkpatch warning as below:

WARNING: Prefer netdev_err(netdev, ... then dev_err(dev, ... then pr_err(... to printk(KERN_ERR ...

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>
fca1dd031a28da74db3df4921dc36fa78941c99f 22-Feb-2013 Jonghwa Lee <jonghwa3.lee@samsung.com> rtc: max77686: add Maxim 77686 driver

Add a driver to support max77686 rtc. MAX77686 rtc support smpl and wtsr
mode. It has two alarm register which can be used for alarming to wake
system up. This drvier uses regmap to access its register.

[akpm@linux-foundation.org: remove inline, __devinit annotations]
[jg1.han@samsung.com: fix build warnings]
[akpm@linux-foundation.org: simplify code]
Signed-off-by: Chiwoong Byun <woong.byun@samsung.com>
Signed-off-by: Jonghwa Lee <jonghwa3.lee@samsung.com>
Signed-off-by: Myugnjoo Ham <myungjoo.ham@samsung.com>
Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>
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>