1e75892715db800ee96fe4ac0407b73b57d866a68Florian Tobias Schandinat/*
2e75892715db800ee96fe4ac0407b73b57d866a68Florian Tobias Schandinat * Copyright 2011 Florian Tobias Schandinat <FlorianSchandinat@gmx.de>
3e75892715db800ee96fe4ac0407b73b57d866a68Florian Tobias Schandinat *
4e75892715db800ee96fe4ac0407b73b57d866a68Florian Tobias Schandinat * This program is free software; you can redistribute it and/or
5e75892715db800ee96fe4ac0407b73b57d866a68Florian Tobias Schandinat * modify it under the terms of the GNU General Public
6e75892715db800ee96fe4ac0407b73b57d866a68Florian Tobias Schandinat * License as published by the Free Software Foundation;
7e75892715db800ee96fe4ac0407b73b57d866a68Florian Tobias Schandinat * either version 2, or (at your option) any later version.
8e75892715db800ee96fe4ac0407b73b57d866a68Florian Tobias Schandinat *
9e75892715db800ee96fe4ac0407b73b57d866a68Florian Tobias Schandinat * This program is distributed in the hope that it will be useful,
10e75892715db800ee96fe4ac0407b73b57d866a68Florian Tobias Schandinat * but WITHOUT ANY WARRANTIES OR REPRESENTATIONS; without even
11e75892715db800ee96fe4ac0407b73b57d866a68Florian Tobias Schandinat * the implied warranty of MERCHANTABILITY or FITNESS FOR
12e75892715db800ee96fe4ac0407b73b57d866a68Florian Tobias Schandinat * A PARTICULAR PURPOSE.See the GNU General Public License
13e75892715db800ee96fe4ac0407b73b57d866a68Florian Tobias Schandinat * for more details.
14e75892715db800ee96fe4ac0407b73b57d866a68Florian Tobias Schandinat *
15e75892715db800ee96fe4ac0407b73b57d866a68Florian Tobias Schandinat * You should have received a copy of the GNU General Public License
16e75892715db800ee96fe4ac0407b73b57d866a68Florian Tobias Schandinat * along with this program; if not, write to the Free Software
17e75892715db800ee96fe4ac0407b73b57d866a68Florian Tobias Schandinat * Foundation, Inc.,
18e75892715db800ee96fe4ac0407b73b57d866a68Florian Tobias Schandinat * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
19e75892715db800ee96fe4ac0407b73b57d866a68Florian Tobias Schandinat */
20e75892715db800ee96fe4ac0407b73b57d866a68Florian Tobias Schandinat/*
21e75892715db800ee96fe4ac0407b73b57d866a68Florian Tobias Schandinat * driver for VIA VT1636 LVDS Transmitter
22e75892715db800ee96fe4ac0407b73b57d866a68Florian Tobias Schandinat */
23e75892715db800ee96fe4ac0407b73b57d866a68Florian Tobias Schandinat
24e75892715db800ee96fe4ac0407b73b57d866a68Florian Tobias Schandinat#include <linux/slab.h>
25e75892715db800ee96fe4ac0407b73b57d866a68Florian Tobias Schandinat#include "via_aux.h"
26e75892715db800ee96fe4ac0407b73b57d866a68Florian Tobias Schandinat
27e75892715db800ee96fe4ac0407b73b57d866a68Florian Tobias Schandinat
28e75892715db800ee96fe4ac0407b73b57d866a68Florian Tobias Schandinatstatic const char *name = "VT1636 LVDS Transmitter";
29e75892715db800ee96fe4ac0407b73b57d866a68Florian Tobias Schandinat
30e75892715db800ee96fe4ac0407b73b57d866a68Florian Tobias Schandinat
31e75892715db800ee96fe4ac0407b73b57d866a68Florian Tobias Schandinatvoid via_aux_vt1636_probe(struct via_aux_bus *bus)
32e75892715db800ee96fe4ac0407b73b57d866a68Florian Tobias Schandinat{
33e75892715db800ee96fe4ac0407b73b57d866a68Florian Tobias Schandinat	struct via_aux_drv drv = {
34e75892715db800ee96fe4ac0407b73b57d866a68Florian Tobias Schandinat		.bus	=	bus,
35e75892715db800ee96fe4ac0407b73b57d866a68Florian Tobias Schandinat		.addr	=	0x40,
36e75892715db800ee96fe4ac0407b73b57d866a68Florian Tobias Schandinat		.name	=	name};
37e75892715db800ee96fe4ac0407b73b57d866a68Florian Tobias Schandinat	/* check vendor id and device id */
38e75892715db800ee96fe4ac0407b73b57d866a68Florian Tobias Schandinat	const u8 id[] = {0x06, 0x11, 0x45, 0x33}, len = ARRAY_SIZE(id);
39e75892715db800ee96fe4ac0407b73b57d866a68Florian Tobias Schandinat	u8 tmp[len];
40e75892715db800ee96fe4ac0407b73b57d866a68Florian Tobias Schandinat
41e75892715db800ee96fe4ac0407b73b57d866a68Florian Tobias Schandinat	if (!via_aux_read(&drv, 0x00, tmp, len) || memcmp(id, tmp, len))
42e75892715db800ee96fe4ac0407b73b57d866a68Florian Tobias Schandinat		return;
43e75892715db800ee96fe4ac0407b73b57d866a68Florian Tobias Schandinat
44e75892715db800ee96fe4ac0407b73b57d866a68Florian Tobias Schandinat	printk(KERN_INFO "viafb: Found %s\n", name);
45e75892715db800ee96fe4ac0407b73b57d866a68Florian Tobias Schandinat	via_aux_add(&drv);
46e75892715db800ee96fe4ac0407b73b57d866a68Florian Tobias Schandinat}
47