2 * Copyright 2011 Florian Tobias Schandinat <FlorianSchandinat@gmx.de>
4 * This program is free software; you can redistribute it and/or
5 * modify it under the terms of the GNU General Public
6 * License as published by the Free Software Foundation;
7 * either version 2, or (at your option) any later version.
9 * This program is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTIES OR REPRESENTATIONS; without even
11 * the implied warranty of MERCHANTABILITY or FITNESS FOR
12 * A PARTICULAR PURPOSE.See the GNU General Public License
15 * You should have received a copy of the GNU General Public License
16 * along with this program; if not, write to the Free Software
18 * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
21 * infrastructure for devices connected via I2C
24 #include <linux/slab.h>
28 struct via_aux_bus
*via_aux_probe(struct i2c_adapter
*adap
)
30 struct via_aux_bus
*bus
;
35 bus
= kmalloc(sizeof(*bus
), GFP_KERNEL
);
40 INIT_LIST_HEAD(&bus
->drivers
);
42 via_aux_edid_probe(bus
);
43 via_aux_vt1636_probe(bus
);
44 via_aux_vt1632_probe(bus
);
45 via_aux_vt1631_probe(bus
);
46 via_aux_vt1625_probe(bus
);
47 via_aux_vt1622_probe(bus
);
48 via_aux_vt1621_probe(bus
);
49 via_aux_sii164_probe(bus
);
50 via_aux_ch7301_probe(bus
);
55 void via_aux_free(struct via_aux_bus
*bus
)
57 struct via_aux_drv
*pos
, *n
;
62 list_for_each_entry_safe(pos
, n
, &bus
->drivers
, chain
) {
66 list_del(&pos
->chain
);
74 const struct fb_videomode
*via_aux_get_preferred_mode(struct via_aux_bus
*bus
)
76 struct via_aux_drv
*pos
;
77 const struct fb_videomode
*mode
= NULL
;
82 list_for_each_entry(pos
, &bus
->drivers
, chain
) {
83 if (pos
->get_preferred_mode
)
84 mode
= pos
->get_preferred_mode(pos
);