09 Sep, 2016

3 commits

  • Depending on a number of factors including:
    - Which exact Rockchip SoC we're working with
    - How deep we suspend
    - Which i2c port we're on

    We might lose the state of the i2c registers at suspend time.
    Specifically we've found that on rk3399 the i2c ports that are not in
    the PMU power domain lose their state with the current suspend depth
    configured by ARM Tursted Firmware.

    Note that there are very few actual i2c registers that aren't configured
    per transfer anyway so all we actually need to re-configure are the
    clock config registers. We'll just add a call to rk3x_i2c_adapt_div()
    at resume time and be done with it.

    NOTE: On rk3399 on ports whose power was lost, I put printouts in at
    resume time. I saw things like:
    before: con=0x00010300, div=0x00060006
    after: con=0x00010200, div=0x00180025

    Signed-off-by: Douglas Anderson
    Reviewed-by: David Wu
    Tested-by: David Wu
    [wsa: removed duplicate const]
    Signed-off-by: Wolfram Sang

    Doug Anderson
     
  • Signed-off-by: Geert Uytterhoeven
    Signed-off-by: Wolfram Sang

    Geert Uytterhoeven
     
  • There are several ways to set the SDA hold time for i2c controller,
    including: Device Tree, built-in device properties and ACPI. However,
    if the SDA hold time is not specified by above method, we should
    read the value, where it is preset by firmware, and save it to
    sda_hold_time. This is needed because when i2c controller enters
    runtime suspend, the DW_IC_SDA_HOLD value will be reset to chipset
    default value. And during runtime resume, i2c_dw_init will be called
    to reconfigure i2c controller. If sda_hold_time is zero, the chipset
    default hold time will be used, that will be too short for some
    platforms. Therefore, to have a better tolerance, the DW_IC_SDA_HOLD
    value should be kept by sda_hold_time.

    Signed-off-by: Zhuo-hao Lee
    Reviewed-by: Andy Shevchenko
    Acked-by: Jarkko Nikula
    Signed-off-by: Wolfram Sang

    Zhuo-hao Lee
     

08 Sep, 2016

1 commit


26 Aug, 2016

4 commits


15 Aug, 2016

8 commits

  • There is only one waiter for the completion, therefore there
    is no need to use complete_all(). Let's make that clear by
    using complete() instead of complete_all().

    The usage pattern of the completion is:

    meson_i2c_xfer_msg()
    reinit_completion()
    ...
    /* Start the transfer */
    ...
    wait_for_completion_timeout()

    Signed-off-by: Daniel Wagner
    Signed-off-by: Wolfram Sang

    Daniel Wagner
     
  • There is only one waiter for the completion, therefore there
    is no need to use complete_all(). Let's make that clear by
    using complete() instead of complete_all().

    The usage pattern of the completion is:

    brcmstb_send_i2c_cmd()
    reinit_completion()
    ...
    /* initiate transfer by setting iic_enable */
    ...
    brcmstb_i2c_wait_for_completion()

    Signed-off-by: Daniel Wagner
    Reviewed-by: Kamal Dasu
    Signed-off-by: Wolfram Sang

    Daniel Wagner
     
  • There is only one waiter for the completion, therefore there
    is no need to use complete_all(). Let's make that clear by
    using complete() instead of complete_all().

    The usage pattern of the completion is:

    bcm_kona_send_i2c_cmd()
    reinit_completion()
    ...
    bcm_kona_i2c_send_cmd_to_ctrl()
    ...
    wait_for_completion_timeout()

    Signed-off-by: Daniel Wagner
    Acked-by: Ray Jui
    Reviewed-by: Tim Kryger
    Signed-off-by: Wolfram Sang

    Daniel Wagner
     
  • There is only one waiter for the completion, therefore there
    is no need to use complete_all(). Let's make that clear by
    using complete() instead of complete_all().

    The usage pattern of the completion is:

    bcm_iproc_i2c_xfer_single_msg()
    reinit_completion()
    ...
    (activate the transfer)
    ...
    wait_for_completion_timeout()

    Signed-off-by: Daniel Wagner
    Acked-by: Ray Jui
    Signed-off-by: Wolfram Sang

    Daniel Wagner
     
  • The "alternative command" feature was introduced with sama5d2 SoCs.

    Its purpose is to let the hardware i2c controller automatically send the
    STOP condition on the i2c bus at the end of a data transfer.
    Without this feature, the i2c driver has to write the 'STOP' bit into the
    Control Register so the hardware i2c controller is triggered to send the
    STOP condition on the bus.

    Using the "alternative command" feature requires to set the transfer data
    length into the 8bit DATAL field of the Alternative Command Register.
    Hence only data transfers up to 255 bytes can take advantage of the
    "alternative command" feature. For greater data transfer sizes, the driver
    should use the previous implementation, when the "alternative command"
    support was not implemented yet.

    Signed-off-by: Cyrille Pitchen
    Signed-off-by: Ludovic Desroches
    Signed-off-by: Wolfram Sang

    Cyrille Pitchen
     
  • clk_disable_unprepare() is missed on failure paths in ocores_i2c_probe().

    Found by Linux Driver Verification project (linuxtesting.org).

    Signed-off-by: Alexey Khoroshilov
    Acked-by: Peter Korsgaard
    Signed-off-by: Wolfram Sang

    Alexey Khoroshilov
     
  • cros_ec_cmd_xfer returns success status if the command transport
    completes successfully, but the execution result is incorrectly ignored.
    In many cases, the execution result is assumed to be successful, leading
    to ignored errors and operating on uninitialized data.

    We've recently introduced the cros_ec_cmd_xfer_status() helper to avoid these
    problems. Let's use it.

    [Regarding the 'Fixes' tag; there is significant refactoring since the driver's
    introduction, but the underlying logical error exists throughout I believe]

    Fixes: 9d230c9e4f4e ("i2c: ChromeOS EC tunnel driver")
    Cc: # 9798ac6d32c1 mfd: cros_ec: Add cros_ec_cmd_xfer_status() helper
    Signed-off-by: Brian Norris
    Reviewed-by: Javier Martinez Canillas
    Reviewed-by: Guenter Roeck
    Signed-off-by: Wolfram Sang

    Brian Norris
     
  • We also need to revert the dynamic OF change, so we get a consistent
    state again. Otherwise, we might have two devices enabled e.g. after
    pinctrl setup fails.

    Signed-off-by: Wolfram Sang
    Signed-off-by: Wolfram Sang
    Cc: stable@kernel.org

    Wolfram Sang
     

