13 Apr, 2009

1 commit


29 Mar, 2009

3 commits


25 Mar, 2009

1 commit

  • This patch implements uevent suppress in kobject and removes it
    from struct device, based on the following ideas:

    1,Uevent sending should be one attribute of kobject, so suppressing it
    in kobject layer is more natural than in device layer. By this way,
    we can do it for other objects embedded with kobject.

    2,It may save several bytes for each instance of struct device.(On my
    omap3(32bit ARM) based box, can save 8bytes per device object)

    This patch also introduces dev_set|get_uevent_suppress() helpers to
    set and query uevent_suppress attribute in case to help kobject
    as private part of struct device in future.

    [This version is against the latest driver-core patch set of Greg,please
    ignore the last version.]

    Signed-off-by: Ming Lei
    Signed-off-by: Greg Kroah-Hartman

    Ming Lei
     

25 Feb, 2009

1 commit


07 Jan, 2009

1 commit

  • This patch is part of a larger patch series which will remove
    the "char bus_id[20]" name string from struct device. The device
    name is managed in the kobject anyway, and without any size
    limitation, and just needlessly copied into "struct device".

    To set and read the device name dev_name(dev) and dev_set_name(dev)
    must be used. If your code uses static kobjects, which it shouldn't
    do, "const char *init_name" can be used to statically provide the
    name the registered device should have. At registration time, the
    init_name field is cleared, to enforce the use of dev_name(dev) to
    access the device name at a later time.

    We need to get rid of all occurrences of bus_id in the entire tree
    to be able to enable the new interface. Please apply this patch,
    and possibly convert any remaining remaining occurrences of bus_id.

    We want to submit a patch to -next, which will remove bus_id from
    "struct device", to find the remaining pieces to convert, and finally
    switch over to the new api, which will remove the 20 bytes array
    and does no longer have a size limitation.

    Acked-by: Greg Kroah-Hartman
    Signed-off-by: Kay Sievers
    Signed-off-by: Jean Delvare

    Kay Sievers
     

28 Nov, 2008

1 commit


23 Oct, 2008

1 commit


14 Oct, 2008

3 commits

  • Restore the i2c_smbus_process_call() as one driver (for the
    Micronas MAP5401) will need it soon.

    [JD: Update documentation accordingly.]

    Signed-off-by: Prakash Mortha
    Signed-off-by: Jean Delvare

    Prakash Mortha
     
  • Move I2C driver model init earlier in the boot sequence.

    This avoids oopsing in statically linked systems when some
    subsystems register I2C drivers in subsys_initcall() code,
    but those subsystems are linked (and initialized) before I2C.

    Signed-off-by: David Brownell
    Signed-off-by: Jean Delvare

    David Brownell
     
  • Guard I2C against oopsing because of init sequence problems, by
    verifying that i2c_init() has been called before calling any
    routines that rely on that initialization. This specific test
    just requires that bus_register(&i2c_bus_type) was called.

    Examples of this kind of oopsing come from subystems and drivers
    which register I2C drivers in their subsys_initcall code but
    which are statically linked before I2C by drivers/Makefile.

    Signed-off-by: David Brownell
    Signed-off-by: Jean Delvare

    David Brownell
     

28 Aug, 2008

2 commits

  • Some DVB adapters do not support the special I2C transaction that we
    use for probing purposes. There's no point in logging this event, as
    there's nothing the user can do and in general there is no actual
    problem. So, degrade one of these messages to a debug message, and
    move the other one around so that it is only printed on bogus drivers.

    Signed-off-by: Jean Delvare
    Acked-by: Uwe Bugla

    Jean Delvare
     
  • device_init_wakeup must be called after device_register.

    Signed-off-by: Marc Pignat
    Acked-by: David Brownell
    Signed-off-by: Jean Delvare

    Marc Pignat
     

11 Aug, 2008

2 commits


22 Jul, 2008

1 commit


17 Jul, 2008

1 commit

  • Clear i2c_adapter.dev on adapter removal. This makes it possible to
    re-add the adapter at a later point, which some drivers
    (i2c-amd756-s4882, i2c-nforce2-s4985) actually do.

    This fixes a bug reported by John Stultz here:
    http://lkml.org/lkml/2008/7/15/720
    and by Ingo Molar there:
    http://lkml.org/lkml/2008/7/16/78

    Signed-off-by: Jean Delvare
    Cc: John Stultz
    Cc: Ingo Molnar

    Jean Delvare
     

15 Jul, 2008

