History log of /drivers/video/via/via_i2c.c
Revision Date Author Comments
2c4c8a8a73b64a8ea86ad85d8a59a5914d2f81ea 30-Dec-2011 Florian Tobias Schandinat <FlorianSchandinat@gmx.de> viafb: fix I2C emulation on GPIO ports

This patch fixes the I2C emulation on GPIO ports by enabling it
(software controlled) and disabling the output on a GPIO line before
reading it.

Signed-off-by: Florian Tobias Schandinat <FlorianSchandinat@gmx.de>
23e5abd5555b86fd56af6383e7a832b0cf2a2d95 03-Mar-2011 Stephen Hemminger <shemminger@vyatta.com> video via: make local variables static

Many local variables should be declared static.
Found by sparse, compile tested only.

Signed-off-by: Stephen Hemminger <shemminger@vyatta.com>
Signed-off-by: Florian Tobias Schandinat <FlorianSchandinat@gmx.de>
a625e305edd8e3ac08888a9b52981205b68cdb0e 25-Jan-2011 Peter Huewe <peterhuewe@gmx.de> video/via: drop deprecated (and unused) i2c_adapter.id

This patch removes an assignment to the deprecated i2c_adapter.id
field. Since the field isn't used anywhere else in the driver it is
save to remove it.

Signed-off-by: Peter Huewe <peterhuewe@gmx.de>
Acked-by: Jean Delvare <khali@linux-fr.org>
Signed-off-by: Florian Tobias Schandinat <FlorianSchandinat@gmx.de>
e029ab0d02b94d633d8e82a46dfdb7fd94a62216 17-Sep-2010 Florian Tobias Schandinat <FlorianSchandinat@gmx.de> viafb: reduce I2C timeout and delay

This patch reduces the value for I2C timeout and udelay.
The udelay was reduced to 10 (old: 40) which is still very high as for
standard-mode I2C even 5 should work. This gives a speedup of factor 4
when talking to I2C devices.
The timeout was reduced to 2 (old: 20) which is taken from the radeon
driver so it should work as well. This gives a speedup of factor 10 when
detecting that there is no I2C device we want to talk to.
This causes a huge improvement of device initialization time.

Signed-off-by: Florian Tobias Schandinat <FlorianSchandinat@gmx.de>
Acked-by: Jonathan Corbet <corbet@lwn.net>
Cc: Joseph Chan <JosephChan@via.com.tw>
85c5702ac046b14713f776d59768252d8ed8018f 17-Sep-2010 Florian Tobias Schandinat <FlorianSchandinat@gmx.de> viafb: fix i2c_transfer error handling

i2c_transfer returns negative errno on error and number of messages
processed on success. Just returning this value would give a poor
interface as it is not obvious that you must compare with 2 after reading
1 or n bytes and with 1 after writing 1 byte to determine if it was
successful. To avoid this error prone interface convert the error code
of a successful read/write to zero and all other non-negative values to
an negative error code.
This fixes a regression introduced by
via: Rationalize vt1636 detection
which resulted in no longer detecting a VT1636 chip and therefore has
broken the output in configurations which contain this chip.

Signed-off-by: Florian Tobias Schandinat <FlorianSchandinat@gmx.de>
Acked-by: Jonathan Corbet <corbet@lwn.net>
Cc: Joseph Chan <JosephChan@via.com.tw>
Cc: stable@kernel.org
ec66841e495b9ab4f92bdf91efe8cf56e1471fbd 05-May-2010 Jonathan Corbet <corbet@lwn.net> viafb: move some include files to include/linux

These are the files which should be available to subdevices compiled
outside of drivers/video/via.

Cc: ScottFang@viatech.com.cn
Cc: JosephChan@via.com.tw
Cc: Harald Welte <laforge@gnumonks.org>
Acked-by: Florian Tobias Schandinat <FlorianSchandinat@gmx.de>
Signed-off-by: Jonathan Corbet <corbet@lwn.net>
9221fc6556d6fa14b5c61050dd87e26fc4ad255c 05-May-2010 Jonathan Corbet <corbet@lwn.net> viafb: Eliminate some global.h references

