1. 05 9月, 2008 1 次提交
    • M
      i2c: fix i2c-sh_mobile timing issues · 4eb00c9f
      Magnus Damm 提交于
      This patch teaches the i2c-sh_mobile driver to make use of wait irqs.
      Without this patch only dte irqs are used which may lead to overruns
      and cases of missing stop and extra bytes being read on the i2c bus.
      
      Use of wait irqs forces the hardware to pause and wait until the cpu
      is ready. Polling is also reworked in this patch to fix ms delay issues.
      
      Verified with bus analyzer and tested on MigoR and AP325RXA boards.
      Signed-off-by: NMagnus Damm <damm@igel.co.jp>
      Signed-off-by: NPaul Mundt <lethal@linux-sh.org>
      4eb00c9f
  2. 28 8月, 2008 2 次提交
  3. 24 8月, 2008 1 次提交
  4. 14 8月, 2008 1 次提交
  5. 11 8月, 2008 5 次提交
  6. 07 8月, 2008 3 次提交
  7. 28 7月, 2008 4 次提交
  8. 26 7月, 2008 2 次提交
    • M
      gpiolib: allow user-selection · 7444a72e
      Michael Buesch 提交于
      This patch adds functionality to the gpio-lib subsystem to make it
      possible to enable the gpio-lib code even if the architecture code didn't
      request to get it built in.
      
      The archtitecture code does still need to implement the gpiolib accessor
      functions in its asm/gpio.h file.  This patch adds the implementations for
      x86 and PPC.
      
      With these changes it is possible to run generic GPIO expansion cards on
      every architecture that implements the trivial wrapper functions.  Support
      for more architectures can easily be added.
      Signed-off-by: NMichael Buesch <mb@bu3sch.de>
      Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>
      Cc: Stephen Rothwell <sfr@canb.auug.org.au>
      Cc: David Brownell <david-b@pacbell.net>
      Cc: Russell King <rmk@arm.linux.org.uk>
      Cc: Haavard Skinnemoen <hskinnemoen@atmel.com>
      Cc: Jesper Nilsson <jesper.nilsson@axis.com>
      Cc: Ralf Baechle <ralf@linux-mips.org>
      Cc: Paul Mackerras <paulus@samba.org>
      Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>
      Cc: Ingo Molnar <mingo@elte.hu>
      Cc: Thomas Gleixner <tglx@linutronix.de>
      Cc: Jean Delvare <khali@linux-fr.org>
      Cc: Samuel Ortiz <sameo@openedhand.com>
      Cc: Kumar Gala <galak@gate.crashing.org>
      Cc: Sam Ravnborg <sam@ravnborg.org>
      Cc: Adrian Bunk <bunk@stusta.de>
      Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      7444a72e
    • D
      gpio: sysfs interface · d8f388d8
      David Brownell 提交于
      This adds a simple sysfs interface for GPIOs.
      
          /sys/class/gpio
          	/export ... asks the kernel to export a GPIO to userspace
          	/unexport ... to return a GPIO to the kernel
              /gpioN ... for each exported GPIO #N
      	    /value ... always readable, writes fail for input GPIOs
      	    /direction ... r/w as: in, out (default low); write high, low
      	/gpiochipN ... for each gpiochip; #N is its first GPIO
      	    /base ... (r/o) same as N
      	    /label ... (r/o) descriptive, not necessarily unique
      	    /ngpio ... (r/o) number of GPIOs; numbered N .. N+(ngpio - 1)
      
      GPIOs claimed by kernel code may be exported by its owner using a new
      gpio_export() call, which should be most useful for driver debugging.
      Such exports may optionally be done without a "direction" attribute.
      
      Userspace may ask to take over a GPIO by writing to a sysfs control file,
      helping to cope with incomplete board support or other "one-off"
      requirements that don't merit full kernel support:
      
        echo 23 > /sys/class/gpio/export
      	... will gpio_request(23, "sysfs") and gpio_export(23);
      	use /sys/class/gpio/gpio-23/direction to (re)configure it,
      	when that GPIO can be used as both input and output.
        echo 23 > /sys/class/gpio/unexport
      	... will gpio_free(23), when it was exported as above
      
      The extra D-space footprint is a few hundred bytes, except for the sysfs
      resources associated with each exported GPIO.  The additional I-space
      footprint is about two thirds of the current size of gpiolib (!).  Since
      no /dev node creation is involved, no "udev" support is needed.
      
      Related changes:
      
        * This adds a device pointer to "struct gpio_chip".  When GPIO
          providers initialize that, sysfs gpio class devices become children of
          that device instead of being "virtual" devices.
      
        * The (few) gpio_chip providers which have such a device node have
          been updated.
      
        * Some gpio_chip drivers also needed to update their module "owner"
          field ...  for which missing kerneldoc was added.
      
        * Some gpio_chips don't support input GPIOs.  Those GPIOs are now
          flagged appropriately when the chip is registered.
      
      Based on previous patches, and discussion both on and off LKML.
      
      A Documentation/ABI/testing/sysfs-gpio update is ready to submit once this
      merges to mainline.
      
      [akpm@linux-foundation.org: a few maintenance build fixes]
      Signed-off-by: NDavid Brownell <dbrownell@users.sourceforge.net>
      Cc: Guennadi Liakhovetski <g.liakhovetski@pengutronix.de>
      Cc: Greg KH <greg@kroah.com>
      Cc: Kay Sievers <kay.sievers@vrfy.org>
      Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      d8f388d8
  9. 22 7月, 2008 2 次提交
  10. 17 7月, 2008 7 次提交
  11. 15 7月, 2008 12 次提交
    • J
      i2c: Add detection capability to new-style drivers · 4735c98f
      Jean Delvare 提交于
      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
        <linux/i2c.h> 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: NJean Delvare <khali@linux-fr.org>
      4735c98f
    • J
      i2c: Call client_unregister for new-style devices too · 8508159e
      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: NJean Delvare <khali@linux-fr.org>
      Cc: David Brownell <david-b@pacbell.net>
      8508159e
    • J
      i2c: Clean up old chip drivers · f741f673
      Jean Delvare 提交于
      Clean up old i2c chip drivers:
      * Name the i2c_client "client" instead of "new_client".
      * Drop useless initializations to 0.
      Signed-off-by: NJean Delvare <khali@linux-fr.org>
      f741f673
    • S
      i2c-ibm_iic: Register child nodes · b1204e6e
      Sean MacLennan 提交于
      This patch completes the conversion of the IBM IIC driver to an
      of-platform driver.
      
      It removes the index from the IBM IIC driver and makes it an unnumbered
      driver. It then calls of_register_i2c_devices to properly register all
      the child nodes in the DTS.
      Signed-off-by: NSean MacLennan <smaclennan@pikatech.com>
      Signed-off-by: NJean Delvare <khali@linux-fr.org>
      b1204e6e
    • W
      i2c: New-style EEPROM driver using device IDs · 2b7a5056
      Wolfram Sang 提交于
      Add a new-style driver for most I2C EEPROMs, giving sysfs read/write
      access to their data. Tested with various chips and clock rates.
      Signed-off-by: NWolfram Sang <w.sang@pengutronix.de>
      Signed-off-by: NJean Delvare <khali@linux-fr.org>
      2b7a5056
    • J
      i2c: Export the i2c_bus_type symbol · e9ca9eb9
      Jon Smirl 提交于
      Export the root of the i2c bus so that PowerPC device tree code can
      iterate over devices on the i2c bus.
      Signed-off-by: NJon Smirl <jonsmirl@gmail.com>
      Signed-off-by: NJean Delvare <khali@linux-fr.org>
      e9ca9eb9
    • M
      i2c-au1550: Fix PM support · f09f71b2
      Manuel Lauss 提交于
      Fix driver power management:
      - suspend the PSC while driver is idle.
      - move PSC init/deinit to separate functions, as PSC must be
        initialized/shutdown on resume/suspend.
      Signed-off-by: NManuel Lauss <mano@roarinelk.homelinux.net>
      Signed-off-by: NJean Delvare <khali@linux-fr.org>
      f09f71b2
    • J
      i2c-dev: Delete empty detach_client callback · f6a71105
      Jean Delvare 提交于
      Implementing detach_client is optional, so there is no point in
      an empty implementation.
      
      Likewise, i2c driver IDs are optional, and we don't need one.
      Signed-off-by: NJean Delvare <khali@linux-fr.org>
      f6a71105
    • J
      i2c: Drop stray references to lm_sensors · 954a9930
      Jean Delvare 提交于
      Signed-off-by: NJean Delvare <khali@linux-fr.org>
      954a9930
    • J
      i2c: Check for ACPI resource conflicts · 54fb4a05
      Jean Delvare 提交于
      Check for ACPI resource conflicts in i2c bus drivers. I've included
      all recent SMBus master drivers for PC hardware.
      
      I've voluntarily left out:
      * Drivers that don't run on PCs: they can't conflict with ACPI.
      * Bit-banged bus device drivers: it's very unlikely that ACPI would
        deal with such buses.
      Signed-off-by: NJean Delvare <jdelvare@suse.de>
      54fb4a05
    • M
      i2c-ocores: basic PM support · 2373c180
      Manuel Lauss 提交于
      Basic PM support: reinit the core on resume, disable it on suspend.
      Signed-off-by: NManuel Lauss <mano@roarinelk.homelinux.net>
      Acked-by: NPeter Korsgaard <jacmet@sunsite.dk>
      Signed-off-by: NJean Delvare <khali@linux-fr.org>
      2373c180
    • M
      i2c-sibyte: SWARM I2C board initialization · 392a0408
      Maciej W. Rozycki 提交于
       The standard rtc-m41t80.c driver cannot be used with the SWARM as it is,
      because the board does not provide setup information for the I2C core.  
      As a result the bus and the address to probe for the M41T80 chip is not
      known.
      
       Here is a set of changes that fix the problem:
      
      1. swarm-i2c.c -- SWARM I2C board setup, currently for the M41T80 chip on 
         the bus #1 only (there is a MAX6654 temperature sensor on the bus #0 
         which may be added in the future if we have a driver for that chip).
      
      2. The i2c-sibyte.c BCM1250A SMBus controller driver now registers its 
         buses as numbered so that board setup is correctly applied.
      Signed-off-by: NMaciej W. Rozycki <macro@linux-mips.org>
      Signed-off-by: NJean Delvare <khali@linux-fr.org>
      392a0408