31 Jul, 2016

1 commit

  • Pull powerpc updates from Michael Ellerman:
    "Highlights:
    - PowerNV PCI hotplug support.
    - Lots more Power9 support.
    - eBPF JIT support on ppc64le.
    - Lots of cxl updates.
    - Boot code consolidation.

    Bug fixes:
    - Fix spin_unlock_wait() from Boqun Feng
    - Fix stack pointer corruption in __tm_recheckpoint() from Michael
    Neuling
    - Fix multiple bugs in memory_hotplug_max() from Bharata B Rao
    - mm: Ensure "special" zones are empty from Oliver O'Halloran
    - ftrace: Separate the heuristics for checking call sites from
    Michael Ellerman
    - modules: Never restore r2 for a mprofile-kernel style mcount() call
    from Michael Ellerman
    - Fix endianness when reading TCEs from Alexey Kardashevskiy
    - start rtasd before PCI probing from Greg Kurz
    - PCI: rpaphp: Fix slot registration for multiple slots under a PHB
    from Tyrel Datwyler
    - powerpc/mm: Add memory barrier in __hugepte_alloc() from Sukadev
    Bhattiprolu

    Cleanups & fixes:
    - Drop support for MPIC in pseries from Rashmica Gupta
    - Define and use PPC64_ELF_ABI_v2/v1 from Michael Ellerman
    - Remove unused symbols in asm-offsets.c from Rashmica Gupta
    - Fix SRIOV not building without EEH enabled from Russell Currey
    - Remove kretprobe_trampoline_holder from Thiago Jung Bauermann
    - Reduce log level of PCI I/O space warning from Benjamin
    Herrenschmidt
    - Add array bounds checking to crash_shutdown_handlers from Suraj
    Jitindar Singh
    - Avoid -maltivec when using clang integrated assembler from Anton
    Blanchard
    - Fix array overrun in ppc_rtas() syscall from Andrew Donnellan
    - Fix error return value in cmm_mem_going_offline() from Rasmus
    Villemoes
    - export cpu_to_core_id() from Mauricio Faria de Oliveira
    - Remove old symbols from defconfigs from Andrew Donnellan
    - Update obsolete comments in setup_32.c about entry conditions from
    Benjamin Herrenschmidt
    - Add comment explaining the purpose of setup_kdump_trampoline() from
    Benjamin Herrenschmidt
    - Merge the RELOCATABLE config entries for ppc32 and ppc64 from Kevin
    Hao
    - Remove RELOCATABLE_PPC32 from Kevin Hao
    - Fix .long's in tlb-radix.c to more meaningful from Balbir Singh

    Minor cleanups & fixes:
    - Andrew Donnellan, Anna-Maria Gleixner, Anton Blanchard, Benjamin
    Herrenschmidt, Bharata B Rao, Christophe Leroy, Colin Ian King,
    Geliang Tang, Greg Kurz, Madhavan Srinivasan, Michael Ellerman,
    Michael Ellerman, Stephen Rothwell, Stewart Smith.

    Freescale updates from Scott:
    - "Highlights include more 8xx optimizations, device tree updates,
    and MVME7100 support."

    PowerNV PCI hotplug from Gavin Shan:
    - PCI: Add pcibios_setup_bridge()
    - Override pcibios_setup_bridge()
    - Remove PCI_RESET_DELAY_US
    - Move pnv_pci_ioda_setup_opal_tce_kill() around
    - Increase PE# capacity
    - Allocate PE# in reverse order
    - Create PEs in pcibios_setup_bridge()
    - Setup PE for root bus
    - Extend PCI bridge resources
    - Make pnv_ioda_deconfigure_pe() visible
    - Dynamically release PE
    - Update bridge windows on PCI plug
    - Delay populating pdn
    - Support PCI slot ID
    - Use PCI slot reset infrastructure
    - Introduce pnv_pci_get_slot_id()
    - Functions to get/set PCI slot state
    - PCI/hotplug: PowerPC PowerNV PCI hotplug driver
    - Print correct PHB type names

    Power9 idle support from Shreyas B. Prabhu:
    - set power_save func after the idle states are initialized
    - Use PNV_THREAD_WINKLE macro while requesting for winkle
    - make hypervisor state restore a function
    - Rename idle_power7.S to idle_book3s.S
    - Rename reusable idle functions to hardware agnostic names
    - Make pnv_powersave_common more generic
    - abstraction for saving SPRs before entering deep idle states
    - Add platform support for stop instruction
    - cpuidle/powernv: Use CPUIDLE_STATE_MAX instead of MAX_POWERNV_IDLE_STATES
    - cpuidle/powernv: cleanup cpuidle-powernv.c
    - cpuidle/powernv: Add support for POWER ISA v3 idle states
    - Use deepest stop state when cpu is offlined

    Power9 PMU from Madhavan Srinivasan:
    - factor out power8 pmu macros and defines
    - factor out power8 pmu functions
    - factor out power8 __init_pmu code
    - Add power9 event list macros for generic and cache events
    - Power9 PMU support
    - Export Power9 generic and cache events to sysfs

    Power9 preliminary interrupt & PCI support from Benjamin Herrenschmidt:
    - Add XICS emulation APIs
    - Move a few exception common handlers to make room
    - Add support for HV virtualization interrupts
    - Add mechanism to force a replay of interrupts
    - Add ICP OPAL backend
    - Discover IODA3 PHBs
    - pci: Remove obsolete SW invalidate
    - opal: Add real mode call wrappers
    - Rename TCE invalidation calls
    - Remove SWINV constants and obsolete TCE code
    - Rework accessing the TCE invalidate register
    - Fallback to OPAL for TCE invalidations
    - Use the device-tree to get available range of M64's
    - Check status of a PHB before using it
    - pci: Don't try to allocate resources that will be reassigned

    Other Power9:
    - Send SIGBUS on unaligned copy and paste from Chris Smart
    - Large Decrementer support from Oliver O'Halloran
    - Load Monitor Register Support from Jack Miller

    Performance improvements from Anton Blanchard:
    - Avoid load hit store in __giveup_fpu() and __giveup_altivec()
    - Avoid load hit store in setup_sigcontext()
    - Remove assembly versions of strcpy, strcat, strlen and strcmp
    - Align hot loops of some string functions

    eBPF JIT from Naveen N. Rao:
    - Fix/enhance 32-bit Load Immediate implementation
    - Optimize 64-bit Immediate loads
    - Introduce rotate immediate instructions
    - A few cleanups
    - Isolate classic BPF JIT specifics into a separate header
    - Implement JIT compiler for extended BPF

    Operator Panel driver from Suraj Jitindar Singh:
    - devicetree/bindings: Add binding for operator panel on FSP machines
    - Add inline function to get rc from an ASYNC_COMP opal_msg
    - Add driver for operator panel on FSP machines

    Sparse fixes from Daniel Axtens:
    - make some things static
    - Introduce asm-prototypes.h
    - Include headers containing prototypes
    - Use #ifdef __BIG_ENDIAN__ #else for REG_BYTE
    - kvm: Clarify __user annotations
    - Pass endianness to sparse
    - Make ppc_md.{halt, restart} __noreturn

    MM fixes & cleanups from Aneesh Kumar K.V:
    - radix: Update LPCR HR bit as per ISA
    - use _raw variant of page table accessors
    - Compile out radix related functions if RADIX_MMU is disabled
    - Clear top 16 bits of va only on older cpus
    - Print formation regarding the the MMU mode
    - hash: Update SDR1 size encoding as documented in ISA 3.0
    - radix: Update PID switch sequence
    - radix: Update machine call back to support new HCALL.
    - radix: Add LPID based tlb flush helpers
    - radix: Add a kernel command line to disable radix
    - Cleanup LPCR defines

    Boot code consolidation from Benjamin Herrenschmidt:
    - Move epapr_paravirt_early_init() to early_init_devtree()
    - cell: Don't use flat device-tree after boot
    - ge_imp3a: Don't use the flat device-tree after boot
    - mpc85xx_ds: Don't use the flat device-tree after boot
    - mpc85xx_rdb: Don't use the flat device-tree after boot
    - Don't test for machine type in rtas_initialize()
    - Don't test for machine type in smp_setup_cpu_maps()
    - dt: Add of_device_compatible_match()
    - Factor do_feature_fixup calls
    - Move 64-bit feature fixup earlier
    - Move 64-bit memory reserves to setup_arch()
    - Use a cachable DART
    - Move FW feature probing out of pseries probe()
    - Put exception configuration in a common place
    - Remove early allocation of the SMU command buffer
    - Move MMU backend selection out of platform code
    - pasemi: Remove IOBMAP allocation from platform probe()
    - mm/hash: Don't use machine_is() early during boot
    - Don't test for machine type to detect HEA special case
    - pmac: Remove spurrious machine type test
    - Move hash table ops to a separate structure
    - Ensure that ppc_md is empty before probing for machine type
    - Move 64-bit probe_machine() to later in the boot process
    - Move 32-bit probe() machine to later in the boot process
    - Get rid of ppc_md.init_early()
    - Move the boot time info banner to a separate function
    - Move setting of {i,d}cache_bsize to initialize_cache_info()
    - Move the content of setup_system() to setup_arch()
    - Move cache info inits to a separate function
    - Re-order the call to smp_setup_cpu_maps()
    - Re-order setup_panic()
    - Make a few boot functions __init
    - Merge 32-bit and 64-bit setup_arch()

    Other new features:
    - tty/hvc: Use IRQF_SHARED for OPAL hvc consoles from Sam Mendoza-Jonas
    - tty/hvc: Use opal irqchip interface if available from Sam Mendoza-Jonas
    - powerpc: Add module autoloading based on CPU features from Alastair D'Silva
    - crypto: vmx - Convert to CPU feature based module autoloading from Alastair D'Silva
    - Wake up kopald polling thread before waiting for events from Benjamin Herrenschmidt
    - xmon: Dump ISA 2.06 SPRs from Michael Ellerman
    - xmon: Dump ISA 2.07 SPRs from Michael Ellerman
    - Add a parameter to disable 1TB segs from Oliver O'Halloran
    - powerpc/boot: Add OPAL console to epapr wrappers from Oliver O'Halloran
    - Assign fixed PHB number based on device-tree properties from Guilherme G. Piccoli
    - pseries: Add pseries hotplug workqueue from John Allen
    - pseries: Add support for hotplug interrupt source from John Allen
    - pseries: Use kernel hotplug queue for PowerVM hotplug events from John Allen
    - pseries: Move property cloning into its own routine from Nathan Fontenot
    - pseries: Dynamic add entires to associativity lookup array from Nathan Fontenot
    - pseries: Auto-online hotplugged memory from Nathan Fontenot
    - pseries: Remove call to memblock_add() from Nathan Fontenot

    cxl:
    - Add set and get private data to context struct from Michael Neuling
    - make base more explicitly non-modular from Paul Gortmaker
    - Use for_each_compatible_node() macro from Wei Yongjun
    - Frederic Barrat
    - Abstract the differences between the PSL and XSL
    - Make vPHB device node match adapter's
    - Philippe Bergheaud
    - Add mechanism for delivering AFU driver specific events
    - Ignore CAPI adapters misplaced in switched slots
    - Refine slice error debug messages
    - Andrew Donnellan
    - static-ify variables to fix sparse warnings
    - PCI/hotplug: pnv_php: export symbols and move struct types needed by cxl
    - PCI/hotplug: pnv_php: handle OPAL_PCI_SLOT_OFFLINE power state
    - Add cxl_check_and_switch_mode() API to switch bi-modal cards
    - remove dead Kconfig options
    - fix potential NULL dereference in free_adapter()
    - Ian Munsie
    - Update process element after allocating interrupts
    - Add support for CAPP DMA mode
    - Fix allowing bogus AFU descriptors with 0 maximum processes
    - Fix allocating a minimum of 2 pages for the SPA
    - Fix bug where AFU disable operation had no effect
    - Workaround XSL bug that does not clear the RA bit after a reset
    - Fix NULL pointer dereference on kernel contexts with no AFU interrupts
    - powerpc/powernv: Split cxl code out into a separate file
    - Add cxl_slot_is_supported API
    - Enable bus mastering for devices using CAPP DMA mode
    - Move cxl_afu_get / cxl_afu_put to base
    - Allow a default context to be associated with an external pci_dev
    - Do not create vPHB if there are no AFU configuration records
    - powerpc/powernv: Add support for the cxl kernel api on the real phb
    - Add support for using the kernel API with a real PHB
    - Add kernel APIs to get & set the max irqs per context
    - Add preliminary workaround for CX4 interrupt limitation
    - Add support for interrupts on the Mellanox CX4
    - Workaround PE=0 hardware limitation in Mellanox CX4
    - powerpc/powernv: Fix pci-cxl.c build when CONFIG_MODULES=n

    selftests:
    - Test unaligned copy and paste from Chris Smart
    - Load Monitor Register Tests from Jack Miller
    - Cyril Bur
    - exec() with suspended transaction
    - Use signed long to read perf_event_paranoid
    - Fix usage message in context_switch
    - Fix generation of vector instructions/types in context_switch
    - Michael Ellerman
    - Use "Delta" rather than "Error" in normal output
    - Import Anton's mmap & futex micro benchmarks
    - Add a test for PROT_SAO"

    * tag 'powerpc-4.8-1' of git://git.kernel.org/pub/scm/linux/kernel/git/powerpc/linux: (263 commits)
    powerpc/mm: Parenthesise IS_ENABLED() in if condition
    tty/hvc: Use opal irqchip interface if available
    tty/hvc: Use IRQF_SHARED for OPAL hvc consoles
    selftests/powerpc: exec() with suspended transaction
    powerpc: Improve comment explaining why we modify VRSAVE
    powerpc/mm: Drop unused externs for hpte_init_beat[_v3]()
    powerpc/mm: Rename hpte_init_lpar() and move the fallback to a header
    powerpc/mm: Fix build break when PPC_NATIVE=n
    crypto: vmx - Convert to CPU feature based module autoloading
    powerpc: Add module autoloading based on CPU features
    powerpc/powernv/ioda: Fix endianness when reading TCEs
    powerpc/mm: Add memory barrier in __hugepte_alloc()
    powerpc/modules: Never restore r2 for a mprofile-kernel style mcount() call
    powerpc/ftrace: Separate the heuristics for checking call sites
    powerpc: Merge 32-bit and 64-bit setup_arch()
    powerpc/64: Make a few boot functions __init
    powerpc: Re-order setup_panic()
    powerpc: Re-order the call to smp_setup_cpu_maps()
    powerpc/32: Move cache info inits to a separate function
    powerpc/64: Move the content of setup_system() to setup_arch()
    ...

    Linus Torvalds
     

