Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit bfebeb16 authored by Linus Torvalds's avatar Linus Torvalds
Browse files
Pull RTC updates from Alexandre Belloni:
 "It is now possible to add custom sysfs attributes while avoiding a
  possible race condition. Unused code has been removed resulting in a
  nice reduction of the code base. And more drivers have been switched
  to SPDX by their maintainers.

 Summary:

  Subsystem:
   - new helpers to add custom sysfs attributes
   - struct rtc_task removal along with rtc_irq_[un]register()
   - rtc_irq_set_state and rtc_irq_set_freq are not exported anymore

  Drivers:
   - armada38x: reset after rtc power loss
   - ds1307: now supports m41t11
   - isl1208: now supports isl1219 and tamper detection
   - pcf2127: internal SRAM support"

* tag 'rtc-4.19' of git://git.kernel.org/pub/scm/linux/kernel/git/abelloni/linux: (34 commits)
  rtc: ds1307: simplify hwmon config
  rtc: s5m: Add SPDX license identifier
  rtc: maxim: Add SPDX license identifiers
  rtc: isl1219: add device tree documentation
  rtc: isl1208: set ev-evienb bit from device tree
  rtc: isl1208: Add "evdet" interrupt source for isl1219
  rtc: isl1208: add support for isl1219 with tamper detection
  rtc: sysfs: facilitate attribute add to rtc device
  rtc: remove struct rtc_task
  char: rtc: remove task handling
  rtc: pcf85063: preserve control register value between stop and start
  rtc: sh: remove unused variable rtc_dev
  rtc: unexport rtc_irq_set_*
  rtc: simplify rtc_irq_set_state/rtc_irq_set_freq
  rtc: remove irq_task and irq_task_lock
  rtc: remove rtc_irq_register/rtc_irq_unregister
  rtc: sh: remove dead code
  rtc: sa1100: don't set PIE frequency
  rtc: ds1307: support m41t11 variant
  rtc: ds1307: fix data pointer to m41t0
  ...
parents 3933ec73 6b583a64
Loading
Loading
Loading
Loading
+29 −0
Original line number Diff line number Diff line
Intersil ISL1219 I2C RTC/Alarm chip with event in

ISL1219 has additional pins EVIN and #EVDET for tamper detection.

Required properties supported by the device:

 - "compatible": must be "isil,isl1219"
 - "reg": I2C bus address of the device

Optional properties:

 - "interrupt-names": list which may contains "irq" and "evdet"
 - "interrupts": list of interrupts for "irq" and "evdet"
 - "isil,ev-evienb": if present EV.EVIENB bit is set to the specified
                     value for proper operation.


Example isl1219 node with #IRQ pin connected to SoC gpio1 pin12
 and #EVDET pin connected to SoC gpio2 pin 24:

	isl1219: rtc@68 {
		compatible = "isil,isl1219";
		reg = <0x68>;
		interrupt-names = "irq", "evdet";
		interrupts-extended = <&gpio1 12 IRQ_TYPE_EDGE_FALLING>,
			<&gpio2 24 IRQ_TYPE_EDGE_FALLING>;
		isil,ev-evienb = <1>;
	};
+1 −0
Original line number Diff line number Diff line
@@ -13,6 +13,7 @@ Required properties:
	"maxim,ds3231",
	"st,m41t0",
	"st,m41t00",
	"st,m41t11",
	"microchip,mcp7940x",
	"microchip,mcp7941x",
	"pericom,pt7c4338",
+0 −13
Original line number Diff line number Diff line
@@ -193,14 +193,6 @@ static unsigned long rtc_freq; /* Current periodic IRQ rate */
static unsigned long rtc_irq_data;	/* our output to the world	*/
static unsigned long rtc_max_user_freq = 64; /* > this, need CAP_SYS_RESOURCE */

#ifdef RTC_IRQ
/*
 * rtc_task_lock nests inside rtc_lock.
 */
static DEFINE_SPINLOCK(rtc_task_lock);
static rtc_task_t *rtc_callback;
#endif

/*
 *	If this driver ever becomes modularised, it will be really nice
 *	to make the epoch retain its value across module reload...
@@ -264,11 +256,6 @@ static irqreturn_t rtc_interrupt(int irq, void *dev_id)

	spin_unlock(&rtc_lock);

	/* Now do the rest of the actions */
	spin_lock(&rtc_task_lock);
	if (rtc_callback)
		rtc_callback->func(rtc_callback->private_data);
	spin_unlock(&rtc_task_lock);
	wake_up_interruptible(&rtc_wait);

	kill_fasync(&rtc_async_queue, SIGIO, POLL_IN);
+0 −21
Original line number Diff line number Diff line
@@ -244,15 +244,6 @@ config RTC_DRV_DS1307
	  This driver can also be built as a module. If so, the module
	  will be called rtc-ds1307.

config RTC_DRV_DS1307_HWMON
	bool "HWMON support for rtc-ds1307"
	depends on RTC_DRV_DS1307 && HWMON
	depends on !(RTC_DRV_DS1307=y && HWMON=m)
	default y
	help
	  Say Y here if you want to expose temperature sensor data on
	  rtc-ds1307 (only DS3231)

config RTC_DRV_DS1307_CENTURY
	bool "Century bit support for rtc-ds1307"
	depends on RTC_DRV_DS1307
@@ -1027,18 +1018,6 @@ config RTC_DS1685_PROC_REGS

	  Unless you are debugging this driver, choose N.

config RTC_DS1685_SYSFS_REGS
	bool "SysFS access to RTC register bits"
	depends on RTC_DRV_DS1685_FAMILY && SYSFS
	help
	  Enable this to provide access to the RTC control register bits
	  in /sys.  Some of the bits are read-write, others are read-only.

	  Keep in mind that reading Control C's bits automatically clears
	  all pending IRQ flags - this can cause lost interrupts.

	  If you know that you need access to these bits, choose Y, Else N.

config RTC_DRV_DS1742
	tristate "Maxim/Dallas DS1742/1743"
	depends on HAS_IOMEM
+2 −3
Original line number Diff line number Diff line
@@ -68,7 +68,7 @@ static int rtc_suspend(struct device *dev)
		return 0;
	}

	getnstimeofday64(&old_system);
	ktime_get_real_ts64(&old_system);
	old_rtc.tv_sec = rtc_tm_to_time64(&tm);


@@ -110,7 +110,7 @@ static int rtc_resume(struct device *dev)
		return 0;

	/* snapshot the current rtc and system time at resume */
	getnstimeofday64(&new_system);
	ktime_get_real_ts64(&new_system);
	err = rtc_read_time(rtc, &tm);
	if (err < 0) {
		pr_debug("%s:  fail to read rtc time\n", dev_name(&rtc->dev));
@@ -172,7 +172,6 @@ static struct rtc_device *rtc_allocate_device(void)

	mutex_init(&rtc->ops_lock);
	spin_lock_init(&rtc->irq_lock);
	spin_lock_init(&rtc->irq_task_lock);
	init_waitqueue_head(&rtc->irq_queue);

	/* Init timerqueue */
Loading