Commit e8dff03a authored by Linus Torvalds's avatar Linus Torvalds
Browse files
Pull RTC updates from Alexandre Belloni:
 "Not much this cycle apart from the ingenic rtc driver rework.

  The fixes are mainly minor issues reported by coccinelle rather than
  real world issues.

  Subsystem:

   - new VL flag for backup switch over

  Drivers:

   - ingenic: only support device tree

   - pcf2127: report battery switch over, handle nowayout"

* tag 'rtc-5.8' of git://git.kernel.org/pub/scm/linux/kernel/git/abelloni/linux: (29 commits)
  rtc: pcf2127: watchdog: handle nowayout feature
  rtc: fsl-ftm-alarm: fix freeze(s2idle) failed to wake
  rtc: abx80x: Provide debug feedback for invalid dt properties
  rtc: abx80x: Add Device Tree matching table
  rtc: rv3028: Add missed check for devm_regmap_init_i2c()
  rtc: mpc5121: Use correct return value for mpc5121_rtc_probe()
  rtc: goldfish: Use correct return value for goldfish_rtc_probe()
  rtc: snvs: Add necessary clock operations for RTC APIs
  rtc: snvs: Make SNVS clock always prepared
  rtc: ingenic: Reset regulator register in probe
  rtc: ingenic: Fix masking of error code
  rtc: ingenic: Remove unused fields from private structure
  rtc: ingenic: Set wakeup params in probe
  rtc: ingenic: Enable clock in probe
  rtc: ingenic: Use local 'dev' variable in probe
  rtc: ingenic: Only support probing from devicetree
  rtc: mc13xxx: fix a double-unlock issue
  rtc: stmp3xxx: update contact email
  rtc: max77686: Use single-byte writes on MAX77620
  rtc: pcf2127: report battery switch over
  ...
parents 787f74fc 4601e24a
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -1680,6 +1680,7 @@ config RTC_DRV_MPC5121
config RTC_DRV_JZ4740
	tristate "Ingenic JZ4740 SoC"
	depends on MIPS || COMPILE_TEST
	depends on OF
	help
	  If you say yes here you get support for the Ingenic JZ47xx SoCs RTC
	  controllers.
+0 −6
Original line number Diff line number Diff line
@@ -106,12 +106,6 @@ static int pm860x_rtc_set_time(struct device *dev, struct rtc_time *tm)
	unsigned char buf[4];
	unsigned long ticks, base, data;

	if (tm->tm_year > 206) {
		dev_dbg(info->dev, "Set time %d out of range. "
			"Please set time between 1970 to 2106.\n",
			1900 + tm->tm_year);
		return -EINVAL;
	}
	ticks = rtc_tm_to_time64(tm);

	/* load 32-bit read-only counter */
+60 −6
Original line number Diff line number Diff line
@@ -13,6 +13,7 @@
#include <linux/bcd.h>
#include <linux/i2c.h>
#include <linux/module.h>
#include <linux/of_device.h>
#include <linux/rtc.h>
#include <linux/watchdog.h>

@@ -554,8 +555,9 @@ static const struct rtc_class_ops abx80x_rtc_ops = {
	.ioctl		= abx80x_ioctl,
};

