lp87565.c (83d290c56fab2d38cd1ab4c4cc7099559c1d5046) lp87565.c (c83c436de0f8f02b7626fdd9a55663845facb26f)
1// SPDX-License-Identifier: GPL-2.0+
2/*
3 * (C) Copyright 2017 Texas Instruments Incorporated, <www.ti.com>
4 * Keerthy <j-keerthy@ti.com>
5 */
6
7#include <common.h>
8#include <fdtdec.h>

--- 12 unchanged lines hidden (view full) ---

21
22static int lp87565_write(struct udevice *dev, uint reg, const uint8_t *buff,
23 int len)
24{
25 int ret;
26
27 ret = dm_i2c_write(dev, reg, buff, len);
28 if (ret)
1// SPDX-License-Identifier: GPL-2.0+
2/*
3 * (C) Copyright 2017 Texas Instruments Incorporated, <www.ti.com>
4 * Keerthy <j-keerthy@ti.com>
5 */
6
7#include <common.h>
8#include <fdtdec.h>

--- 12 unchanged lines hidden (view full) ---

21
22static int lp87565_write(struct udevice *dev, uint reg, const uint8_t *buff,
23 int len)
24{
25 int ret;
26
27 ret = dm_i2c_write(dev, reg, buff, len);
28 if (ret)
29 pr_err("write error to device: %p register: %#x!", dev, reg);
29 pr_err("write error to device: %p register: %#x!\n", dev, reg);
30
31 return ret;
32}
33
34static int lp87565_read(struct udevice *dev, uint reg, uint8_t *buff, int len)
35{
36 int ret;
37
38 ret = dm_i2c_read(dev, reg, buff, len);
39 if (ret)
30
31 return ret;
32}
33
34static int lp87565_read(struct udevice *dev, uint reg, uint8_t *buff, int len)
35{
36 int ret;
37
38 ret = dm_i2c_read(dev, reg, buff, len);
39 if (ret)
40 pr_err("read error from device: %p register: %#x!", dev, reg);
40 pr_err("read error from device: %p register: %#x!\n", dev, reg);
41
42 return ret;
43}
44
45static int lp87565_bind(struct udevice *dev)
46{
47 ofnode regulators_node;
48 int children;
49
50 regulators_node = dev_read_subnode(dev, "regulators");
51 if (!ofnode_valid(regulators_node)) {
41
42 return ret;
43}
44
45static int lp87565_bind(struct udevice *dev)
46{
47 ofnode regulators_node;
48 int children;
49
50 regulators_node = dev_read_subnode(dev, "regulators");
51 if (!ofnode_valid(regulators_node)) {
52 debug("%s: %s regulators subnode not found!", __func__,
52 debug("%s: %s regulators subnode not found!\n", __func__,
53 dev->name);
54 return -ENXIO;
55 }
56
57 debug("%s: '%s' - found regulators subnode\n", __func__, dev->name);
58
59 children = pmic_bind_children(dev, regulators_node, pmic_children_info);
60 if (!children)

--- 24 unchanged lines hidden ---
53 dev->name);
54 return -ENXIO;
55 }
56
57 debug("%s: '%s' - found regulators subnode\n", __func__, dev->name);
58
59 children = pmic_bind_children(dev, regulators_node, pmic_children_info);
60 if (!children)

--- 24 unchanged lines hidden ---