summaryrefslogtreecommitdiff
path: root/drivers/rtc/rtc-rx6110.c
AgeCommit message (Collapse)AuthorFilesLines
2023-07-28rtc: Explicitly include correct DT includesRob Herring1-1/+0
The DT of_device.h and of_platform.h date back to the separate of_platform_bus_type before it as merged into the regular platform bus. As part of that merge prepping Arm DT support 13 years ago, they "temporarily" include each other. They also include platform_device.h and of.h. As a result, there's a pretty much random mix of those include files used throughout the tree. In order to detangle these headers and replace the implicit includes with struct declarations, users need to explicitly include the correct includes. Signed-off-by: Rob Herring <robh@kernel.org> Link: https://lore.kernel.org/r/20230724205456.767430-1-robh@kernel.org Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
2023-06-07rtc: Switch i2c drivers back to use .probe()Uwe Kleine-König1-1/+1
After commit b8a1a4cd5a98 ("i2c: Provide a temporary .probe_new() call-back type"), all drivers being converted to .probe_new() and then 03c835f498b5 ("i2c: Switch .probe() to not take an id parameter") convert back to (the new) .probe() to be able to eventually drop .probe_new() from struct i2c_driver. Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de> Link: https://lore.kernel.org/r/20230505121136.1185653-1-u.kleine-koenig@pengutronix.de Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
2023-02-22rtc: rx6110: Remove unused of_gpio,hAndy Shevchenko1-1/+0
of_gpio.h provides a single function, which is not used in this driver. Remove unused header. Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com> Link: https://lore.kernel.org/r/20230215165030.83621-1-andriy.shevchenko@linux.intel.com Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
2022-12-12rtc: rx6110: fix warning with !OFAlexandre Belloni1-1/+1
rx6110_spi_of_match is not used when !OF, leading to a warning: >> drivers/rtc/rtc-rx6110.c:384:34: warning: 'rx6110_spi_of_match' defined but not used [-Wunused-const-variable=] 384 | static const struct of_device_id rx6110_spi_of_match[] = { | ^~~~~~~~~~~~~~~~~~~ Reported-by: kernel test robot <lkp@intel.com> Link: https://lore.kernel.org/r/20221211215756.54002-1-alexandre.belloni@bootlin.com Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
2022-06-24rtc: use simple i2c probeStephen Kitt1-3/+2
All these drivers have an i2c probe function which doesn't use the "struct i2c_device_id *id" parameter, so they can trivially be converted to the "probe_new" style of probe with a single argument. This change was done using the following Coccinelle script, and fixed up for whitespace changes: @ rule1 @ identifier fn; identifier client, id; @@ - static int fn(struct i2c_client *client, const struct i2c_device_id *id) + static int fn(struct i2c_client *client) { ...when != id } @ rule2 depends on rule1 @ identifier rule1.fn; identifier driver; @@ struct i2c_driver driver = { - .probe + .probe_new = ( fn | - &fn + fn ) , }; Signed-off-by: Stephen Kitt <steve@sk2.org> Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com> Link: https://lore.kernel.org/r/20220610162346.4134094-1-steve@sk2.org
2021-09-26rtc: rx6110: simplify getting the adapter of a clientWolfram Sang1-1/+1
We have a dedicated pointer for that, so use it. Much easier to read and less computation involved. Signed-off-by: Wolfram Sang <wsa+renesas@sang-engineering.com> Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com> Link: https://lore.kernel.org/r/20210918213553.14514-1-wsa+renesas@sang-engineering.com
2021-03-24rtc: rx6110: add ACPI bindings to I2CJohannes Hahn1-0/+7
This allows the RX6110 driver to be automatically assigned to the right device on the I2C bus. Signed-off-by: Johannes Hahn <johannes-hahn@siemens.com> Co-developed-by: Claudius Heine <ch@denx.de> Signed-off-by: Claudius Heine <ch@denx.de> Reviewed-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com> Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com> Link: https://lore.kernel.org/r/20210317075228.683184-1-ch@denx.de
2021-01-13rtc: rx6110: fix build against modular I2CArnd Bergmann1-2/+2
With CONFIG_I2C=m, the #ifdef section is disabled, as shown by this warning: drivers/rtc/rtc-rx6110.c:314:12: error: unused function 'rx6110_probe' [-Werror,-Wunused-function] Change the driver to use IS_ENABLED() instead, which works for both module and built-in subsystems. Fixes: afa819c2c6bf ("rtc: rx6110: add i2c support") Signed-off-by: Arnd Bergmann <arnd@arndb.de> Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com> Link: https://lore.kernel.org/r/20201230145938.3254459-1-arnd@kernel.org
2020-11-17rtc: rx6110: add i2c supportClaudius Heine1-23/+142
The RX6110 also supports I2C, so this patch adds support for it to the driver. This also renames the SPI specific functions and variables to include `_spi_` in their names. Signed-off-by: Claudius Heine <ch@denx.de> Signed-off-by: Henning Schild <henning.schild@siemens.com> Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com> Link: https://lore.kernel.org/r/20201117121817.953924-3-ch@denx.de
2019-11-15rtc: rx6110: Convert to SPDX identifierNobuhiro Iwamatsu1-9/+1
Use SPDX-License-Identifier instead of a verbose license text. Signed-off-by: Nobuhiro Iwamatsu <iwamatsu@nigauri.org> Link: https://lore.kernel.org/r/20191108002250.14937-1-iwamatsu@nigauri.org Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
2019-11-15rtc: rx6110: Remove useless rx6110_removeNobuhiro Iwamatsu1-6/+0
rx6110_remove is empty, remove it. Signed-off-by: Nobuhiro Iwamatsu <iwamatsu@nigauri.org> Link: https://lore.kernel.org/r/20191108002113.14791-1-iwamatsu@nigauri.org Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
2019-04-29rtc: rx6110: declare missing of tableDaniel Gomez1-0/+9
Add missing <of_device_id> table for SPI driver relying on SPI device match since compatible is in a DT binding or in a DTS. Before this patch: modinfo drivers/rtc/rtc-rx6110.ko | grep alias alias: spi:rx6110 After this patch: modinfo drivers/rtc/rtc-rx6110.ko | grep alias alias: spi:rx6110 alias: of:N*T*Cepson,rx6110C* alias: of:N*T*Cepson,rx6110 Reported-by: Javier Martinez Canillas <javier@dowhile0.org> Signed-off-by: Daniel Gomez <dagmcr@gmail.com> Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
2018-12-11rtc: rx6110: Switch to use %ptRAndy Shevchenko1-9/+3
Use %ptR instead of open coded variant to print content of struct rtc_time in human readable format. Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com> Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
2018-03-02rtc: stop validating rtc_time in .read_timeAlexandre Belloni1-1/+1
The RTC core is always calling rtc_valid_tm after the read_time callback. It is not necessary to call it just before returning from the callback. Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
2016-09-02rtc: constify rtc_class_ops structuresJulia Lawall1-1/+1
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>
2016-08-31rtc: rx6110: remove owner assignmentAlexandre Belloni1-1/+0
.owner is already set by the spi core. Signed-off-by: Alexandre Belloni <alexandre.belloni@free-electrons.com>
2016-03-14rtc: add driver for RX6110SA real time clockSteffen Trumtrar1-0/+402
The RX6110 comes in two different variants: SPI and I2C. This driver only supports the SPI variant. If the need ever arises to also support the I2C variant, this driver could easily be refactored to support both cases. Reviewed-by: Philipp Zabel <p.zabel@pengutronix.de> Signed-off-by: Steffen Trumtrar <s.trumtrar@pengutronix.de> Signed-off-by: Alexandre Belloni <alexandre.belloni@free-electrons.com>