28 Jul, 2016

1 commit

  • Pull i2c updates from Wolfram Sang:
    "Here is the I2C pull request for 4.8:

    - the core and i801 driver gained support for SMBus Host Notify

    - core support for more than one address in DT

    - i2c_add_adapter() has now better error messages. We can remove all
    error messages from drivers calling it as a next step.

    - bigger updates to rk3x driver to support rk3399 SoC

    - the at24 eeprom driver got refactored and can now read special
    variants with unique serials or fixed MAC addresses.

    The rest is regular driver updates and bugfixes"

    * 'i2c/for-4.8' of git://git.kernel.org/pub/scm/linux/kernel/git/wsa/linux: (66 commits)
    i2c: i801: use IS_ENABLED() instead of checking for built-in or module
    Documentation: i2c: slave: give proper example for pm usage
    Documentation: i2c: slave: describe buffer problems a bit better
    i2c: bcm2835: Don't complain on -EPROBE_DEFER from getting our clock
    i2c: i2c-smbus: drop useless stubs
    i2c: efm32: fix a failure path in efm32_i2c_probe()
    Revert "i2c: core: Cleanup I2C ACPI namespace"
    Revert "i2c: core: Add function for finding the bus speed from ACPI"
    i2c: Update the description of I2C_SMBUS
    i2c: i2c-smbus: fix i2c_handle_smbus_host_notify documentation
    eeprom: at24: tweak the loop_until_timeout() macro
    eeprom: at24: add support for at24mac series
    eeprom: at24: support reading the serial number for 24csxx
    eeprom: at24: platform_data: use BIT() macro
    eeprom: at24: split at24_eeprom_write() into specialized functions
    eeprom: at24: split at24_eeprom_read() into specialized functions
    eeprom: at24: hide the read/write loop behind a macro
    eeprom: at24: call read/write functions via function pointers
    eeprom: at24: coding style fixes
    eeprom: at24: move at24_read() below at24_eeprom_write()
    ...

    Linus Torvalds
     

