1. 12 7月, 2007 2 次提交
    • J
      i2c: Fix the i2c_smbus_read_i2c_block_data() prototype · 4b2643d7
      Jean Delvare 提交于
      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: NJean Delvare <khali@linux-fr.org>
      4b2643d7
    • M
      scx200_acb: Use mutex instead of semaphore · 9d9c01ce
      Matthias Kaehlcke 提交于
      The scx200_acb driver use a semaphore as mutex.  Use the mutex API
      instead of the (binary) semaphore.
      Signed-off-by: NMatthias Kaehlcke <matthias.kaehlcke@gmail.com>
      Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
      Cc: Jordan Crouse <jordan.crouse@amd.com>
      Signed-off-by: NJean Delvare <khali@linux-fr.org>
      9d9c01ce
  2. 26 5月, 2007 1 次提交
    • E
      [ARM] 4403/1: Make the PXA-I2C driver work with lockdep validator · 6776f3d2
      Enrico Scholz 提交于
      Using lockdep validator causes warnings like
      
        INFO: trying to register non-static key.
        the code is fine but needs lockdep annotation.
        turning off the locking correctness validator.
        [<c00241a0>] (dump_stack+0x0/0x14) from [<c00520f8>] (__lock_acquire+0x150/0xc40)
        [<c0051fa8>] (__lock_acquire+0x0/0xc40) from [<c00530a0>] (lock_acquire+0x5c/0x70)
        [<c0053044>] (lock_acquire+0x0/0x70) from [<c01d9e44>] (_spin_lock_irq+0x48/0x58)
         r7:c07e5144 r6:00000000 r5:c015fb94 r4:c07e50b8
        [<c01d9dfc>] (_spin_lock_irq+0x0/0x58) from [<c015fb94>] (i2c_pxa_xfer+0x110/0x2e0)
         r5:c07e50b8 r4:0000001f
      
      This is caused by memcpy'ing a statical initialized spin-lock. This patch
      removes a static pxa_i2c structure which was used only as a source for this
      memcpy() operation. Instead of, members and the spinlock will be
      initialized manually.
      Signed-off-by: NEnrico Scholz <enrico.scholz@sigma-chemnitz.de>
      Signed-off-by: NRussell King <rmk+kernel@arm.linux.org.uk>
      6776f3d2
  3. 23 5月, 2007 2 次提交
  4. 11 5月, 2007 3 次提交
  5. 09 5月, 2007 2 次提交
  6. 03 5月, 2007 1 次提交
    • J
      PCI: Cleanup the includes of <linux/pci.h> · 6473d160
      Jean Delvare 提交于
      I noticed that many source files include <linux/pci.h> while they do
      not appear to need it. Here is an attempt to clean it all up.
      
      In order to find all possibly affected files, I searched for all
      files including <linux/pci.h> but without any other occurence of "pci"
      or "PCI". I removed the include statement from all of these, then I
      compiled an allmodconfig kernel on both i386 and x86_64 and fixed the
      false positives manually.
      
      My tests covered 66% of the affected files, so there could be false
      positives remaining. Untested files are:
      
      arch/alpha/kernel/err_common.c
      arch/alpha/kernel/err_ev6.c
      arch/alpha/kernel/err_ev7.c
      arch/ia64/sn/kernel/huberror.c
      arch/ia64/sn/kernel/xpnet.c
      arch/m68knommu/kernel/dma.c
      arch/mips/lib/iomap.c
      arch/powerpc/platforms/pseries/ras.c
      arch/ppc/8260_io/enet.c
      arch/ppc/8260_io/fcc_enet.c
      arch/ppc/8xx_io/enet.c
      arch/ppc/syslib/ppc4xx_sgdma.c
      arch/sh64/mach-cayman/iomap.c
      arch/xtensa/kernel/xtensa_ksyms.c
      arch/xtensa/platform-iss/setup.c
      drivers/i2c/busses/i2c-at91.c
      drivers/i2c/busses/i2c-mpc.c
      drivers/media/video/saa711x.c
      drivers/misc/hdpuftrs/hdpu_cpustate.c
      drivers/misc/hdpuftrs/hdpu_nexus.c
      drivers/net/au1000_eth.c
      drivers/net/fec_8xx/fec_main.c
      drivers/net/fec_8xx/fec_mii.c
      drivers/net/fs_enet/fs_enet-main.c
      drivers/net/fs_enet/mac-fcc.c
      drivers/net/fs_enet/mac-fec.c
      drivers/net/fs_enet/mac-scc.c
      drivers/net/fs_enet/mii-bitbang.c
      drivers/net/fs_enet/mii-fec.c
      drivers/net/ibm_emac/ibm_emac_core.c
      drivers/net/lasi_82596.c
      drivers/parisc/hppb.c
      drivers/sbus/sbus.c
      drivers/video/g364fb.c
      drivers/video/platinumfb.c
      drivers/video/stifb.c
      drivers/video/valkyriefb.c
      include/asm-arm/arch-ixp4xx/dma.h
      sound/oss/au1550_ac97.c
      
      I would welcome test reports for these files. I am fine with removing
      the untested files from the patch if the general opinion is that these
      changes aren't safe. The tested part would still be nice to have.
      
      Note that this patch depends on another header fixup patch I submitted
      to LKML yesterday:
        [PATCH] scatterlist.h needs types.h
        http://lkml.org/lkml/2007/3/01/141Signed-off-by: NJean Delvare <khali@linux-fr.org>
      Cc: Badari Pulavarty <pbadari@us.ibm.com>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@suse.de>
      6473d160
  7. 02 5月, 2007 23 次提交
  8. 22 4月, 2007 2 次提交
    • E
      [ARM] 4304/1: removes the unnecessary bit number from CKENnn_XXXX · 7053acbd
      Eric Miao 提交于
      This patch removes the unnecessary bit number from CKENnn_XXXX
      definitions for PXA, so that
      
      	CKEN0_PWM0 --> CKEN_PWM0
      	CKEN1_PWM1 --> CKEN_PWM1
      	...
      	CKEN24_CAMERA --> CKEN_CAMERA
      
      The reasons for the change of these defitions are:
      
      1. they do not scale - they are currently valid for pxa2xx, but
      definitely not valid for pxa3xx, e.g., pxa3xx has bit 3 for camera
      instead of bit 24
      
      2. they are unnecessary - the peripheral name within the definition
      has already announced its usage, we don't need those bit numbers
      to know which peripheral we are going to enable/disable clock for
      
      3. they are inconvenient - think about this: a driver programmer
      for pxa has to remember which bit in the CKEN register to turn
      on/off
      
      Another change in the patch is to make the definitions equal to its
      clock bit index, so that
      
         #define CKEN_CAMERA  (24)
      
      instead of
      
         #define CKEN_CAMERA  (1 << 24)
      
      this change, however, will add a run-time bit shift operation in
      pxa_set_cken(), but the benefit of this change is that it scales
      when bit index exceeds 32, e.g., pxa3xx has two registers CKENA
      and CKENB, totally 64 bit for this, suppose CAMERA clock enabling
      bit is CKENB:10, one can simply define CKEN_CAMERA to be (32 + 10)
      and so that pxa_set_cken() need minimum change to adapt to that.
      Signed-off-by: Neric miao <eric.y.miao@gmail.com>
      Signed-off-by: NRussell King <rmk+kernel@arm.linux.org.uk>
      7053acbd
    • M
      [ARM] 4246/1: i2c-pxa: add adapter class to platform specific data · a79220b7
      Matej Kenda 提交于
      Reposted patch for kernel 2.6.21-rc2.
      
      The driver i2c-pxa doesn't set the class member in i2c_adapter, which
      is used to register the I2C adapter. The hwmon (sensors) drivers (e.g.
      adm1021) that are connected to a i2c-pxa adapter don't attach because
      they expect that the adapter supports class I2C_CLASS_HWMON.
      
      This patch adds functionality to allow platforms to set the class and
      pass it as platform_data to the i2c-pxa driver. Sample usage in
      platform code:
      
      static struct i2c_pxa_platform_data my_i2c_platform_data = {
      	.class = I2C_CLASS_HWMON
      };
      
      static void __init my_platform_init(void)
      {
      	(void) platform_add_devices(devices, ARRAY_SIZE(devices));
      
      	pxa_set_i2c_info(&my_i2c_platform_data);
      }
      Signed-off-by: NMatej Kenda <matej.kenda@hermes-softlab.com>
      Signed-off-by: NRussell King <rmk+kernel@arm.linux.org.uk>
      a79220b7
  9. 18 4月, 2007 2 次提交
  10. 23 3月, 2007 2 次提交