// SPDX-License-Identifier: GPL-2.0-only/* * An I2C and SPI driver for the NXP PCF2127/29/31 RTC * Copyright 2013 Til-Technologies * * Author: Renaud Cerrato <r.cerrato@til-technologies.fr> * * Watchdog and tamper functions * Author: Bruno Thomsen <bruno.thomsen@gmail.com> * * PCF2131 support * Author: Hugo Villeneuve <hvilleneuve@dimonoff.com> * * based on the other drivers in this same directory. * * Datasheets: https://www.nxp.com/docs/en/data-sheet/PCF2127.pdf * https://www.nxp.com/docs/en/data-sheet/PCF2131DS.pdf */#include<linux/i2c.h>#include<linux/spi/spi.h>#include<linux/bcd.h>#include<linux/rtc.h>#include<linux/slab.h>#include<linux/module.h>#include<linux/of.h>#include<linux/of_irq.h>#include<linux/of_device.h>#include<linux/regmap.h>#include<linux/watchdog.h>/* Control register 1 */#define PCF2127_REG_CTRL1 0x00#define PCF2127_BIT_CTRL1_POR_OVRD BIT(3)#define PCF2127_BIT_CTRL1_TSF1 BIT(4)#define PCF2127_BIT_CTRL1_STOP BIT(5)/* Control register 2 */#define PCF2127_REG_CTRL2 0x01#define PCF2127_BIT_CTRL2_AIE BIT(1