13 Jan, 2012

1 commit

  • Convert the drivers in drivers/i2c/busses/* to use the
    module_platform_driver() macro which makes the code smaller and a bit
    simpler.

    Cc: Ben Dooks
    Acked-by: Jochen Friedrich
    Acked-by: Peter Korsgaard
    Acked-by: Wolfram Sang
    Cc: Manuel Lauss
    Cc: Barry Song
    Cc: Linus Walleij
    Cc: Yong Zhang
    Cc: Lucas De Marchi
    Cc: Grant Likely
    Cc: Samuel Ortiz
    Signed-off-by: Axel Lin
    Signed-off-by: Jean Delvare

    Axel Lin
     

14 Mar, 2010

1 commit


07 Dec, 2009

6 commits

  • I2C bus drivers don't have to support I2C_M_REV_DIR_ADDR. It is a
    deviation from the I2C specification, which only makes sense to
    implement when really needed.

    Signed-off-by: Jean Delvare
    Cc: Ben Dooks

    Jean Delvare
     
  • We no longer need to write the adapter name to a temporary buffer.
    We can write it directly to the i2c_adapter's name field. This is
    more efficient.

    Signed-off-by: Jean Delvare
    Tested-by: Michel Daenzer
    Cc: Benjamin Herrenschmidt

    Jean Delvare
     
  • Include the i2c_adapter in struct pmac_i2c_bus. This avoids memory
    fragmentation and allows for several code cleanups.

    Signed-off-by: Jean Delvare
    Tested-by: Michel Daenzer
    Cc: Benjamin Herrenschmidt

    Jean Delvare
     
  • Log errors when they happen, otherwise we have no idea what went
    wrong.

    Signed-off-by: Jean Delvare
    Tested-by: Michel Daenzer
    Cc: Benjamin Herrenschmidt
    Cc: Paul Mackerras

    Jean Delvare
     
  • I wanted to add some error logging to the i2c-powermac driver, but
    found that it was very difficult due to the way the
    i2c_powermac_smbus_xfer function is organized. Refactor the code in
    this function so that each low-level function is only called once.

    Signed-off-by: Jean Delvare
    Tested-by: Michel Daenzer
    Cc: Benjamin Herrenschmidt
    Cc: Paul Mackerras

    Jean Delvare
     
  • The i2c-powermac driver doesn't support arbitrary multi-message I2C
    transactions, only SMBus ones. Make it clear by returning an error if
    a multi-message I2C transaction is attempted. This is better than only
    processing the first message, because most callers won't recover from
    the short transaction. Anyone wishing to issue multi-message
    transactions should use the SMBus API instead of the raw I2C API.

    Signed-off-by: Jean Delvare
    Tested-by: Michel Daenzer
    Acked-by: Benjamin Herrenschmidt
    Cc: Paul Mackerras

    Jean Delvare
     

29 Mar, 2009

1 commit


17 Oct, 2008

1 commit

  • The legacy i2c binding model is phasing out, so the ams driver needs
    to be converted to a new-style i2c driver. Here is a naive approach of
    this conversion. Basically it is moving the i2c device creation from
    the ams driver to the i2c-powermac driver. This should work, but I
    suspect we could come up with something cleaner by declaring the i2c
    device as part of the platform setup. This could be done later by
    someone more familiar with openfirmware-based platforms than I am
    myself.

    One nice thing brought by this conversion is that the ams driver
    should be loaded automatically on systems where is is needed (at
    least when the I2C interface to the chip is used) providing
    coldplug-aware user-space environment.

    Signed-off-by: Jean Delvare
    Acked-by: Johannes Berg
    Cc: Stelian Pop
    Cc: Michael Hanselmann
    Cc: Benjamin Herrenschmidt

    Jean Delvare
     

24 Sep, 2008

1 commit

  • __devexit for i2c_powermac_probe is obviously wrong. In the definition
    of struct platform_driver i2c_powermac_driver the remove function
    i2c_powermac_remove is wrapped in __devexit_p, so it should be defined
    using __devexit.

    Signed-off-by: Uwe Kleine-Koenig
    Cc: Benjamin Herrenschmidt
    Cc: Paul Mackerras
    Signed-off-by: Jean Delvare

    Uwe Kleine-Koenig
     

23 Apr, 2008

1 commit

  • Since 43cc71eed1250755986da4c0f9898f9a635cb3bf, the platform
    modalias is prefixed with "platform:". Add MODULE_ALIAS() to the
    hotpluggable I2C platform drivers, to allow module auto loading.

    [ db: add some more drivers ]

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

    Kay Sievers
     

15 Jan, 2008

1 commit


12 Jul, 2007

1 commit

  • Let the drivers specify how many bytes they want to read with
    i2c_smbus_read_i2c_block_data(). So far, the block count was
    hard-coded to I2C_SMBUS_BLOCK_MAX (32), which did not make much sense.
    Many driver authors complained about this before, and I believe it's
    about time to fix it. Right now, authors have to do technically stupid
    things, such as individual byte reads or full-fledged I2C messaging,
    to work around the problem. We do not want to encourage that.

    I even found that some bus drivers (e.g. i2c-amd8111) already
    implemented I2C block read the "right" way, that is, they didn't
    follow the old, broken standard. The fact that it was never noticed
    before just shows how little i2c_smbus_read_i2c_block_data() was used,
    which isn't that surprising given how broken its prototype was so far.

    There are some obvious compatiblity considerations:
    * This changes the i2c_smbus_read_i2c_block_data() prototype. Users
    outside the kernel tree will notice at compilation time, and will
    have to update their code.
    * User-space has access to i2c_smbus_xfer() directly using i2c-dev, so
    the changed expectations would affect tools such as i2cdump. In order
    to preserve binary compatibility, we give I2C_SMBUS_I2C_BLOCK_DATA
    a new numeric value, and define I2C_SMBUS_I2C_BLOCK_BROKEN with the
    old numeric value. When i2c-dev receives a transaction with the
    old value, it can convert it to the new format on the fly.

    Signed-off-by: Jean Delvare

    Jean Delvare
     

14 Feb, 2007

1 commit


10 Oct, 2006

1 commit

  • i2c-powermac was written & merged right after Russell King's changes
    adding platform_driver... which I missed. Thus it still used struct
    device, causing crashes when hitting sleep/wakeup callbacks (it happened
    to work by luck so far, until early/late callbacks got added). This
    causes crashes on sleep/wakeup on PowerBooks with 2.6.19. The patch
    fixes it by using a proper platform_driver.

    Signed-off-by: Benjamin Herrenschmidt
    Signed-off-by: Paul Mackerras

    Benjamin Herrenschmidt
     

27 Sep, 2006

1 commit


01 Aug, 2006

1 commit


31 Jul, 2006

1 commit

  • Now that get_property() returns a void *, there's no need to cast its
    return value. Also, treat the return value as const, so we can
    constify get_property later.

    powermac platform & macintosh driver changes.

    Built for pmac32_defconfig, g5_defconfig

    Signed-off-by: Jeremy Kerr
    Signed-off-by: Paul Mackerras

    Jeremy Kerr
     

13 Jul, 2006

1 commit

  • Fix the value returned by the i2c-powermac's master_xfer method.
    It should return the number of messages processed successfully, but
    instead returns the number of data bytes in the first (and only)
    processed message.

    Also explicitly mention the master_xfer convention so that future
    implementations get it right directly.

    Signed-off-by: Jean Delvare
    Acked-by: Benjamin Herrenschmidt
    Signed-off-by: Greg Kroah-Hartman

    Jean Delvare
     

01 Jul, 2006

1 commit


09 Jan, 2006

1 commit

  • This is the continuation of the previous patch. This one removes the old
    PowerMac i2c drivers (i2c-keywest and i2c-pmac-smu) and replaces them
    both with a single stub driver that uses the new PowerMac low i2c layer.

    Now that i2c-keywest is gone, the low-i2c code is extended to support
    interrupt driver transfers. All i2c busses now appear as platform
    devices. Compatibility with existing drivers should be maintained as the
    i2c bus names have been kept identical, except for the SMU bus but in
    that later case, all users has been fixed.

    With that patch added, matching a device node to an i2c_adapter becomes
    trivial.

    Signed-off-by: Benjamin Herrenschmidt
    Signed-off-by: Paul Mackerras

    Benjamin Herrenschmidt