1 // SPDX-License-Identifier: GPL-2.0-or-later
3 * Copyright 2011 Florian Tobias Schandinat <FlorianSchandinat@gmx.de>
6 * infrastructure for devices connected via I2C
9 #include <linux/slab.h>
13 struct via_aux_bus
*via_aux_probe(struct i2c_adapter
*adap
)
15 struct via_aux_bus
*bus
;
20 bus
= kmalloc(sizeof(*bus
), GFP_KERNEL
);
25 INIT_LIST_HEAD(&bus
->drivers
);
27 via_aux_edid_probe(bus
);
28 via_aux_vt1636_probe(bus
);
29 via_aux_vt1632_probe(bus
);
30 via_aux_vt1631_probe(bus
);
31 via_aux_vt1625_probe(bus
);
32 via_aux_vt1622_probe(bus
);
33 via_aux_vt1621_probe(bus
);
34 via_aux_sii164_probe(bus
);
35 via_aux_ch7301_probe(bus
);
40 void via_aux_free(struct via_aux_bus
*bus
)
42 struct via_aux_drv
*pos
, *n
;
47 list_for_each_entry_safe(pos
, n
, &bus
->drivers
, chain
) {
51 list_del(&pos
->chain
);
59 const struct fb_videomode
*via_aux_get_preferred_mode(struct via_aux_bus
*bus
)
61 struct via_aux_drv
*pos
;
62 const struct fb_videomode
*mode
= NULL
;
67 list_for_each_entry(pos
, &bus
->drivers
, chain
) {
68 if (pos
->get_preferred_mode
)
69 mode
= pos
->get_preferred_mode(pos
);