mirror of
https://github.com/AsahiLinux/u-boot
synced 2024-11-28 15:41:40 +00:00
drivers: rtc: max313xx: provide read8/write8
In some designs the MAX313xx RTC may need calibration to cope with oscillator inaccuracies. Provide read8/write8 ops so that the registers can be accessed. Because the driver covers a range of MAX313xx variants no attempt is made to ensure the register is valid. Signed-off-by: Chris Packham <judge.packham@gmail.com>
This commit is contained in:
parent
b1aade87ca
commit
d6c0d7087f
1 changed files with 12 additions and 0 deletions
|
@ -326,10 +326,22 @@ static int max313xx_reset(struct udevice *dev)
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static int max313xx_read8(struct udevice *dev, unsigned int reg)
|
||||||
|
{
|
||||||
|
return dm_i2c_reg_read(dev, reg);
|
||||||
|
}
|
||||||
|
|
||||||
|
static int max313xx_write8(struct udevice *dev, unsigned int reg, int val)
|
||||||
|
{
|
||||||
|
return dm_i2c_reg_write(dev, reg, val);
|
||||||
|
}
|
||||||
|
|
||||||
static const struct rtc_ops max3133x_rtc_ops = {
|
static const struct rtc_ops max3133x_rtc_ops = {
|
||||||
.get = max313xx_read_time,
|
.get = max313xx_read_time,
|
||||||
.set = max313xx_set_time,
|
.set = max313xx_set_time,
|
||||||
.reset = max313xx_reset,
|
.reset = max313xx_reset,
|
||||||
|
.read8 = max313xx_read8,
|
||||||
|
.write8 = max313xx_write8,
|
||||||
};
|
};
|
||||||
|
|
||||||
static int max313xx_init(struct udevice *dev)
|
static int max313xx_init(struct udevice *dev)
|
||||||
|
|
Loading…
Reference in a new issue