The various subdev drivers (other than the framebuffer itself) no longer
need this file.

Cc: ScottFang@viatech.com.cn
Cc: JosephChan@via.com.tw
Cc: Harald Welte <laforge@gnumonks.org>
Acked-by: Florian Tobias Schandinat <FlorianSchandinat@gmx.de>
Signed-off-by: Jonathan Corbet <corbet@lwn.net>
4a28ea9cedaa673b8a1a7f84628d784d020f3b47 05-May-2010 Jonathan Corbet <corbet@lwn.net> viafb: get rid of i2c debug cruft

It's ugly and adds a global.h dependency.

Cc: ScottFang@viatech.com.cn
Cc: JosephChan@via.com.tw
Cc: Harald Welte <laforge@gnumonks.org>
Acked-by: Florian Tobias Schandinat <FlorianSchandinat@gmx.de>
Signed-off-by: Jonathan Corbet <corbet@lwn.net>
b8f7e5d846387e3bcda35f3809856cf085740a24 23-Apr-2010 Jonathan Corbet <corbet@lwn.net> viafb: Introduce viafb_find_i2c_adapter()

The camera driver will need this to look up a specific adapter.

Cc: ScottFang@viatech.com.cn
Cc: JosephChan@via.com.tw
Cc: Harald Welte <laforge@gnumonks.org>
Acked-by: Florian Tobias Schandinat <FlorianSchandinat@gmx.de>
Signed-off-by: Jonathan Corbet <corbet@lwn.net>
b052d7f81fdd352a5d89ef1ac37a2c77f219463b 28-Dec-2009 Jonathan Corbet <corbet@lwn.net> via: Do not attempt I/O on inactive I2C adapters

If an adapter has been configured for GPIO (or off), we should not try to
use it as an I2C port.

Cc: ScottFang@viatech.com.cn
Cc: JosephChan@via.com.tw
Cc: Harald Welte <laforge@gnumonks.org>
Acked-by: Florian Tobias Schandinat <FlorianSchandinat@gmx.de>
Signed-off-by: Jonathan Corbet <corbet@lwn.net>
7582eb9be85f35271fd2569681a88a5b243e9380 23-Apr-2010 Jonathan Corbet <corbet@lwn.net> viafb: Turn GPIO and i2c into proper platform devices

Another step toward making this thing a real multifunction device driver.

Cc: ScottFang@viatech.com.cn
Cc: JosephChan@via.com.tw
Cc: Harald Welte <laforge@gnumonks.org>
Acked-by: Florian Tobias Schandinat <FlorianSchandinat@gmx.de>
Signed-off-by: Jonathan Corbet <corbet@lwn.net>
75b035ace904761b8a340b524533a36e37313b29 22-Apr-2010 Jonathan Corbet <corbet@lwn.net> viafb: Convert GPIO and i2c to the new indexed port ops

Also add low-level locking to the i2c driver.

Signed-off-by: Jonathan Corbet <corbet@lwn.net>
24b4d82e4715841848a499534ed5cb7db3d6bca3 22-Apr-2010 Jonathan Corbet <corbet@lwn.net> viafb: Separate global and fb-specific data

This patch moves data of interest into a new viafb_dev structure which
describes the device as a whole; the idea here is to create a separation
between what all devices may need and what the framebuffer device in
particular needs.

I've also made some small steps toward thinning out the global.h mess.

Cc: ScottFang@viatech.com.cn
Cc: JosephChan@via.com.tw
Cc: Harald Welte <laforge@gnumonks.org>
Acked-by: Florian Tobias Schandinat <FlorianSchandinat@gmx.de>
Signed-off-by: Jonathan Corbet <corbet@lwn.net>
f045f77bc0bf238a871b10bea9e425329a8e4abc 02-Dec-2009 Jonathan Corbet <corbet@lwn.net> viafb: Move core stuff into via-core.c

The first step toward turning viafb into a multifunction driver. This
patch creates a new via-core.c file which serves as the main PCI driver;
everything else comes below that. Some work has been done to rationalize
the i2c drivers in this new scheme.

