26 May, 2007

1 commit

  • 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.
    [] (dump_stack+0x0/0x14) from [] (__lock_acquire+0x150/0xc40)
    [] (__lock_acquire+0x0/0xc40) from [] (lock_acquire+0x5c/0x70)
    [] (lock_acquire+0x0/0x70) from [] (_spin_lock_irq+0x48/0x58)
    r7:c07e5144 r6:00000000 r5:c015fb94 r4:c07e50b8
    [] (_spin_lock_irq+0x0/0x58) from [] (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: Enrico Scholz
    Signed-off-by: Russell King

    Enrico Scholz
     

23 May, 2007

3 commits

  • Fix for the following build warning:
    CC drivers/i2c/busses/i2c-s3c2410.o
    drivers/i2c/busses/i2c-s3c2410.c: In function 's3c24xx_i2c_probe':
    drivers/i2c/busses/i2c-s3c2410.c:839: warning: format '%ld' expects type 'long int', but argument 4 has type 'resource_size_t'

    Signed-off-by: Arnaud Patard
    Signed-off-by: Jean Delvare

    Arnaud Patard
     
  • Signed-off-by: Jean Delvare
    Cc: Till Harbaum

    Jean Delvare
     
  • Prevent legacy drivers from issuing uevents for device creation/removal,
    so that userspace can't cause modprobing loops for them. This became a
    problem for some legacy PC drivers. I can't easily see it becoming an
    issue with I2C legacy drivers, but consistency-in-paranoia seems likely
    to be a good thing here. For usable i2c-level driver model uevents, just
    switch to a new-style driver.

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

    David Brownell
     

11 May, 2007

4 commits

  • * 'for-linus' of git://git390.osdl.marist.edu/pub/scm/linux-2.6:
    [S390] update default configuration.
    [S390] Kconfig: no wireless on s390.
    [S390] Kconfig: use common Kconfig files for s390.
    [S390] Kconfig: common config options for s390.
    [S390] Kconfig: unwanted menus for s390.
    [S390] Kconfig: menus with depends on HAS_IOMEM.
    [S390] Kconfig: refine depends statements.
    [S390] Avoid compile warning.
    [S390] qdio: re-add lost perf_stats.tl_runs change in qdio_handle_pci
    [S390] Avoid sparse warnings.
    [S390] dasd: Fix modular build.
    [S390] monreader inlining cleanup.
    [S390] cio: Make some structures and a function static.
    [S390] cio: Get rid of _ccw_device_get_device_number().
    [S390] fix subsystem removal fallout

    Linus Torvalds
     
  • CC drivers/i2c/busses/i2c-at91.o
    drivers/i2c/busses/i2c-at91.c: In function 'at91_i2c_probe':
    drivers/i2c/busses/i2c-at91.c:213: warning: implicit declaration of function 'IS_ERR'

    Signed-off-by: Alexey Dobriyan
    Cc: David Brownell
    Acked-by: Jean Delvare
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Alexey Dobriyan
     
  • Make i2c-at91 register as i2c adapter zero (none of these chips seem to
    have more than one TWI controllers) to let it kick in any board-specific
    device declarations; also make it hotplug/coldplug.

    Signed-off-by: David Brownell
    Acked-by: Jean Delvare
    Cc: Andrew Victor
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    David Brownell
     
  • From commit 7d054817b780e664bed6701b2aa637718e1905b7:
    > According to the PXA27x developer's manual, we shall do so.

    We shall also at least compile test our changes.

    Signed-off-by: Russell King
    Cc: Jean Delvare
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Russell King
     

10 May, 2007

2 commits

  • Add "depends on HAS_IOMEM" to a number of menus to make them
    disappear for s390 which does not have I/O memory.

    Signed-off-by: Martin Schwidefsky

    Martin Schwidefsky
     
  • [ With Johannes Berg ]

    Separate the hibernation (aka suspend to disk code) from the other suspend
    code. In particular:

    * Remove the definitions related to hibernation from include/linux/pm.h
    * Introduce struct hibernation_ops and a new hibernate() function to hibernate
    the system, defined in include/linux/suspend.h
    * Separate suspend code in kernel/power/main.c from hibernation-related code
    in kernel/power/disk.c and kernel/power/user.c (with the help of
    hibernation_ops)
    * Switch ACPI (the only user of pm_ops.pm_disk_mode) to hibernation_ops

    Signed-off-by: Rafael J. Wysocki
    Cc: Greg KH
    Cc: Pavel Machek
    Cc: Nigel Cunningham
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Rafael J. Wysocki
     

09 May, 2007

2 commits

  • Remove includes of where it is not used/needed.
    Suggested by Al Viro.

    Builds cleanly on x86_64, i386, alpha, ia64, powerpc, sparc,
    sparc64, and arm (all 59 defconfigs).

    Signed-off-by: Randy Dunlap
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Randy Dunlap
     
  • Update some of the layered parport_driver code to use parport->dev:

    - i2c-parport (parent of i2c_adapter)
    - spi_butterfly (parent of spi_master, allowing cruft removal)
    - lp (creating class_device)
    - ppdev (parent of parportN device)
    - tipar (creating class_device)

    There are still drivers that should be updated, like some of the input
    drivers; but they won't be any worse off than they are today.

    Signed-off-by: David Brownell
    Cc: Greg KH
    Cc: Jean Delvare
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    David Brownell
     

08 May, 2007

1 commit

  • Remove software_suspend() and all its users since
    pm_suspend(PM_SUSPEND_DISK) should be equivalent and there's no point in
    having two interfaces for the same thing.

    The patch also changes the valid_state function to return 0 (false) for
    PM_SUSPEND_DISK when SOFTWARE_SUSPEND is not configured instead of
    accepting it and having the whole thing fail later.

    Signed-off-by: Johannes Berg
    Acked-by: "Rafael J. Wysocki"
    Cc: Pavel Machek
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Johannes Berg
     

07 May, 2007

1 commit

  • * 'for-linus' of master.kernel.org:/home/rmk/linux-2.6-arm: (82 commits)
    [ARM] Add comments marking in-use ptrace numbers
    [ARM] Move syscall saving out of the way of utrace
    [ARM] 4360/1: S3C24XX: regs-udc.h remove unused macro
    [ARM] 4358/1: S3C24XX: mach-qt2410.c: remove linux/mmc/protocol.h header
    [ARM] mm 10: allow memory type to be specified with ioremap
    [ARM] mm 9: add additional device memory types
    [ARM] mm 8: define mem_types table L1 bit 4 to be for ARMv6
    [ARM] iop: add missing parens in macro
    [ARM] mm 7: remove duplicated __ioremap() prototypes
    ARM: OMAP: fix OMAP1 mpuio suspend/resume oops
    ARM: OMAP: MPUIO wake updates
    ARM: OMAP: speed up gpio irq handling
    ARM: OMAP: plat-omap changes for 2430 SDP
    ARM: OMAP: gpio object shrinkage, cleanup
    ARM: OMAP: /sys/kernel/debug/omap_gpio
    ARM: OMAP: Implement workaround for GPIO wakeup bug in OMAP2420 silicon
    ARM: OMAP: Enable 24xx GPIO autoidling
    [ARM] 4318/2: DSM-G600 Board Support
    [ARM] 4227/1: minor head.S fixups
    [ARM] 4328/1: Move i.MX UART regs to driver
    ...

    Linus Torvalds
     

05 May, 2007

1 commit

  • * master.kernel.org:/pub/scm/linux/kernel/git/gregkh/pci-2.6: (59 commits)
    PCI: Free resource files in error path of pci_create_sysfs_dev_files()
    pci-quirks: disable MSI on RS400-200 and RS480
    PCI hotplug: Use menuconfig objects
    PCI: ZT5550 CPCI Hotplug driver fix
    PCI: rpaphp: Remove semaphores
    PCI: rpaphp: Ensure more pcibios_add/pcibios_remove symmetry
    PCI: rpaphp: Use pcibios_remove_pci_devices() symmetrically
    PCI: rpaphp: Document is_php_dn()
    PCI: rpaphp: Document find_php_slot()
    PCI: rpaphp: Rename rpaphp_register_pci_slot() to rpaphp_enable_slot()
    PCI: rpaphp: refactor tail call to rpaphp_register_slot()
    PCI: rpaphp: remove rpaphp_set_attention_status()
    PCI: rpaphp: remove print_slot_pci_funcs()
    PCI: rpaphp: Remove setup_pci_slot()
    PCI: rpaphp: remove a call that does nothing but a pointer lookup
    PCI: rpaphp: Remove another wrappered function
    PCI: rpaphp: Remve another call that is a wrapper
    PCI: rpaphp: remove a function that does nothing but wrap debug printks
    PCI: rpaphp: Remove un-needed goto
    PCI: rpaphp: Fix a memleak; slot->location string was never freed
    ...

    Linus Torvalds
     

03 May, 2007

1 commit

  • I noticed that many source files include 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 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/141

    Signed-off-by: Jean Delvare
    Cc: Badari Pulavarty
    Signed-off-by: Greg Kroah-Hartman

    Jean Delvare
     

02 May, 2007

24 commits

  • When compiled as a module, the i2c-s3c2410 driver does not
    free either the IRQ or the i2c adapter it attached to the system.

    As part of this fix, move to the usual kernel style
    of freeing items as part of the probe error path
    making the remove process easier.

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

    Ben Dooks
     
  • Fix the setup time for SDA to SCL due to the way
    the S3C24XX I2C controller works.

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

    Ben Dooks
     
  • Add a driver for the i2c-tiny-usb interface. This is a simple
    do-it-yourself USB to I2C interface targeted at experimental and
    home use. See the i2c-tiny-usb homepage for hardware details:
    http://www.harbaum.org/till/i2c_tiny_usb

    Signed-off-by: Till Harbaum
    Signed-off-by: Jean Delvare

    Till Harbaum
     
  • SPIN_LOCK_UNLOCKED cleanup, use __SPIN_LOCK_UNLOCKED instead.

    Signed-off-by: Milind Arun Choudhary
    Signed-off-by: Jean Delvare

    Milind Arun Choudhary
     
  • The new generic i2c-gpio driver should be used instead.
    The obsolete drivers will be removed in September 2007.

    Signed-off-by: Jean Delvare
    Cc: Deepak Saxena
    Cc: Jordan Crouse

    Jean Delvare
     
  • Platform driver for the Simtec CPLD based simple I2C logic.

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

    Ben Dooks
     
  • This is a very simple bitbanging I2C bus driver utilizing the new
    arch-neutral GPIO API. Useful for chips that don't have a built-in
    I2C controller, additional I2C busses, or testing purposes.

    To use, include something similar to the following in the
    board-specific setup code:

    #include

    static struct i2c_gpio_platform_data i2c_gpio_data = {
    .sda_pin = GPIO_PIN_FOO,
    .scl_pin = GPIO_PIN_BAR,
    };
    static struct platform_device i2c_gpio_device = {
    .name = "i2c-gpio",
    .id = 0,
    .dev = {
    .platform_data = &i2c_gpio_data,
    },
    };

    Register this platform_device, set up the I2C pins as GPIO if
    required and you're ready to go. This will use default values for
    udelay and timeout, and will work with GPIO hardware that does not
    support open drain mode, but allows sensing of the SDA and SCL lines
    even when they are being driven.

    Signed-off-by: Haavard Skinnemoen
    Signed-off-by: Jean Delvare

    Haavard Skinnemoen
     
  • Allow the whole I2C menu to be disabled at once without diving into
    the submenus for deselecting all options (should the user desire so).

    Signed-off-by: Jan Engelhardt
    Signed-off-by: Jean Delvare

    Jan Engelhardt
     
  • Add back the i2c_smbus_read_block_data helper function, it is needed
    by the upcoming lm93 hardware monitoring driver and possibly others.

    Signed-off-by: Jean Delvare

    Jean Delvare
     
  • It was reported to me that the i2c-pxa driver was not able to process
    more that 50 transactions per second. Investigation revealed that the
    I2C unit was busy for 20 ms after every transaction. The reason seems
    to be that we forget to clear the STOP and ACKNACK bits at the end of
    the transaction. According to the PXA27x developer's manual, we shall
    do so.

    Signed-off-by: Jean Delvare
    Cc: Lennert Buytenhek
    Cc: Nicolas Pitre

    Jean Delvare
     
  • Improve the debugging features of the i2c-algo-bit driver:
    * Make it possible to compile the driver without debugging support
    at all, making it much smaller.
    * Use dev_dbg() for debugging messages where possible, and dev_err()
    for error messages.
    * Remove redundant debugging messages.

    These changes allowed for minor code cleanups, which are included
    as well.

    Signed-off-by: Jean Delvare

    Jean Delvare
     
  • The original i2c-algo-bit implementation uses a 33/66 SCL duty cycle
    when bits are being written on the bus. While the I2C specification
    doesn't forbid it, this prevents us from driving the I2C bus to its
    max speed, limiting us to 66 kbps max on standard I2C busses.

    Implementing a 50/50 duty cycle instead lets us max out the bandwidth
    up to the theoretical max of 100 kbps on standard I2C busses. This is
    particularly important when large amounts of data need to be transfered
    over the bus, as is the case with some TV adapters when the firmware is
    being uploaded.

    In fact this change even allows, at least in theory, fast-mode I2C
    support at 125, 166 and 250 kbps. There's no way to reach the
    theoretical max of 400 kbps with this implementation. But I don't
    think we want to put efforts in that direction anyway: software-driven
    I2C is very CPU-intensive and bad for latency.

    Other timing changes:
    * Don't set SDA high explicitly on error, we're going to issue a stop
    condition before we leave anyway.
    * If an error occurs when sending the slave address, yield the CPU
    before retrying, and remove the additional delay after the new start
    condition.

    Signed-off-by: Jean Delvare

    Jean Delvare
     
  • Update the OMAP I2C driver to use i2c_add_numbered_adapter(), so that
    later patches can convert boards to using new-style drivers.

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

    David Brownell
     
  • The i2c linux driver for blackfin architecture which supports blackfin
    on-chip TWI controller i2c operation.

    Signed-off-by: Bryan Wu
    Reviewed-by: Alexey Dobriyan
    Cc: David Brownell
    Signed-off-by: Andrew Morton
    Signed-off-by: Jean Delvare

    Bryan Wu
     
  • Signed-off-by: Ladislav Michl
    Signed-off-by: Jean Delvare

    Ladislav Michl
     
  • Make i2c_del_driver a void function, like all other driver removal
    functions. It always returned 0 even when errors occured, and nobody
    ever actually checked the return value anyway. And we cannot fail
    a module removal anyway.

    Signed-off-by: Jean Delvare

    Jean Delvare
     
  • Move the declaration of i2c-isa-only exported symbols to i2c-isa
    itself, that's the best way to ensure nobody will attempt to use them.
    Hopefully we'll get rid of the exports themselves soon anyway.

    Signed-off-by: Jean Delvare

    Jean Delvare
     
  • Add a new helper function to instantiate an i2c device. It is meant as a
    replacement for i2c_new_device() when you don't know for sure at which
    address your I2C/SMBus device lives. This happens frequently on TV
    adapters for example, you know there is a tuner chip on the bus, but
    depending on the exact board model and revision, it can live at different
    addresses. So, the new i2c_new_probed_device() function will probe the bus
    according to a list of addresses, and as soon as one of these addresses
    responds, it will call i2c_new_device() on that one address.

    This function will make it possible to port the old i2c drivers to the
    new model quickly.

    Signed-off-by: Jean Delvare

    Jean Delvare
     
  • Add i2c_bit_add_numbered_bus(), which is equivalent to i2c_bit_add_bus
    except that it calls i2c_add_numbered_adapter() at the end instead of
    i2c_add_adapter().

    Signed-off-by: Jean Delvare

    Jean Delvare
     
  • Make i2c-core.c obey Documentation/CodingStyle better by snugging
    the EXPORT_SYMBOL declarations next to the relevant definitions.

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

    David Brownell
     
  • This adds a call, i2c_add_numbered_adapter(), registering an I2C adapter
    with a specific bus number and then creating I2C device nodes for any
    pre-declared devices on that bus. It builds on previous patches adding
    I2C probe() and remove() support, and that pre-declaration of devices.

    This completes the core support for "new style" I2C device drivers.
    Those follow the standard driver model for binding devices to drivers
    (using probe and remove methods) rather than a legacy model (where the
    driver tries to autoconfigure each bus, and registers devices itself).

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

    David Brownell
     
  • This provides partial support for new-style I2C driver binding. It builds
    on "struct i2c_board_info" declarations that identify I2C devices on a given
    board. This is needed on systems with I2C devices that can't be fully probed
    and/or autoconfigured, such as many embedded Linux configurations where the
    way a given I2C device is wired may affect how it must be used.

    There are two models for declaring such devices:

    * LATE -- using a public function i2c_new_device(). This lets modules
    declare I2C devices found *AFTER* a given I2C adapter becomes available.

    For example, a PCI card could create adapters giving access to utility
    chips on that card, and this would be used to associate those chips with
    those adapters.

    * EARLY -- from arch_initcall() level code, using a non-exported function
    i2c_register_board_info(). This copies the declarations *BEFORE* such
    an i2c_adapter becomes available, arranging that i2c_new_device() will
    be called later when i2c-core registers the relevant i2c_adapter.

    For example, arch/.../.../board-*.c files would declare the I2C devices
    along with their platform data, and I2C devices would behave much like
    PNPACPI devices. (That is, both enumerate from board-specific tables.)

    To match the exported i2c_new_device(), the previously-private function
    i2c_unregister_device() is now exported.

    Pending later patches using these new APIs, this is effectively a NOP.

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

    David Brownell
     
  • More update for new style driver support: add a remove() method, and
    use it in the relevant code paths.

    Again, nothing will use this yet since there's nothing to create devices
    feeding this infrastructure.

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

    David Brownell
     
  • One of a series of I2C infrastructure updates to support enumeration using
    the standard Linux driver model.

    This patch updates probe() and associated hotplug/coldplug support, but
    not remove(). Nothing yet _uses_ it to create I2C devices, so those
    hotplug/coldplug mechanisms will be the only externally visible change.
    This patch will be an overall NOP since the I2C stack doesn't yet create
    clients/devices except as part of binding them to legacy drivers.

    Some code is moved earlier in the source code, helping group more of the
    per-device infrastructure in one place and simplifying handling per-device
    attributes.

    Terminology being adopted: "legacy drivers" create devices (i2c_client)
    themselves, while "new style" ones follow the driver model (the i2c_client
    is handed to the probe routine). It's an either/or thing; the two models
    don't mix, and drivers that try mixing them won't even be registered.

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

    David Brownell