Lines Matching +full:slave +full:- +full:addr

1 /*-
2 * SPDX-License-Identifier: BSD-2-Clause
83 #define LOCK(_sc) sx_xlock(&(_sc)->lock)
84 #define UNLOCK(_sc) sx_xunlock(&(_sc)->lock)
85 #define LOCK_INIT(_sc) sx_init(&(_sc)->lock, "max77620_rtc")
86 #define LOCK_DESTROY(_sc) sx_destroy(&(_sc)->lock);
102 uint8_t addr;
105 {0, IIC_M_WR, 1, &addr},
109 msgs[0].slave = sc->bus_addr;
110 msgs[1].slave = sc->bus_addr;
111 addr = reg;
113 rv = iicbus_transfer(sc->dev, msgs, 2);
115 device_printf(sc->dev,
127 uint8_t addr;
130 {0, IIC_M_WR, 1, &addr},
134 msgs[0].slave = sc->bus_addr;
135 msgs[1].slave = sc->bus_addr;
136 addr = reg;
138 rv = iicbus_transfer(sc->dev, msgs, 2);
140 device_printf(sc->dev,
158 msgs[0].slave = sc->bus_addr;
162 rv = iicbus_transfer(sc->dev, msgs, 1);
164 device_printf(sc->dev,
182 msgs[0].slave = sc->bus_addr;
183 msgs[1].slave = sc->bus_addr;
186 rv = iicbus_transfer(sc->dev, msgs, 2);
188 device_printf(sc->dev,
245 device_printf(sc->dev, "Failed to strobe RTC data\n");
252 device_printf(sc->dev, "Failed to read RTC data\n");
286 buf[5] = bin2bcd(ct.year - MAX77620_RTC_START_YEAR);
293 device_printf(sc->dev, "Failed to write RTC data\n");
299 device_printf(sc->dev, "Failed to update RTC data\n");
333 sc->dev = dev;
334 sc->bus_addr = iicbus_get_addr(dev);
341 device_printf(sc->dev, "Failed to configure RTC\n");
347 device_printf(sc->dev, "Failed to configure RTC\n");
352 device_printf(sc->dev, "Failed to update RTC data\n");
356 clock_register(sc->dev, 1000000);
392 parent = device_get_parent(sc->dev);
396 device_printf(sc->dev, "Cannot create MAX77620 RTC device.\n");
400 rv = OFW_IICBUS_SET_DEVINFO(parent, child, -1, "rtc@68",
403 device_printf(sc->dev, "Cannot setup MAX77620 RTC device.\n");