Source
22
22
* http://www.nxp.com/documents/data_sheet/PCF85063A.pdf
23
23
* http://www.nxp.com/documents/data_sheet/PCF85063TP.pdf
24
24
*
25
25
* PCF85063A -- Rev. 6 — 18 November 2015
26
26
* PCF85063TP -- Rev. 4 — 6 May 2015
27
27
*/
28
28
29
29
#define PCF85063_REG_CTRL1 0x00 /* status */
30
30
#define PCF85063_REG_CTRL1_CAP_SEL BIT(0)
31
31
#define PCF85063_REG_CTRL1_STOP BIT(5)
32
-
#define PCF85063_REG_CTRL2 0x01
33
32
34
33
#define PCF85063_REG_SC 0x04 /* datetime */
35
34
#define PCF85063_REG_SC_OS 0x80
36
-
#define PCF85063_REG_MN 0x05
37
-
#define PCF85063_REG_HR 0x06
38
-
#define PCF85063_REG_DM 0x07
39
-
#define PCF85063_REG_DW 0x08
40
-
#define PCF85063_REG_MO 0x09
41
-
#define PCF85063_REG_YR 0x0A
42
35
43
36
static struct i2c_driver pcf85063_driver;
44
37
45
38
static int pcf85063_stop_clock(struct i2c_client *client, u8 *ctrl1)
46
39
{
47
40
int rc;
48
41
u8 reg;
49
42
50
43
rc = i2c_smbus_read_byte_data(client, PCF85063_REG_CTRL1);
51
44
if (rc < 0) {