rtc: pcf2127: provide ->read method
This simply consists of renaming the existing pcf2127_read_reg() helper to follow the naming of the other methods (i.e. pcf2127_rtc_<method name>) and changing the type of its "len" parameter. Reviewed-by: Simon Glass <sjg@chromium.org> Reviewed-by: Heiko Schocher <hs@denx.de> Signed-off-by: Rasmus Villemoes <rasmus.villemoes@prevas.dk>
This commit is contained in:

committed by
Heiko Schocher

parent
5113f0b65a
commit
a518dd6336
@@ -23,8 +23,7 @@
|
|||||||
#define PCF2127_REG_MO 0x08
|
#define PCF2127_REG_MO 0x08
|
||||||
#define PCF2127_REG_YR 0x09
|
#define PCF2127_REG_YR 0x09
|
||||||
|
|
||||||
static int pcf2127_read_reg(struct udevice *dev, uint offset,
|
static int pcf2127_rtc_read(struct udevice *dev, uint offset, u8 *buffer, uint len)
|
||||||
u8 *buffer, int len)
|
|
||||||
{
|
{
|
||||||
struct dm_i2c_chip *chip = dev_get_parent_platdata(dev);
|
struct dm_i2c_chip *chip = dev_get_parent_platdata(dev);
|
||||||
struct i2c_msg msg;
|
struct i2c_msg msg;
|
||||||
@@ -73,7 +72,7 @@ static int pcf2127_rtc_get(struct udevice *dev, struct rtc_time *tm)
|
|||||||
int ret = 0;
|
int ret = 0;
|
||||||
uchar buf[10] = { PCF2127_REG_CTRL1 };
|
uchar buf[10] = { PCF2127_REG_CTRL1 };
|
||||||
|
|
||||||
ret = pcf2127_read_reg(dev, PCF2127_REG_CTRL1, buf, sizeof(buf));
|
ret = pcf2127_rtc_read(dev, PCF2127_REG_CTRL1, buf, sizeof(buf));
|
||||||
if (ret < 0)
|
if (ret < 0)
|
||||||
return ret;
|
return ret;
|
||||||
|
|
||||||
@@ -110,6 +109,7 @@ static const struct rtc_ops pcf2127_rtc_ops = {
|
|||||||
.get = pcf2127_rtc_get,
|
.get = pcf2127_rtc_get,
|
||||||
.set = pcf2127_rtc_set,
|
.set = pcf2127_rtc_set,
|
||||||
.reset = pcf2127_rtc_reset,
|
.reset = pcf2127_rtc_reset,
|
||||||
|
.read = pcf2127_rtc_read,
|
||||||
};
|
};
|
||||||
|
|
||||||
static const struct udevice_id pcf2127_rtc_ids[] = {
|
static const struct udevice_id pcf2127_rtc_ids[] = {
|
||||||
|
Reference in New Issue
Block a user