26 Jul, 2016

1 commit


25 Jul, 2016

1 commit

  • * acpi-tables:
    ACPI: Rename configfs.c to acpi_configfs.c to prevent link error
    ACPI: add support for loading SSDTs via configfs
    ACPI: add support for configfs
    efi / ACPI: load SSTDs from EFI variables
    spi / ACPI: add support for ACPI reconfigure notifications
    i2c / ACPI: add support for ACPI reconfigure notifications
    ACPI: add support for ACPI reconfiguration notifiers
    ACPI / scan: fix enumeration (visited) flags for bus rescans
    ACPI / documentation: add SSDT overlays documentation
    ACPI: ARM64: support for ACPI_TABLE_UPGRADE
    ACPI / tables: introduce ARCH_HAS_ACPI_TABLE_UPGRADE
    ACPI / tables: move arch-specific symbol to asm/acpi.h
    ACPI / tables: table upgrade: refactor function definitions
    ACPI / tables: table upgrade: use cacheable map for tables

    Conflicts:
    arch/arm64/include/asm/acpi.h

    Rafael J. Wysocki
     

22 Jul, 2016

1 commit


19 Jul, 2016

5 commits


15 Jul, 2016

4 commits

  • 1. The current QCOM I2C driver code is failing for transfer length
    greater than 255. This is happening due to improper segments length
    as the I2C DMA segments can be maximum of 256 bytes.

    2. The transfer length tlen was being initialized with 0 for 256
    bytes, which is being passed for DMA mappings resulting in improper
    DMA mapping length.

    This patch fixes the above said problems by initializing the block
    count with the values calculated in qup_i2c_set_blk_data and calculating
    the remaining length for last DMA segment. Also, the block data length
    need to be decremented after each transfer. Additionally, this patch
    corrects the tlen assignment for DMA mapping.

    Signed-off-by: Abhishek Sahu
    Signed-off-by: Wolfram Sang

    Abhishek Sahu
     
  • 1. Current QCOM I2C driver hangs when sending data to address 0x03-0x07
    in some scenarios. The QUP controller generates invalid write in this
    case, since these addresses are reserved for different bus formats.

    2. Also, the error handling is done by I2C QUP ISR in the case of DMA
    mode. The state need to be RESET in case of any error for clearing the
    available data in FIFO, which otherwise leaves the BAM DMA controller
    in hang state.

    This patch fixes the above two issues by clearing the error bits from
    I2C and QUP status in ISR in case of I2C error, QUP error and resets
    the QUP state to clear the FIFO data.

    Signed-off-by: Abhishek Sahu
    Signed-off-by: Wolfram Sang

    Abhishek Sahu
     
  • The driver transfer to a message with NOACK always in any size.
    If client (eg. EDID segment point message) needs NOACK condition, it can
    use I2C_M_IGNORE_NAK flag.

    Signed-off-by: Jaedon Shin
    Acked-by: Kamal Dasu
    Signed-off-by: Wolfram Sang

    Jaedon Shin
     
  • The BCM7xxx ARM and MIPS based SoCs share a similar I2C hardware block.

    Signed-off-by: Jaedon Shin
    Acked-by: Florian Fainelli
    Signed-off-by: Wolfram Sang

    Jaedon Shin
     

