27 Nov, 2011

2 commits

  • Add support for writing data to EEPROM.

    Signed-off-by: Ben Dooks
    Cc: Wolfram Sang
    Cc: Jean Delvare
    Cc: Linux Kernel
    Signed-off-by: Stephen Boyd
    Signed-off-by: David S. Miller

    Ben Dooks
     
  • Some devices need to know if the data is to be output or read, so add a
    data direction into the eeprom structure to tell the driver whether the
    data line should be driven.

    The user in this case is the Micrel KS8851 which has a direction
    control for the EEPROM data line and thus needs to know whether
    to drive it (writing) or to tristate it for receiving.

    Signed-off-by: Ben Dooks
    Cc: Wolfram Sang
    Cc: Jean Delvare
    Signed-off-by: Stephen Boyd
    Signed-off-by: David S. Miller

    Ben Dooks
     

16 Nov, 2011

1 commit

  • The driver for the DigsyMTC display configuration EEPROMs device got
    added by commit 469dded183 ("misc/eeprom: add eeprom access driver for
    digsy_mtc board"). Its Kconfig symbol depends on PPC_MPC5200_GPIO. But
    at the time that driver got added PPC_MPC5200_GPIO was already renamed
    to GPIO_MPC5200, by commit 6eae1ace68 ("gpio: Move mpc5200 gpio driver
    to drivers/gpio").

    So make this driver depend on GPIO_MPC5200. And since GPIO_MPC5200
    itself implies that GPIOLIB is set, that dependency can be dropped.

    Signed-off-by: Paul Bolle
    Acked-by: Anatolij Gustschin
    Cc: Grant Likely
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Paul Bolle
     

26 Jul, 2011

2 commits

  • Both displays on digsy_mtc board obtain their configuration from microwire
    EEPROMs which are connected to the SoC over GPIO lines. We need an easy
    way to access the EEPROMs to write the needed display configuration or to
    read out the currently programmed configuration. The generic
    eeprom_93xx46 SPI driver added by previous patch allows EEPROM access over
    sysfs. Using the simple driver added by this patch we provide used GPIO
    interface and access control description on the board for generic
    eeprom_93xx46 driver and spi_gpio driver.

    Signed-off-by: Anatolij Gustschin
    Cc: Jonathan Cameron
    Cc: Grant Likely
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Anatolij Gustschin
     
  • Add EEPROM driver for 93xx46 chips. It can also be used with spi_gpio
    driver to access 93xx46 EEPROMs connected over GPIO lines. This driver
    supports read/write/erase access to the EEPROM chips over sysfs files.

    [rdunlap@xenotime.net: fix printk format]
    Signed-off-by: Anatolij Gustschin
    Cc: Jonathan Cameron
    Cc: Grant Likely
    Signed-off-by: Randy Dunlap
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Anatolij Gustschin
     

24 Dec, 2010

2 commits

  • Side-effects happen when passing 0 to either io_limit or page_size. Give
    an error in case of this misconfiguration.

    Signed-off-by: Wolfram Sang
    Signed-off-by: Grant Likely

    Wolfram Sang
     
  • Information about the pagesize and read-only-status may also come from
    the devicetree. Parse this data, too, and act accordingly. While we are
    here, change the initialization printout a bit. write_max is useful to
    know to detect performance bottlenecks, the rest is superfluous.

    Signed-off-by: Wolfram Sang
    Signed-off-by: Grant Likely

    Wolfram Sang
     

03 Jun, 2010

1 commit

  • I2C drivers can use the clientdata-pointer to point to private data. As I2C
    devices are not really unregistered, but merely detached from their driver, it
    used to be the drivers obligation to clear this pointer during remove() or a
    failed probe(). As a couple of drivers forgot to do this, it was agreed that it
    was cleaner if the i2c-core does this clearance when appropriate, as there is
    no guarantee for the lifetime of the clientdata-pointer after remove() anyhow.
    This feature was added to the core with commit
    e4a7b9b04de15f6b63da5ccdd373ffa3057a3681 to fix the faulty drivers.

    As there is no need anymore to clear the clientdata-pointer, remove all current
    occurrences in the drivers to simplify the code and prevent confusion.

    Signed-off-by: Wolfram Sang
    Acked-by: Mark Brown
    Acked-by: Greg Kroah-Hartman
    Acked-by: Richard Purdie
    Acked-by: Dmitry Torokhov
    Signed-off-by: Jean Delvare

    Wolfram Sang
     

22 May, 2010

3 commits

  • * 'i2c-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jdelvare/staging:
    i2c-nforce2: Remove redundant error messages on ACPI conflict
    i2c: Use instead of
    i2c-algo-pca: Fix coding style issues
    i2c-dev: Fix all coding style issues
    i2c-core: Fix some coding style issues
    i2c-gpio: Move initialization code to subsys_initcall()
    i2c-parport: Make template structure const
    i2c-dev: Remove unnecessary casts
    at24: Fall back to byte or word reads if needed
    i2c-stub: Expose the default functionality flags
    i2c/scx200_acb: Make PCI device ids constant
    i2c-i801: Fix all checkpatch warnings
    i2c-i801: All newer devices have all the optional features
    i2c-i801: Let the user disable selected driver features

    Linus Torvalds
     
  • Increase the portability of the at24 driver by letting it read from
    EEPROM chips connected to cheap SMBus controllers that support neither
    raw I2C messages nor even I2C block reads. All SMBus controllers
    should support either word reads or byte reads, so read support
    becomes universal, much like with the legacy "eeprom" driver.

    Obviously, this only works with EEPROM chips up to AT24C16, that use
    8-bit offset addressing. 16-bit offset addressing is almost impossible
    to support on SMBus controllers.

    I did not add universal support for writes, as I had no immediate need
    for this, but it could be added later if needed (with the same
    performance issue as byte and word reads have, of course.)

    Signed-off-by: Jean Delvare
    Reviewed-by: Wolfram Sang
    Cc: Konstantin Lazarev

    Jean Delvare
     
  • This allows bin_attr->read,write,mmap callbacks to check file specific data
    (such as inode owner) as part of any privilege validation.

    Signed-off-by: Chris Wright
    Signed-off-by: Greg Kroah-Hartman

    Chris Wright
     

14 May, 2010

3 commits


15 Mar, 2010

1 commit

  • Commit 6992f5334995af474c2b58d010d08bc597f0f2fe ("sysfs: Use one lockdep
    class per sysfs attribute.") introduced this requirement. First, at25
    was fixed manually. Then, other occurences were found with coccinelle
    and the following semantic patch. Results were reviewed and fixed up:

    @ init @
    identifier struct_name, bin;
    @@

    struct struct_name {
    ...
    struct bin_attribute bin;
    ...
    };

    @ main extends init @
    expression E;
    statement S;
    identifier name, err;
    @@

    (
    struct struct_name *name;
    |
    - struct struct_name *name = NULL;
    + struct struct_name *name;
    )
    ...
    (
    sysfs_bin_attr_init(&name->bin);
    |
    + sysfs_bin_attr_init(&name->bin);
    if (sysfs_create_bin_file(E, &name->bin))
    S
    |
    + sysfs_bin_attr_init(&name->bin);
    err = sysfs_create_bin_file(E, &name->bin);
    )

    Signed-off-by: Wolfram Sang
    Cc: Eric W. Biederman
    Signed-off-by: Linus Torvalds

    Wolfram Sang
     

14 Mar, 2010

1 commit


15 Dec, 2009

3 commits


26 Nov, 2009

1 commit

  • Writes may take some time on EEPROMs, so for consecutive writes, we already
    have a loop waiting for the EEPROM to become ready. Use such a loop for reads,
    too, in case somebody wants to immediately read after a write. Detailed bug
    report and test case can be found here:

    http://article.gmane.org/gmane.linux.drivers.i2c/4660

    Reported-by: Aleksandar Ivanov
    Signed-off-by: Wolfram Sang
    Tested-by: Aleksandar Ivanov
    Cc: David Brownell
    Signed-off-by: Jean Delvare

    Wolfram Sang
     

05 Oct, 2009

1 commit

  • There is no point in implementing a detect callback for the MAX6875, as
    this device can't be detected. It was there solely to handle "force"
    module parameters to instantiate devices, but now we have a better sysfs
    interface that can do the same.

    So we can get rid of the ugly module parameters and the detect callback.
    This basically divides the binary module size by 2.

    Signed-off-by: Jean Delvare
    Acked-by: Wolfram Sang
    Acked-by: Ben Gardner

    Jean Delvare
     

23 Sep, 2009

1 commit

  • This makes it consistent with other buses (platform, i2c, vio, ...). I'm
    not sure why we use the prefixes, but there must be a reason.

    This was easy enough to do it, and I did it.

    Signed-off-by: Anton Vorontsov
    Cc: David Brownell
    Cc: David Woodhouse
    Cc: Grant Likely
    Cc: Jean Delvare
    Cc: Ben Dooks
    Cc: Benjamin Herrenschmidt
    Cc: Dmitry Torokhov
    Cc: Samuel Ortiz
    Cc: "John W. Linville"
    Acked-by: Mike Frysinger
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Anton Vorontsov
     

30 Jul, 2009

1 commit

  • Under certain circumstances msleep(1) within the loop, which waits for the
    EEPROM to be finished, might take longer than the timeout. On the next
    loop the status register might now return to be ready and therefore the
    loop finishes. The following check now tests if a timeout occurred and if
    so returns an error although the device reported it was ready.

    This fix replaces testing the occurrence of the timeout by testing the
    "not ready" bit in the status register.

    Signed-off-by: Sebastian Heutling
    Signed-off-by: David Brownell
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Sebastian Heutling
     

16 Jun, 2009

1 commit

  • This driver only reads the user EEPROM of that chip, so we can move it
    to the eeprom-directory in order to further clean up (and later remove)
    drivers/i2c/chips.

    The Kconfig text was updated to match the current functionality,
    dropping the meanwhile obsoleted parts.

    Defconfigs have been adapted.

    Signed-off-by: Wolfram Sang
    Acked-by: Ben Gardner
    Signed-off-by: Jean Delvare

    Wolfram Sang
     

14 Apr, 2009

2 commits


03 Apr, 2009

2 commits

  • - Define new setup() hook to export the accessor
    - Implement accessor methods

    Moves some error checking out of the sysfs interface code into the layer
    below it, which is now shared by both sysfs and memory access code.

    Signed-off-by: David Brownell
    Signed-off-by: Kevin Hilman
    Cc: Jean Delvare
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    David Brownell
     
  • In the case of at24, the platform code registers a 'setup' callback with
    the at24_platform_data. When the at24 driver detects an EEPROM, it fills
    out the read and write functions of the memory_accessor and calls the
    setup callback passing the memory_accessor struct. The platform code can
    then use the read/write functions in the memory_accessor struct for
    reading and writing the EEPROM.

    Signed-off-by: Kevin Hilman
    Cc: David Brownell
    Cc: Jean Delvare
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Kevin Hilman
     

29 Mar, 2009

1 commit


27 Jan, 2009

5 commits