07 Jan, 2012
1 commit
-
This resolves the conflict in the arch/arm/mach-s3c64xx/s3c6400.c file,
and it fixes the build error in the arch/x86/kernel/microcode_core.c
file, that the merge did not catch.The microcode_core.c patch was provided by Stephen Rothwell
who was invaluable in the merge issues involved
with the large sysdev removal process in the driver-core tree.Signed-off-by: Greg Kroah-Hartman
23 Nov, 2011
1 commit
-
Last piece of code using ANY_I2C_BUS was deleted almost 2 years ago,
so ANY_I2C_BUS can go away as well.Signed-off-by: Jean Delvare
18 Nov, 2011
1 commit
-
This patch introduces the module_i2c_driver macro which is a convenience macro
for I2C driver modules similar to module_platform_driver. It is intended to be
used by drivers which init/exit section does nothing but register/unregister
the I2C driver. By using this macro it is possible to eliminate a few lines of
boilerplate code per I2C driver.Signed-off-by: Lars-Peter Clausen
Acked-by: Grant Likely
Acked-by: Jonathan Cameron
Acked-by: Wolfram Sang
Acked-by: Jean Delvare
Signed-off-by: Greg Kroah-Hartman
01 Nov, 2011
2 commits
-
The pretty much brings in the kitchen sink along
with it, so it should be avoided wherever reasonably possible in
terms of being included from other commonly used
files, as it results in a measureable increase on compile times.The worst culprit was probably device.h since it is used everywhere.
This file also had an implicit dependency/usage of mutex.h which was
masked by module.h, and is also fixed here at the same time.There are over a dozen other headers that simply declare the
struct instead of pulling in the whole file, so follow their lead
and simply make it a few more.Most of the implicit dependencies on module.h being present by
these headers pulling it in have been now weeded out, so we can
finally make this change with hopefully minimal breakage.Signed-off-by: Paul Gortmaker
-
The original implementations reference THIS_MODULE in an inline.
We could include , but it is better to avoid chaining.Fortunately someone else already thought of this, and made a similar
inline into a #define in for device_schedule_callback(),
[see commit 523ded71de0] so follow that precedent here.Also bubble up any __must_check that were used on the prev. wrapper inline
functions up one to the real __register functions, to preserve any prev.
sanity checks that were used in those instances.Signed-off-by: Paul Gortmaker
30 Oct, 2011
1 commit
-
Reimplemented at least 17 times discounting error mangling cases
where it could be used.Signed-off-by: Jonathan Cameron
Signed-off-by: Jean Delvare
26 May, 2011
1 commit
-
While the JC42-compatible chips are temperature sensors, I2C_CLASS_SPD
makes more sense because these chips always live on memory modules.Signed-off-by: Jean Delvare
Cc: Guenter Roeck
20 Mar, 2011
5 commits
-
There is no user left of i2c_adapter.id, so we can get rid of it.
Finally! :)Signed-off-by: Jean Delvare
-
The last legitimate user of i2c_driver.attach_adapter and
.detach_adapter is gone, so we can finally deprecate these callbacks.
The last few drivers which still use these will have to be updated to
make use of standard I2C device instantiation ways instead.Signed-off-by: Jean Delvare
-
Introduce i2c_for_each_dev(), an i2c device iterator with proper
locking for use by i2c-dev. This is needed so that we can get rid of
the attach_adapter and detach_adapter legacy callback functions.Signed-off-by: Jean Delvare
-
The last remaining ID in is no longer used anywhere,
so we can finally get rid of it.Signed-off-by: Jean Delvare
-
Rename the parameter of i2c_get_adapter() to "nr", to make it clear we
are passing an adapter number and not an adapter ID (which have gone
away by now.)Signed-off-by: Jean Delvare
22 Jan, 2011
1 commit
-
Having conditional around the of_match_table and the of_node pointers
turns out to make driver code use ugly #ifdef blocks. Drop the
conditionals and remove the #ifdef blocks from the affected drivers.Also tidy up minor whitespace issues within the same hunks.
Signed-off-by: Grant Likely
Acked-by: Greg Kroah-Hartman
11 Jan, 2011
1 commit
-
Helper functions for I2C and SMBus transactions don't modify the
i2c_client that is passed to them, so it can be marked const.Signed-off-by: Jean Delvare
16 Nov, 2010
1 commit
-
It's about time to make it clear that i2c_adapter.id is deprecated.
Hopefully this will remind the last user to move over to a different
strategy.Signed-off-by: Jean Delvare
Acked-by: Jarod Wilson
Acked-by: Mauro Carvalho Chehab
Acked-by: Hans Verkuil
01 Nov, 2010
1 commit
-
There are no users left for I2C_CLASS_TV_ANALOG and
I2C_CLASS_TV_DIGITAL, so we can get rid of them.Signed-off-by: Jean Delvare
25 Oct, 2010
2 commits
-
This makes the calling site's code clearer IMHO.
Signed-off-by: Jean Delvare
Acked-by: Michael Lawnick -
Only i2c devices can have their type set to i2c_adapter_type, so
testing the bus type is redundant.Signed-off-by: Jean Delvare
Cc: Michael Lawnick
12 Aug, 2010
5 commits
-
Add multiplexed bus core support. I2C multiplexer and switches
like pca954x get instantiated as new adapters per port.Signed-off-by: Michael Lawnick
Acked-by: Rodolfo Giometti
Signed-off-by: Jean Delvare -
Moving userspace-instantiated clients to separate lists wasn't nearly
enough to avoid deadlocks in multiplexed bus cases. We also want to
have a dedicated mutex to protect each list.Signed-off-by: Jean Delvare
Cc: Michael Lawnick -
Uninline i2c adapter locking helper functions, move them to i2c-core,
and use them in i2c-core itself. The functions are still exported for
external users. This makes future updates to the locking model (which
will be needed for multiplexing support) possible and transparent.Signed-off-by: Jean Delvare
Cc: Michael Lawnick -
Now that i2c-core offers the possibility to provide custom probing
function for I2C devices, let's make use of it.Signed-off-by: Jean Delvare
Acked-by: Mauro Carvalho Chehab -
The probe method used by i2c_new_probed_device() may not be suitable
for all cases. Let the caller provide its own, optional probe
function.Signed-off-by: Jean Delvare
Acked-by: Mauro Carvalho Chehab
11 Aug, 2010
1 commit
-
Fix kernel-doc warnings in linux/i2c.h:
Warning(include/linux/i2c.h:176): No description found for parameter 'alert'
Warning(include/linux/i2c.h:259): No description found for parameter 'of_node'Signed-off-by: Randy Dunlap
Signed-off-by: Linus Torvalds
22 May, 2010
1 commit
-
Merging in current state of Linus' tree to deal with merge conflicts and
build failures in vio.c after merge.Conflicts:
drivers/i2c/busses/i2c-cpm.c
drivers/i2c/busses/i2c-mpc.c
drivers/net/gianfar.cAlso fixed up one line in arch/powerpc/kernel/vio.c to use the
correct node pointer.Signed-off-by: Grant Likely
04 May, 2010
1 commit
-
Using a single list for all userspace devices leads to a dead lock
on multiplexed buses in some circumstances (mux chip instantiated
from userspace). This is solved by using a separate list for each
bus segment.Signed-off-by: Jean Delvare
Acked-by: Michael Lawnick
29 Apr, 2010
1 commit
-
The struct device_node *of_node pointer is moving out of dev->archdata
and into the struct device proper. of_i2c.c needs to set the of_node
pointer before the device is registered. Since the i2c subsystem
doesn't allow 2 stage allocation and registration of i2c devices, the
of_node pointer needs to be passed via the i2c_board_info structure
so that it is set prior to registration.This patch adds of_node to struct i2c_board_info (conditional on
CONFIG_OF), sets of_node in i2c_new_device(), and modifies of_i2c.c
to use the new parameter. The calling of dev_archdata_set_node()
from of_i2c will be removed in a subsequent patch when of_node is
removed from archdata and all users are converted over.Signed-off-by: Grant Likely
02 Mar, 2010
2 commits
-
i2c_master_send & i2c_master_recv do not support more than 64 kb
transfer, since msg.len is u16.Signed-off-by: Zhangfei Gao
Signed-off-by: Jean Delvare -
SMBus alert support. The SMBus alert protocol allows several SMBus
slave devices to share a single interrupt pin on the SMBus master,
while still allowing the master to know which slave triggered the
interrupt.This is based on preliminary work by David Brownell. The key
difference between David's implementation and mine is that his was
part of i2c-core, while mine is split into a separate, standalone
module named i2c-smbus. The i2c-smbus module is meant to include
support for all SMBus extensions to the I2C protocol in the future.The benefit of this approach is a zero cost for I2C bus segments which
do not need SMBus alert support. Where David's implementation
increased the size of struct i2c_adapter by 7% (40 bytes on i386),
mine doesn't touch it. Where David's implementation added over 150
lines of code to i2c-core (+10%), mine doesn't touch it. The only
change that touches all the users of the i2c subsystem is a new
callback in struct i2c_driver (common to both implementations.) I seem
to remember Trent was worried about the footprint of David'd
implementation, hopefully mine addresses the issue.Signed-off-by: Jean Delvare
Acked-by: Jonathan Cameron
Cc: David Brownell
Cc: Trent Piepho
15 Dec, 2009
5 commits
-
There is no user left of I2C_CLIENT_MODULE_PARM, so we can finally
get rid of this ugly macro.Signed-off-by: Jean Delvare
Tested-by: Wolfram Sang -
These macros simply declare an enum, so drivers might as well declare
it themselves. This puts an end to the arbitrary limit of 8 chip types
per i2c driver.Signed-off-by: Jean Delvare
Tested-by: Wolfram Sang -
This macro simply declares an enum, so drivers might as well declare
it themselves.Signed-off-by: Jean Delvare
Tested-by: Wolfram Sang -
Struct i2c_client_address_data only contains one field at this point,
which makes its usefulness questionable. Get rid of it and pass simple
address lists around instead.Signed-off-by: Jean Delvare
Tested-by: Wolfram Sang -
The "kind" parameter always has value -1, and nobody is using it any
longer, so we can remove it.Signed-off-by: Jean Delvare
Tested-by: Wolfram Sang
07 Dec, 2009
2 commits
-
The legacy probe and force module parameters are obsolete now, the
same can be achieved using the new_device sysfs interface, which is
both more flexible and cheaper (it is implemented by i2c-core rather
than replicated in every driver module.)The legacy ignore module parameters can be dropped as well. Ignoring
can be done by instantiating a "dummy" device at the problematic
address.This is the first step of a huge cleanup to i2c-core's i2c_detect
function, i2c.h's I2C_CLIENT_INSMOD* macros, and all drivers that made
use of them.Signed-off-by: Jean Delvare
-
Low priority thread holding the i2c bus mutex could block higher
priority threads to access the bus resulting in unacceptable
latencies. Change the mutex type to rt_mutex preventing priority
inversion.Tested-by: Peter Ujfalusi
Signed-off-by: Mika Kuoppala
Signed-off-by: Jean Delvare
07 Nov, 2009
1 commit
-
Some drivers need to be able to prevent access to an I2C bus segment
for a specific period of time. Add an interface for them to do so
without twiddling with i2c-core internals.Signed-off-by: Jean Delvare
Acked-by: Ben Hutchings
19 Sep, 2009
1 commit
-
Nobody is using i2c_driver.id any longer, so we can drop that field.
Signed-off-by: Jean Delvare
19 Jun, 2009
2 commits
-
For video4linux we sometimes need to probe for a single i2c address.
Normally you would do it like this:static const unsigned short addrs[] = {
addr, I2C_CLIENT_END
};client = i2c_new_probed_device(adapter, &info, addrs);
This is a bit awkward and I came up with this macro:
#define V4L2_I2C_ADDRS(addr, addrs...) \
((const unsigned short []){ addr, ## addrs, I2C_CLIENT_END })This can construct a list of one or more i2c addresses on the fly. But
this is something that really belongs in i2c.h, renamed to I2C_ADDRS.With this macro we can just do:
client = i2c_new_probed_device(adapter, &info, I2C_ADDRS(addr));
Note that this can also be used to initialize an array:
static const unsigned short addrs[] = I2C_ADDRS(0x2a, 0x2c);
Whether you want to is another matter, but it works. This functionality is
also available in the oldest supported gcc (3.2).Signed-off-by: Hans Verkuil
Signed-off-by: Jean Delvare -
Surround i2c function declarations with ifdefs, so that they aren't
advertised when i2c-core isn't actually built. That way, drivers using
these functions unconditionally will result in an immediate build
failure, rather than a late linking failure which is harder to figure
out.Signed-off-by: Jean Delvare
Cc: Mark Brown
Cc: Paul Mundt