Cc: ScottFang@viatech.com.cn
Cc: JosephChan@via.com.tw
Cc: Harald Welte <laforge@gnumonks.org>
Acked-by: Florian Tobias Schandinat <FlorianSchandinat@gmx.de>
Signed-off-by: Jonathan Corbet <corbet@lwn.net>
4da62e6c6e056d709e5dc04ac7c5e81692cf924f 25-Apr-2010 Jonathan Corbet <corbet@lwn.net> viafb: Only establish i2c busses on ports that always had them

...otherwise it seems we run into conflicts with shadowy other users which
don't expect to see i2c taking control of ports it never used to do
anything with.

Reported-by: Florian Tobias Schandinat <FlorianSchandinat@gmx.de>
Signed-off-by: Jonathan Corbet <corbet@lwn.net>
c774c13dd2826eb91ab6396fd8501df2fc2d83b3 07-Oct-2009 Paul Fox <pgf@laptop.org> suppress verbose debug messages: change printk() to DEBUG_MSG()

[jc: no signoff, added my own]
Cc: Florian Tobias Schandinat <FlorianSchandinat@gmx.de>
Cc: ScottFang@viatech.com.cn
Cc: JosephChan@via.com.tw
Signed-off-by: Jonathan Corbet <corbet@lwn.net>
277d32a36cba0b42c9c6836ff07f9b978566e95c 22-May-2009 Harald Welte <laforge@gnumonks.org> viafb: rework the I2C support in the VIA framebuffer driver

This patch changes the way how the various I2C busses are used internally
inside the viafb driver: Previosuly, only a single i2c_adapter was created,
even though two different hardware I2C busses are accessed: A structure member
in a global variable was modified to indicate the bus to be used.

Now, all existing hardware busses are registered with the i2c core, and the
viafb_i2c_{read,write}byte[s]() function take the adapter number as function
call parameter, rather than referring to the global structure member.

[jc: even more painful merge with mainline changes ->2.6.34]
[jc: painful merge with OLPC changes]

Cc: Florian Tobias Schandinat <FlorianSchandinat@gmx.de>
Cc: ScottFang@viatech.com.cn
Cc: JosephChan@via.com.tw
Signed-off-by: Harald Welte <HaraldWelte@viatech.com>
Signed-off-by: Jonathan Corbet <corbet@lwn.net>
c4df5489e40e55f2962b9e8100ebc0d4d1374415 23-Sep-2009 Florian Tobias Schandinat <FlorianSchandinat@gmx.de> viafb: improve viafb_par

This patch introduces viafb_shared and is the beginning of a smooth
transition to use it.

viafb_shared should contain all general, non-surface specific data that
should be shared along all viafb framebuffers while viafb_par should only
contain things that are specific to each surface or in other words extend
fb_info. This change is intended to clean the dual/multi framebuffer
handling up.

This removes the annoyance that viafbinfo1->par points to a different
structure than viaparinfo1.

As the last change is fundamental it is difficult to ensure that all parts
of the driver do not depend on the previous brokenness but the chance of
regressions is very low.

Signed-off-by: Florian Tobias Schandinat <FlorianSchandinat@gmx.de>
Cc: Scott Fang <ScottFang@viatech.com.cn>
Cc: Joseph Chan <JosephChan@via.com.tw>
Cc: Harald Welte <laforge@gnumonks.org>
Cc: Jonathan Corbet <corbet@lwn.net>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
9f291634aa2d79dee2d8a61c5bdffe166001c580 16-Oct-2008 Joseph Chan <JosephChan@via.com.tw> viafb: via_i2c.c, via_i2c.h, viamode.c, viamode.h

via_i2c.c, via_i2c.h: Implement i2c specification.
viamode.c, viamode.c: all support modes information.

Signed-off-by: Joseph Chan <josephchan@via.com.tw>
Cc: Krzysztof Helt <krzysztof.h1@poczta.fm>
Cc: Geert Uytterhoeven <geert@linux-m68k.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>