static int abx80x_dt_trickle_cfg(struct device_node *np)
static int abx80x_dt_trickle_cfg(struct i2c_client *client)
{
	struct device_node *np = client->dev.of_node;
	const char *diode;
	int trickle_cfg = 0;
	int i, ret;
@@ -565,12 +567,14 @@ static int abx80x_dt_trickle_cfg(struct device_node *np)
	if (ret)
		return ret;

	if (!strcmp(diode, "standard"))
	if (!strcmp(diode, "standard")) {
		trickle_cfg |= ABX8XX_TRICKLE_STANDARD_DIODE;
	else if (!strcmp(diode, "schottky"))
	} else if (!strcmp(diode, "schottky")) {
		trickle_cfg |= ABX8XX_TRICKLE_SCHOTTKY_DIODE;
	else
	} else {
		dev_dbg(&client->dev, "Invalid tc-diode value: %s\n", diode);
		return -EINVAL;
	}

	ret = of_property_read_u32(np, "abracon,tc-resistor", &tmp);
	if (ret)
@@ -580,8 +584,10 @@ static int abx80x_dt_trickle_cfg(struct device_node *np)
		if (trickle_resistors[i] == tmp)
			break;

	if (i == sizeof(trickle_resistors))
	if (i == sizeof(trickle_resistors)) {
		dev_dbg(&client->dev, "Invalid tc-resistor value: %u\n", tmp);
		return -EINVAL;
	}

	return (trickle_cfg | i);
}
@@ -793,7 +799,7 @@ static int abx80x_probe(struct i2c_client *client,
	}

	if (np && abx80x_caps[part].has_tc)
		trickle_cfg = abx80x_dt_trickle_cfg(np);
		trickle_cfg = abx80x_dt_trickle_cfg(client);

	if (trickle_cfg > 0) {
		dev_info(&client->dev, "Enabling trickle charger: %02x\n",
@@ -863,9 +869,57 @@ static const struct i2c_device_id abx80x_id[] = {
};
MODULE_DEVICE_TABLE(i2c, abx80x_id);

#ifdef CONFIG_OF
static const struct of_device_id abx80x_of_match[] = {
	{
		.compatible = "abracon,abx80x",
		.data = (void *)ABX80X
	},
	{
		.compatible = "abracon,ab0801",
		.data = (void *)AB0801
	},
	{
		.compatible = "abracon,ab0803",
		.data = (void *)AB0803
	},
	{
		.compatible = "abracon,ab0804",
		.data = (void *)AB0804
	},
	{
		.compatible = "abracon,ab0805",
		.data = (void *)AB0805
	},
	{
		.compatible = "abracon,ab1801",
		.data = (void *)AB1801
	},
	{
		.compatible = "abracon,ab1803",
		.data = (void *)AB1803
	},
	{
		.compatible = "abracon,ab1804",
		.data = (void *)AB1804
	},
	{
		.compatible = "abracon,ab1805",
		.data = (void *)AB1805
	},
	{
		.compatible = "microcrystal,rv1805",
		.data = (void *)RV1805
	},
	{ }
};
MODULE_DEVICE_TABLE(of, abx80x_of_match);
#endif

static struct i2c_driver abx80x_driver = {
	.driver		= {
		.name	= "rtc-abx80x",
		.of_match_table = of_match_ptr(abx80x_of_match),
	},
	.probe		= abx80x_probe,
	.id_table	= abx80x_id,
+6 −4
Original line number Diff line number Diff line
@@ -21,6 +21,7 @@
#include <linux/rtc.h>
#include <linux/time.h>
#include <linux/acpi.h>
#include <linux/pm_wakeirq.h>

#define FTM_SC_CLK(c)		((c) << FTM_SC_CLK_MASK_SHIFT)

@@ -268,13 +269,11 @@ static int ftm_rtc_probe(struct platform_device *pdev)
	}

	irq = platform_get_irq(pdev, 0);
	if (irq < 0) {
		dev_err(&pdev->dev, "can't get irq number\n");
	if (irq < 0)
		return irq;
	}

	ret = devm_request_irq(&pdev->dev, irq, ftm_rtc_alarm_interrupt,
			       IRQF_NO_SUSPEND, dev_name(&pdev->dev), rtc);
			       0, dev_name(&pdev->dev), rtc);
	if (ret < 0) {
		dev_err(&pdev->dev, "failed to request irq\n");
		return ret;
@@ -287,6 +286,9 @@ static int ftm_rtc_probe(struct platform_device *pdev)
	rtc->rtc_dev->ops = &ftm_rtc_ops;

	device_init_wakeup(&pdev->dev, true);
	ret = dev_pm_set_wake_irq(&pdev->dev, irq);
	if (ret)
		dev_err(&pdev->dev, "failed to enable irq wake\n");

	ret = rtc_register_device(rtc->rtc_dev);
	if (ret) {
+1 −1
Original line number Diff line number Diff line
@@ -174,7 +174,7 @@ static int goldfish_rtc_probe(struct platform_device *pdev)
	platform_set_drvdata(pdev, rtcdrv);
	rtcdrv->base = devm_platform_ioremap_resource(pdev, 0);
	if (IS_ERR(rtcdrv->base))
		return -ENODEV;
		return PTR_ERR(rtcdrv->base);

	rtcdrv->irq = platform_get_irq(pdev, 0);
	if (rtcdrv->irq < 0)
Loading