12 commits

  • Add a mechanism to let new-style i2c drivers optionally autodetect
    devices they would support on selected buses and ask i2c-core to
    instantiate them. This is a replacement for legacy i2c drivers, much
    cleaner.

    Where drivers had to implement both a legacy i2c_driver and a
    new-style i2c_driver so far, this mechanism makes it possible to get
    rid of the legacy i2c_driver and implement both enumerated and
    detected device support with just one (new-style) i2c_driver.

    Here is a quick conversion guide for these drivers, step by step:

    * Delete the legacy driver definition, registration and removal.
    Delete the attach_adapter and detach_client methods of the legacy
    driver.

    * Change the prototype of the legacy detect function from
    static int foo_detect(struct i2c_adapter *adapter, int address, int kind);
    to
    static int foo_detect(struct i2c_client *client, int kind,
    struct i2c_board_info *info);

    * Set the new-style driver detect callback to this new function, and
    set its address_data to &addr_data (addr_data is generally provided
    by I2C_CLIENT_INSMOD.)

    * Add the appropriate class to the new-style driver. This is
    typically the class the legacy attach_adapter method was checking
    for. Class checking is now mandatory (done by i2c-core.) See
    for the list of available classes.

    * Remove the i2c_client allocation and freeing from the detect
    function. A pre-allocated client is now handed to you by i2c-core,
    and is freed automatically.

    * Make the detect function fill the type field of the i2c_board_info
    structure it was passed as a parameter, and return 0, on success. If
    the detection fails, return -ENODEV.

    Signed-off-by: Jean Delvare

    Jean Delvare
     
  • We call adapter->client_register for both legacy and new-style i2c
    devices, however we only call adapter->client_unregister for legacy
    drivers. This doesn't make much sense. Usually, drivers will undo
    in client_unregister what they did in client_register, so we should
    call neither or both for every given i2c device.

    In order to ease the transition from legacy to new-style devices, it
    seems preferable to actually call both.

    Signed-off-by: Jean Delvare
    Cc: David Brownell

    Jean Delvare
     
  • Export the root of the i2c bus so that PowerPC device tree code can
    iterate over devices on the i2c bus.

    Signed-off-by: Jon Smirl
    Signed-off-by: Jean Delvare

    Jon Smirl
     
  • i2c_driver.id_table is mandatory now, so we can simplify
    i2c_device_probe() a bit.

    Signed-off-by: Jean Delvare

    Jean Delvare
     
  • i2c_del_driver() can be simplified a bit.

    Signed-off-by: Jean Delvare

    Jean Delvare
     
  • Use list_for_each_entry_safe() in i2c_del_adapter() and i2c_del_driver().

    Signed-off-by: Matthias Kaehlcke
    Signed-off-by: Jean Delvare

    Matthias Kaehlcke
     
  • Defend the i2c refcount calls against NULL pointers, as is important
    (and conventional) for such calls. Note that none of the current
    callers of i2c_use_client() use its return value.

    [JD: I hate this but apparently all the other subsystems do it so...]

    Signed-off-by: David Brownell
    Signed-off-by: Jean Delvare

    David Brownell
     
  • Provide kerneldoc for most of the I2C and SMBus I/O calls. Add a
    comment summarizing some fault reporting issues which affect the
    ability to provide clean fault reports through I2C master transfer
    calls. (Making it hard to precisely specify their return values...)

    Signed-off-by: David Brownell
    Signed-off-by: Jean Delvare

    David Brownell
     
  • Function i2c_smbus_write_quick has no users left, so we can delete it.

    Also update the list of these helper functions which are gone but
    could be added back if needed.

    Signed-off-by: Jean Delvare

    Jean Delvare
     
  • More updates to the I2C stack's fault reporting: make the core stop
    returning "-1" (usually "-EPERM") for all faults. Instead, pass lower
    level fault code up the stack, or return some appropriate errno.

    This patch happens to touch almost exclusively SMBus calls.

    Signed-off-by: David Brownell
    Signed-off-by: Jean Delvare

    David Brownell
     
  • i2c-core doesn't use seq files, so doesn't need to include
    .

    Signed-off-by: Jean Delvare

    Jean Delvare
     
  • Use class_for_each_device for iteration.

    Signed-off-by: Dave Young
    Signed-off-by: Jean Delvare

    Dave Young
     

19 May, 2008

1 commit


12 May, 2008

1 commit

  • As the old driver_name/type matching scheme is going away soon, change
    the dummy device mechanism to use the new matching scheme.

    This has the downside that dummy i2c clients can no longer choose
    their name, they'll all appear as "dummy" in sysfs and in log
    messages. I don't think it is a problem in practice though, as there
    is little reason to use these i2c clients to log messages.

    Signed-off-by: Jean Delvare

    Jean Delvare
     

30 Apr, 2008

1 commit

  • Based on earlier work by Jon Smirl and Jochen Friedrich.

    This patch allows new-style i2c chip drivers to have alias names using
    the official kernel aliasing system and MODULE_DEVICE_TABLE(). At this
    point, the old i2c driver binding scheme (driver_name/type) is still
    supported.

    Signed-off-by: Jean Delvare
    Cc: Jochen Friedrich
    Cc: Jon Smirl
    Cc: Kay Sievers

    Jean Delvare
     

23 Apr, 2008

1 commit


19 Apr, 2008

1 commit


24 Mar, 2008

1 commit

  • Sometimes kernel-doc and xmlto conspire to create output that is invalid
    and causes problems. Until I know a real/better solution, change the
    source code that causes this.

    If anyone has better fixes or can just explain what is happening here,
    that would be great.

    xmlto: input does not validate (status 1)
    mmotm-2008-0314-1449/Documentation/DocBook/kernel-api.xml:71468: parser error : Opening and ending tag mismatch: programlisting line 71464 and para

    ^
    mmotm-2008-0314-1449/Documentation/DocBook/kernel-api.xml:71480: parser error : Opening and ending tag mismatch: para line 71473 and programlisting

    ^
    make[1]: *** [Documentation/DocBook/kernel-api.html] Error 1

    Signed-off-by: Randy Dunlap
    Signed-off-by: Jean Delvare

    Randy Dunlap
     

12 Mar, 2008

1 commit


28 Jan, 2008

3 commits