blob: fff19e369a397b238f4c35ab868422d1bacae700 [file] [log] [blame]
Cédric Le Goater5141d412018-06-08 13:15:32 +01001/*
2 * PCA9552 I2C LED blinker
3 *
4 * https://www.nxp.com/docs/en/application-note/AN264.pdf
5 *
6 * Copyright (c) 2017-2018, IBM Corporation.
Philippe Mathieu-Daudé736132e2020-06-23 09:27:18 +02007 * Copyright (c) 2020 Philippe Mathieu-Daudé
Cédric Le Goater5141d412018-06-08 13:15:32 +01008 *
9 * This work is licensed under the terms of the GNU GPL, version 2 or
10 * later. See the COPYING file in the top-level directory.
11 */
12
13#include "qemu/osdep.h"
14#include "qemu/log.h"
Markus Armbruster0b8fa322019-05-23 16:35:07 +020015#include "qemu/module.h"
Philippe Mathieu-Daudéb989b892020-06-23 09:27:20 +020016#include "qemu/bitops.h"
Philippe Mathieu-Daudé2df252d2020-06-23 09:27:19 +020017#include "hw/qdev-properties.h"
Cédric Le Goater5141d412018-06-08 13:15:32 +010018#include "hw/misc/pca9552.h"
19#include "hw/misc/pca9552_regs.h"
Philippe Mathieu-Daudé586f4952020-06-23 09:27:23 +020020#include "hw/irq.h"
Markus Armbrusterd6454272019-08-12 07:23:45 +020021#include "migration/vmstate.h"
Joel Stanleya90d8f82020-01-30 16:02:02 +000022#include "qapi/error.h"
23#include "qapi/visitor.h"
Philippe Mathieu-Daudéb989b892020-06-23 09:27:20 +020024#include "trace.h"
Eduardo Habkostdb1015e2020-09-03 16:43:22 -040025#include "qom/object.h"
Cédric Le Goater5141d412018-06-08 13:15:32 +010026
Eduardo Habkostdb1015e2020-09-03 16:43:22 -040027struct PCA955xClass {
Philippe Mathieu-Daudé736132e2020-06-23 09:27:18 +020028 /*< private >*/
29 I2CSlaveClass parent_class;
30 /*< public >*/
31
32 uint8_t pin_count;
33 uint8_t max_reg;
Eduardo Habkostdb1015e2020-09-03 16:43:22 -040034};
35typedef struct PCA955xClass PCA955xClass;
Philippe Mathieu-Daudé736132e2020-06-23 09:27:18 +020036
Eduardo Habkost8110fa12020-08-31 17:07:33 -040037DECLARE_CLASS_CHECKERS(PCA955xClass, PCA955X,
38 TYPE_PCA955X)
Philippe Mathieu-Daudé736132e2020-06-23 09:27:18 +020039
Cédric Le Goater5141d412018-06-08 13:15:32 +010040#define PCA9552_LED_ON 0x0
41#define PCA9552_LED_OFF 0x1
42#define PCA9552_LED_PWM0 0x2
43#define PCA9552_LED_PWM1 0x3
44
Joel Stanleya90d8f82020-01-30 16:02:02 +000045static const char *led_state[] = {"on", "off", "pwm0", "pwm1"};
46
Philippe Mathieu-Daudéec172282020-06-23 09:27:17 +020047static uint8_t pca955x_pin_get_config(PCA955xState *s, int pin)
Cédric Le Goater5141d412018-06-08 13:15:32 +010048{
49 uint8_t reg = PCA9552_LS0 + (pin / 4);
50 uint8_t shift = (pin % 4) << 1;
51
52 return extract32(s->regs[reg], shift, 2);
53}
54
Philippe Mathieu-Daudéb989b892020-06-23 09:27:20 +020055/* Return INPUT status (bit #N belongs to GPIO #N) */
56static uint16_t pca955x_pins_get_status(PCA955xState *s)
57{
58 return (s->regs[PCA9552_INPUT1] << 8) | s->regs[PCA9552_INPUT0];
59}
60
61static void pca955x_display_pins_status(PCA955xState *s,
62 uint16_t previous_pins_status)
63{
64 PCA955xClass *k = PCA955X_GET_CLASS(s);
65 uint16_t pins_status, pins_changed;
66 int i;
67
68 pins_status = pca955x_pins_get_status(s);
69 pins_changed = previous_pins_status ^ pins_status;
70 if (!pins_changed) {
71 return;
72 }
73 if (trace_event_get_state_backends(TRACE_PCA955X_GPIO_STATUS)) {
74 char *buf = g_newa(char, k->pin_count + 1);
75
76 for (i = 0; i < k->pin_count; i++) {
77 if (extract32(pins_status, i, 1)) {
78 buf[i] = '*';
79 } else {
80 buf[i] = '.';
81 }
82 }
83 buf[i] = '\0';
84 trace_pca955x_gpio_status(s->description, buf);
85 }
Philippe Mathieu-Daudéd82ab292020-06-23 09:27:22 +020086 if (trace_event_get_state_backends(TRACE_PCA955X_GPIO_CHANGE)) {
87 for (i = 0; i < k->pin_count; i++) {
88 if (extract32(pins_changed, i, 1)) {
89 unsigned new_state = extract32(pins_status, i, 1);
90
91 /*
92 * We display the state using the PCA logic ("active-high").
93 * This is not the state of the LED, which signal might be
94 * wired "active-low" on the board.
95 */
96 trace_pca955x_gpio_change(s->description, i,
97 !new_state, new_state);
98 }
99 }
100 }
Philippe Mathieu-Daudéb989b892020-06-23 09:27:20 +0200101}
102
Philippe Mathieu-Daudéec172282020-06-23 09:27:17 +0200103static void pca955x_update_pin_input(PCA955xState *s)
Cédric Le Goater5141d412018-06-08 13:15:32 +0100104{
Philippe Mathieu-Daudé736132e2020-06-23 09:27:18 +0200105 PCA955xClass *k = PCA955X_GET_CLASS(s);
Cédric Le Goater5141d412018-06-08 13:15:32 +0100106 int i;
107
Philippe Mathieu-Daudé736132e2020-06-23 09:27:18 +0200108 for (i = 0; i < k->pin_count; i++) {
Cédric Le Goater5141d412018-06-08 13:15:32 +0100109 uint8_t input_reg = PCA9552_INPUT0 + (i / 8);
110 uint8_t input_shift = (i % 8);
Philippe Mathieu-Daudéec172282020-06-23 09:27:17 +0200111 uint8_t config = pca955x_pin_get_config(s, i);
Cédric Le Goater5141d412018-06-08 13:15:32 +0100112
113 switch (config) {
114 case PCA9552_LED_ON:
Philippe Mathieu-Daudé586f4952020-06-23 09:27:23 +0200115 qemu_set_irq(s->gpio[i], 1);
Cédric Le Goater5141d412018-06-08 13:15:32 +0100116 s->regs[input_reg] |= 1 << input_shift;
117 break;
118 case PCA9552_LED_OFF:
Philippe Mathieu-Daudé586f4952020-06-23 09:27:23 +0200119 qemu_set_irq(s->gpio[i], 0);
Cédric Le Goater5141d412018-06-08 13:15:32 +0100120 s->regs[input_reg] &= ~(1 << input_shift);
121 break;
122 case PCA9552_LED_PWM0:
123 case PCA9552_LED_PWM1:
124 /* TODO */
125 default:
126 break;
127 }
128 }
129}
130
Philippe Mathieu-Daudéec172282020-06-23 09:27:17 +0200131static uint8_t pca955x_read(PCA955xState *s, uint8_t reg)
Cédric Le Goater5141d412018-06-08 13:15:32 +0100132{
133 switch (reg) {
134 case PCA9552_INPUT0:
135 case PCA9552_INPUT1:
136 case PCA9552_PSC0:
137 case PCA9552_PWM0:
138 case PCA9552_PSC1:
139 case PCA9552_PWM1:
140 case PCA9552_LS0:
141 case PCA9552_LS1:
142 case PCA9552_LS2:
143 case PCA9552_LS3:
144 return s->regs[reg];
145 default:
146 qemu_log_mask(LOG_GUEST_ERROR, "%s: unexpected read to register %d\n",
147 __func__, reg);
148 return 0xFF;
149 }
150}
151
Philippe Mathieu-Daudéec172282020-06-23 09:27:17 +0200152static void pca955x_write(PCA955xState *s, uint8_t reg, uint8_t data)
Cédric Le Goater5141d412018-06-08 13:15:32 +0100153{
Philippe Mathieu-Daudéb989b892020-06-23 09:27:20 +0200154 uint16_t pins_status;
155
Cédric Le Goater5141d412018-06-08 13:15:32 +0100156 switch (reg) {
157 case PCA9552_PSC0:
158 case PCA9552_PWM0:
159 case PCA9552_PSC1:
160 case PCA9552_PWM1:
161 s->regs[reg] = data;
162 break;
163
164 case PCA9552_LS0:
165 case PCA9552_LS1:
166 case PCA9552_LS2:
167 case PCA9552_LS3:
Philippe Mathieu-Daudéb989b892020-06-23 09:27:20 +0200168 pins_status = pca955x_pins_get_status(s);
Cédric Le Goater5141d412018-06-08 13:15:32 +0100169 s->regs[reg] = data;
Philippe Mathieu-Daudéec172282020-06-23 09:27:17 +0200170 pca955x_update_pin_input(s);
Philippe Mathieu-Daudéb989b892020-06-23 09:27:20 +0200171 pca955x_display_pins_status(s, pins_status);
Cédric Le Goater5141d412018-06-08 13:15:32 +0100172 break;
173
174 case PCA9552_INPUT0:
175 case PCA9552_INPUT1:
176 default:
177 qemu_log_mask(LOG_GUEST_ERROR, "%s: unexpected write to register %d\n",
178 __func__, reg);
179 }
180}
181
182/*
183 * When Auto-Increment is on, the register address is incremented
184 * after each byte is sent to or received by the device. The index
185 * rollovers to 0 when the maximum register address is reached.
186 */
Philippe Mathieu-Daudéec172282020-06-23 09:27:17 +0200187static void pca955x_autoinc(PCA955xState *s)
Cédric Le Goater5141d412018-06-08 13:15:32 +0100188{
Philippe Mathieu-Daudé736132e2020-06-23 09:27:18 +0200189 PCA955xClass *k = PCA955X_GET_CLASS(s);
190
Cédric Le Goater5141d412018-06-08 13:15:32 +0100191 if (s->pointer != 0xFF && s->pointer & PCA9552_AUTOINC) {
192 uint8_t reg = s->pointer & 0xf;
193
Philippe Mathieu-Daudé736132e2020-06-23 09:27:18 +0200194 reg = (reg + 1) % (k->max_reg + 1);
Cédric Le Goater5141d412018-06-08 13:15:32 +0100195 s->pointer = reg | PCA9552_AUTOINC;
196 }
197}
198
Philippe Mathieu-Daudéec172282020-06-23 09:27:17 +0200199static uint8_t pca955x_recv(I2CSlave *i2c)
Cédric Le Goater5141d412018-06-08 13:15:32 +0100200{
Philippe Mathieu-Daudéec172282020-06-23 09:27:17 +0200201 PCA955xState *s = PCA955X(i2c);
Cédric Le Goater5141d412018-06-08 13:15:32 +0100202 uint8_t ret;
203
Philippe Mathieu-Daudéec172282020-06-23 09:27:17 +0200204 ret = pca955x_read(s, s->pointer & 0xf);
Cédric Le Goater5141d412018-06-08 13:15:32 +0100205
206 /*
207 * From the Specs:
208 *
209 * Important Note: When a Read sequence is initiated and the
210 * AI bit is set to Logic Level 1, the Read Sequence MUST
211 * start by a register different from 0.
212 *
213 * I don't know what should be done in this case, so throw an
214 * error.
215 */
216 if (s->pointer == PCA9552_AUTOINC) {
217 qemu_log_mask(LOG_GUEST_ERROR,
218 "%s: Autoincrement read starting with register 0\n",
219 __func__);
220 }
221
Philippe Mathieu-Daudéec172282020-06-23 09:27:17 +0200222 pca955x_autoinc(s);
Cédric Le Goater5141d412018-06-08 13:15:32 +0100223
224 return ret;
225}
226
Philippe Mathieu-Daudéec172282020-06-23 09:27:17 +0200227static int pca955x_send(I2CSlave *i2c, uint8_t data)
Cédric Le Goater5141d412018-06-08 13:15:32 +0100228{
Philippe Mathieu-Daudéec172282020-06-23 09:27:17 +0200229 PCA955xState *s = PCA955X(i2c);
Cédric Le Goater5141d412018-06-08 13:15:32 +0100230
231 /* First byte sent by is the register address */
232 if (s->len == 0) {
233 s->pointer = data;
234 s->len++;
235 } else {
Philippe Mathieu-Daudéec172282020-06-23 09:27:17 +0200236 pca955x_write(s, s->pointer & 0xf, data);
Cédric Le Goater5141d412018-06-08 13:15:32 +0100237
Philippe Mathieu-Daudéec172282020-06-23 09:27:17 +0200238 pca955x_autoinc(s);
Cédric Le Goater5141d412018-06-08 13:15:32 +0100239 }
240
241 return 0;
242}
243
Philippe Mathieu-Daudéec172282020-06-23 09:27:17 +0200244static int pca955x_event(I2CSlave *i2c, enum i2c_event event)
Cédric Le Goater5141d412018-06-08 13:15:32 +0100245{
Philippe Mathieu-Daudéec172282020-06-23 09:27:17 +0200246 PCA955xState *s = PCA955X(i2c);
Cédric Le Goater5141d412018-06-08 13:15:32 +0100247
248 s->len = 0;
249 return 0;
250}
251
Philippe Mathieu-Daudéec172282020-06-23 09:27:17 +0200252static void pca955x_get_led(Object *obj, Visitor *v, const char *name,
Joel Stanleya90d8f82020-01-30 16:02:02 +0000253 void *opaque, Error **errp)
254{
Philippe Mathieu-Daudé736132e2020-06-23 09:27:18 +0200255 PCA955xClass *k = PCA955X_GET_CLASS(obj);
Philippe Mathieu-Daudéec172282020-06-23 09:27:17 +0200256 PCA955xState *s = PCA955X(obj);
Joel Stanleya90d8f82020-01-30 16:02:02 +0000257 int led, rc, reg;
258 uint8_t state;
259
260 rc = sscanf(name, "led%2d", &led);
261 if (rc != 1) {
262 error_setg(errp, "%s: error reading %s", __func__, name);
263 return;
264 }
Philippe Mathieu-Daudé736132e2020-06-23 09:27:18 +0200265 if (led < 0 || led > k->pin_count) {
Joel Stanleya90d8f82020-01-30 16:02:02 +0000266 error_setg(errp, "%s invalid led %s", __func__, name);
267 return;
268 }
269 /*
270 * Get the LSx register as the qom interface should expose the device
271 * state, not the modeled 'input line' behaviour which would come from
272 * reading the INPUTx reg
273 */
274 reg = PCA9552_LS0 + led / 4;
Andrew Jeffery0c33a482021-09-20 08:50:59 +0200275 state = (pca955x_read(s, reg) >> ((led % 4) * 2)) & 0x3;
Joel Stanleya90d8f82020-01-30 16:02:02 +0000276 visit_type_str(v, name, (char **)&led_state[state], errp);
277}
278
279/*
280 * Return an LED selector register value based on an existing one, with
281 * the appropriate 2-bit state value set for the given LED number (0-3).
282 */
283static inline uint8_t pca955x_ledsel(uint8_t oldval, int led_num, int state)
284{
285 return (oldval & (~(0x3 << (led_num << 1)))) |
286 ((state & 0x3) << (led_num << 1));
287}
288
Philippe Mathieu-Daudéec172282020-06-23 09:27:17 +0200289static void pca955x_set_led(Object *obj, Visitor *v, const char *name,
Joel Stanleya90d8f82020-01-30 16:02:02 +0000290 void *opaque, Error **errp)
291{
Philippe Mathieu-Daudé736132e2020-06-23 09:27:18 +0200292 PCA955xClass *k = PCA955X_GET_CLASS(obj);
Philippe Mathieu-Daudéec172282020-06-23 09:27:17 +0200293 PCA955xState *s = PCA955X(obj);
Joel Stanleya90d8f82020-01-30 16:02:02 +0000294 int led, rc, reg, val;
295 uint8_t state;
296 char *state_str;
297
Markus Armbruster668f62e2020-07-07 18:06:02 +0200298 if (!visit_type_str(v, name, &state_str, errp)) {
Joel Stanleya90d8f82020-01-30 16:02:02 +0000299 return;
300 }
301 rc = sscanf(name, "led%2d", &led);
302 if (rc != 1) {
303 error_setg(errp, "%s: error reading %s", __func__, name);
304 return;
305 }
Philippe Mathieu-Daudé736132e2020-06-23 09:27:18 +0200306 if (led < 0 || led > k->pin_count) {
Joel Stanleya90d8f82020-01-30 16:02:02 +0000307 error_setg(errp, "%s invalid led %s", __func__, name);
308 return;
309 }
310
311 for (state = 0; state < ARRAY_SIZE(led_state); state++) {
312 if (!strcmp(state_str, led_state[state])) {
313 break;
314 }
315 }
316 if (state >= ARRAY_SIZE(led_state)) {
317 error_setg(errp, "%s invalid led state %s", __func__, state_str);
318 return;
319 }
320
321 reg = PCA9552_LS0 + led / 4;
Philippe Mathieu-Daudéec172282020-06-23 09:27:17 +0200322 val = pca955x_read(s, reg);
Joel Stanleya90d8f82020-01-30 16:02:02 +0000323 val = pca955x_ledsel(val, led % 4, state);
Philippe Mathieu-Daudéec172282020-06-23 09:27:17 +0200324 pca955x_write(s, reg, val);
Joel Stanleya90d8f82020-01-30 16:02:02 +0000325}
326
Cédric Le Goater5141d412018-06-08 13:15:32 +0100327static const VMStateDescription pca9552_vmstate = {
328 .name = "PCA9552",
329 .version_id = 0,
330 .minimum_version_id = 0,
331 .fields = (VMStateField[]) {
Philippe Mathieu-Daudéec172282020-06-23 09:27:17 +0200332 VMSTATE_UINT8(len, PCA955xState),
333 VMSTATE_UINT8(pointer, PCA955xState),
334 VMSTATE_UINT8_ARRAY(regs, PCA955xState, PCA955X_NR_REGS),
335 VMSTATE_I2C_SLAVE(i2c, PCA955xState),
Cédric Le Goater5141d412018-06-08 13:15:32 +0100336 VMSTATE_END_OF_LIST()
337 }
338};
339
340static void pca9552_reset(DeviceState *dev)
341{
Philippe Mathieu-Daudéec172282020-06-23 09:27:17 +0200342 PCA955xState *s = PCA955X(dev);
Cédric Le Goater5141d412018-06-08 13:15:32 +0100343
344 s->regs[PCA9552_PSC0] = 0xFF;
345 s->regs[PCA9552_PWM0] = 0x80;
346 s->regs[PCA9552_PSC1] = 0xFF;
347 s->regs[PCA9552_PWM1] = 0x80;
348 s->regs[PCA9552_LS0] = 0x55; /* all OFF */
349 s->regs[PCA9552_LS1] = 0x55;
350 s->regs[PCA9552_LS2] = 0x55;
351 s->regs[PCA9552_LS3] = 0x55;
352
Philippe Mathieu-Daudéec172282020-06-23 09:27:17 +0200353 pca955x_update_pin_input(s);
Cédric Le Goater5141d412018-06-08 13:15:32 +0100354
355 s->pointer = 0xFF;
356 s->len = 0;
357}
358
Philippe Mathieu-Daudéec172282020-06-23 09:27:17 +0200359static void pca955x_initfn(Object *obj)
Cédric Le Goater5141d412018-06-08 13:15:32 +0100360{
Philippe Mathieu-Daudé736132e2020-06-23 09:27:18 +0200361 PCA955xClass *k = PCA955X_GET_CLASS(obj);
Joel Stanleya90d8f82020-01-30 16:02:02 +0000362 int led;
Cédric Le Goater5141d412018-06-08 13:15:32 +0100363
Philippe Mathieu-Daudé736132e2020-06-23 09:27:18 +0200364 assert(k->pin_count <= PCA955X_PIN_COUNT_MAX);
365 for (led = 0; led < k->pin_count; led++) {
Joel Stanleya90d8f82020-01-30 16:02:02 +0000366 char *name;
367
368 name = g_strdup_printf("led%d", led);
Philippe Mathieu-Daudéec172282020-06-23 09:27:17 +0200369 object_property_add(obj, name, "bool", pca955x_get_led, pca955x_set_led,
Markus Armbrusterd2623122020-05-05 17:29:22 +0200370 NULL, NULL);
Joel Stanleya90d8f82020-01-30 16:02:02 +0000371 g_free(name);
372 }
Cédric Le Goater5141d412018-06-08 13:15:32 +0100373}
374
Philippe Mathieu-Daudé2df252d2020-06-23 09:27:19 +0200375static void pca955x_realize(DeviceState *dev, Error **errp)
376{
Philippe Mathieu-Daudé586f4952020-06-23 09:27:23 +0200377 PCA955xClass *k = PCA955X_GET_CLASS(dev);
Philippe Mathieu-Daudé2df252d2020-06-23 09:27:19 +0200378 PCA955xState *s = PCA955X(dev);
379
380 if (!s->description) {
381 s->description = g_strdup("pca-unspecified");
382 }
Philippe Mathieu-Daudé586f4952020-06-23 09:27:23 +0200383
384 qdev_init_gpio_out(dev, s->gpio, k->pin_count);
Philippe Mathieu-Daudé2df252d2020-06-23 09:27:19 +0200385}
386
387static Property pca955x_properties[] = {
388 DEFINE_PROP_STRING("description", PCA955xState, description),
389 DEFINE_PROP_END_OF_LIST(),
390};
391
Philippe Mathieu-Daudé736132e2020-06-23 09:27:18 +0200392static void pca955x_class_init(ObjectClass *klass, void *data)
Cédric Le Goater5141d412018-06-08 13:15:32 +0100393{
Philippe Mathieu-Daudé2df252d2020-06-23 09:27:19 +0200394 DeviceClass *dc = DEVICE_CLASS(klass);
Cédric Le Goater5141d412018-06-08 13:15:32 +0100395 I2CSlaveClass *k = I2C_SLAVE_CLASS(klass);
396
Philippe Mathieu-Daudéec172282020-06-23 09:27:17 +0200397 k->event = pca955x_event;
398 k->recv = pca955x_recv;
399 k->send = pca955x_send;
Philippe Mathieu-Daudé2df252d2020-06-23 09:27:19 +0200400 dc->realize = pca955x_realize;
401 device_class_set_props(dc, pca955x_properties);
Philippe Mathieu-Daudé736132e2020-06-23 09:27:18 +0200402}
403
404static const TypeInfo pca955x_info = {
405 .name = TYPE_PCA955X,
406 .parent = TYPE_I2C_SLAVE,
407 .instance_init = pca955x_initfn,
408 .instance_size = sizeof(PCA955xState),
409 .class_init = pca955x_class_init,
Philippe Mathieu-Daudéfc1bff92020-06-29 09:47:04 +0200410 .class_size = sizeof(PCA955xClass),
Philippe Mathieu-Daudé736132e2020-06-23 09:27:18 +0200411 .abstract = true,
412};
413
414static void pca9552_class_init(ObjectClass *oc, void *data)
415{
416 DeviceClass *dc = DEVICE_CLASS(oc);
417 PCA955xClass *pc = PCA955X_CLASS(oc);
418
Cédric Le Goater5141d412018-06-08 13:15:32 +0100419 dc->reset = pca9552_reset;
420 dc->vmsd = &pca9552_vmstate;
Philippe Mathieu-Daudé736132e2020-06-23 09:27:18 +0200421 pc->max_reg = PCA9552_LS3;
422 pc->pin_count = 16;
Cédric Le Goater5141d412018-06-08 13:15:32 +0100423}
424
425static const TypeInfo pca9552_info = {
426 .name = TYPE_PCA9552,
Philippe Mathieu-Daudé736132e2020-06-23 09:27:18 +0200427 .parent = TYPE_PCA955X,
Cédric Le Goater5141d412018-06-08 13:15:32 +0100428 .class_init = pca9552_class_init,
429};
430
Philippe Mathieu-Daudéec172282020-06-23 09:27:17 +0200431static void pca955x_register_types(void)
Cédric Le Goater5141d412018-06-08 13:15:32 +0100432{
Philippe Mathieu-Daudé736132e2020-06-23 09:27:18 +0200433 type_register_static(&pca955x_info);
Cédric Le Goater5141d412018-06-08 13:15:32 +0100434 type_register_static(&pca9552_info);
435}
436
Philippe Mathieu-Daudéec172282020-06-23 09:27:17 +0200437type_init(pca955x_register_types)