14 Jul, 2016

10 commits

  • ACPI 5 specification doesn't have property for the I2C bus speed but
    I2cSerialBus resource descriptors which define each controller-slave
    connection define the maximum speed supported by that connection.

    Thus finding the maximum safe speed for the bus is to walk all
    I2cSerialBus resources that are associated to I2C controller and use
    the speed of slowest connection.

    Add function i2c_acpi_find_bus_speed() to the i2c-core that adapter
    drivers can call prior registering itself to core.

    This implies two-step walk through the I2cSerialBus resources: call to
    i2c_acpi_find_bus_speed() does the first scan and finds the safe bus
    speed that adapter drivers can set up. Adapter driver registration does
    the second scan when i2c-core creates the I2C slaves by calling the
    i2c_acpi_register_devices(). In that way the bus speed is set in case
    slave device probe gets called during registration and does
    communication.

    Implement this by reusing the existing ACPI I2C walk routines in the
    i2c-core. Extend them so that slowest connection speed is saved during
    the walk and I2C slaves are registered only when calling through the
    i2c_acpi_register_devices() with the i2c_adapter pointer.

    Signed-off-by: Jarkko Nikula
    Reviewed-by: Andy Shevchenko
    Acked-by: Mika Westerberg
    Signed-off-by: Wolfram Sang

    Jarkko Nikula
     
  • I2C ACPI enumeration was originally implemented in another module under
    drivers/acpi/ but was later moved into i2c-core with added support for
    I2C ACPI operation region.

    Rename these acpi_i2c_ prefixed functions, structures and defines in
    i2c-core to i2c_acpi_ in order to have more consistent name space.

    Signed-off-by: Jarkko Nikula
    Reviewed-by: Andy Shevchenko
    Acked-by: Mika Westerberg
    Signed-off-by: Wolfram Sang

    Jarkko Nikula
     
  • Now that we revisited all error messages, we can use pr_fmt for the
    remaining pr_* messages to ensure consistent output.

    Signed-off-by: Wolfram Sang
    Signed-off-by: Wolfram Sang

    Wolfram Sang
     
  • Use a warning loglevel instead of info and switch to dev_* for device
    info. Also print which client was accessed.

    Signed-off-by: Wolfram Sang
    Acked-by: Mika Westerberg
    Signed-off-by: Wolfram Sang

    Wolfram Sang
     
  • Use dev_err instead of pr_err for more details.

    Signed-off-by: Wolfram Sang
    Signed-off-by: Wolfram Sang

    Wolfram Sang
     
  • Fix some whitespace issues while here.

    Signed-off-by: Wolfram Sang
    Signed-off-by: Wolfram Sang

    Wolfram Sang
     
  • Switch to WARN if no adapter name is given, otherwise we won't know who
    missed to do that. Add error message if device registration fails.
    Update error message for missing algo to match style of the others.

    Signed-off-by: Wolfram Sang
    Signed-off-by: Wolfram Sang

    Wolfram Sang
     
  • Move recovery init to a seperate function to let have
    i2c_register_adapter() less lines and to avoid goto and a label.
    Refactor string handling there for consistency and to save some bytes.

    Signed-off-by: Wolfram Sang
    Signed-off-by: Wolfram Sang

    Wolfram Sang
     
  • On error, we should give idr back to the pool in any case.

    Signed-off-by: Wolfram Sang
    Reviewed-by: Jean Delvare
    Signed-off-by: Wolfram Sang

    Wolfram Sang
     
  • Use devm_* APIs to simplify the code a bit.
    This patch also fixes the memory leak when unload the module.

    Signed-off-by: Axel Lin
    Tested-by: Liviu Dudau
    Acked-by: Liviu Dudau
    Signed-off-by: Wolfram Sang

    Axel Lin