04 Oct, 2016

40 commits

  • Change from 'const int' to just 'int'.

    Cc:
    Signed-off-by: Lee Jones

    Lee Jones
     
  • There are no other functions which can over-ride it.

    Signed-off-by: Lee Jones

    Lee Jones
     
  • Doesn't appear to be used. No call sites exist.

    Signed-off-by: Lee Jones

    Lee Jones
     
  • There are no call sites for these functions. Strip them out.

    Signed-off-by: Lee Jones

    Lee Jones
     
  • Due to the lack of parity in the way array fields have been named/
    numbered, a mistake was made where more debug fields were declared
    than actually existed. In doing so, 2 fields were added, which
    although unclear, were already declared in the array. The result
    was that the latter declarations trashed the former ones.

    This patch places the array back in the correct order and removes
    the offending NULL entries.

    While we're at it, let's ensure this doesn't happen again by naming
    each field properly and add a new *_LAST define to describe how
    many fields there should be.

    Signed-off-by: Lee Jones

    Lee Jones
     
  • Reported by [-Wold-style-declaration].

    Signed-off-by: Lee Jones

    Lee Jones
     
  • When building with -Woverride-init, we get a warning about an incorrect
    initializer:

    drivers/mfd/rk808.c:244:8: error: initialized field overwritten [-Werror=override-init]
    [RK818_IRQ_DISCHG_ILIM] = {

    This is clearly a mistake, as both RK818_IRQ_DISCHG_ILIM and RK818_IRQ_USB_OV
    are defined as '7', but they refer to different register bits. Changing
    RK818_IRQ_DISCHG_ILIM to 15 is consistent with how all other 14 interrupts are
    handled here, so I'm assuming this is what it should have been.

    Fixes: 2eedcbfc0612 ("mfd: rk808: Add RK818 support")
    Signed-off-by: Arnd Bergmann
    Acked-by: Andy Yan
    Signed-off-by: Lee Jones

    Arnd Bergmann
     
  • The tps65217 gained a new warning when building with W=1:

    drivers/mfd/tps65217.c:85:1: error: 'inline' is not at beginning of declaration [-Werror=old-style-declaration]

    This fixes it by putting the 'inline' modifier before 'const'.

    Fixes: 262d5cc6ceb2 ("mfd: tps65217: Add support for IRQs")
    Signed-off-by: Arnd Bergmann
    Signed-off-by: Lee Jones

    Arnd Bergmann
     
  • The mutex is not used, so remove it.

    Signed-off-by: Axel Lin
    Signed-off-by: Lee Jones

    Axel Lin
     
  • readl_poll_timeout() calls usleep_range(), but
    regmap_atmel_hlcdc_reg_write() is called in atomic context (regmap
    spinlock held).

    Replace the readl_poll_timeout() call by readl_poll_timeout_atomic().

    Cc:
    Fixes: ea31c0cf9b07 ("mfd: atmel-hlcdc: Implement config synchronization")
    Signed-off-by: Boris Brezillon
    Signed-off-by: Lee Jones

    Boris Brezillon
     
  • The newly added exynos lpass driver produces a build warning when
    CONFIG_PM is disabled since the only callers of exynos_lpass_disable
    are under an #ifdef:

    drivers/mfd/exynos-lpass.c:93:13: error: 'exynos_lpass_disable' defined but not used [-Werror=unused-function]
    static void exynos_lpass_disable(struct exynos_lpass *lpass)

    This removes the #ifdef and replaces it with __maybe_unused annotations
    so the compiler can leave out the unused code silently with less
    room for mistakes.

    Fixes: 36c26760bba8 ("mfd: Add Samsung Exynos Low Power Audio Subsystem driver")
    Signed-off-by: Arnd Bergmann
    Reviewed-by: Sylwester Nawrocki
    Signed-off-by: Lee Jones

    Arnd Bergmann
     
  • Default I2C device properties for Intel Broxton, especially SDA hold time
    may not be enough on Intel Apollo Lake. These properties are used in case
    we don't get timing parameters from ACPI.

    The default SDA hold time for Broxton may fail with arbitration lost errors
    on Apollo Lake:

    i2c_designware i2c_designware.1: i2c_dw_handle_tx_abort: lost arbitration

    Fix this by using different default device properties on Apollo Lake than
    Broxton.

    Reported-by: Paul Liu
    Bugzilla: https://bugzilla.kernel.org/show_bug.cgi?id=156181
    Signed-off-by: Jarkko Nikula
    Acked-by: Mika Westerberg
    Signed-off-by: Lee Jones

    Jarkko Nikula
     
  • The Kconfig currently controlling compilation of this code is:

    drivers/mfd/Kconfig:config TWL4030_CORE
    drivers/mfd/Kconfig: bool "TI TWL4030/TWL5030/TWL6030/TPS659x0 Support"

    ...meaning that it currently is not being built as a module by anyone.

    Lets remove what modular code that we can, so that when reading the
    driver there is less doubt that it is builtin-only. Note that we can't
    remove the twl_remove() itself ; it is still used by the probe unwind
    routine. So we leave it linked into the .remove as well, even though
    it will most likely never be called via that path from an unbind.

    Since module_i2c_driver() uses the same init level priority as
    builtin_i2c_driver() the init ordering remains unchanged with
    this commit.

    Also note that MODULE_DEVICE_TABLE is a no-op for non-modular code.

    We also delete the MODULE_LICENSE tag etc. since all that information
    is already contained at the top of the file in the comments.

    Signed-off-by: Paul Gortmaker
    Acked-by: Tony Lindgren
    Signed-off-by: Lee Jones

    Paul Gortmaker
     
  • The Kconfig currently controlling compilation of this code is:

    drivers/mfd/Kconfig:config MFD_SUN6I_PRCM
    drivers/mfd/Kconfig: bool "Allwinner A31 PRCM controller"

    ...meaning that it currently is not being built as a module by anyone.

    Lets remove the couple traces of modularity so that when reading the
    driver there is no doubt it is builtin-only.

    Since module_platform_driver() uses the same init level priority as
    builtin_platform_driver() the init ordering remains unchanged with
    this commit.

    We also delete the MODULE_LICENSE tag etc. since all that information
    is already contained at the top of the file in the comments.

    Signed-off-by: Paul Gortmaker
    Acked-by: Maxime Ripard
    Acked-by: Boris Brezillon
    Signed-off-by: Lee Jones

    Paul Gortmaker
     
  • The Kconfig currently controlling compilation of this code is:

    drivers/mfd/Kconfig:config MFD_SMSC
    drivers/mfd/Kconfig: bool "SMSC ECE1099 series chips"

    ...meaning that it currently is not being built as a module by anyone.

    Lets remove the modular code that is essentially orphaned, so that
    when reading the driver there is no doubt it is builtin-only.

    Since module_init was not in use by this code, the init ordering
    remains unchanged with this commit.

    We replace module.h with init.h and delete an unused moduleparam.h
    include.

    Also note that MODULE_DEVICE_TABLE is a no-op for non-modular code.

    We also delete the MODULE_LICENSE tag etc. since all that information
    is already contained at the top of the file in the comments.

    Cc: Sourav Poddar
    Signed-off-by: Paul Gortmaker
    Signed-off-by: Lee Jones

    Paul Gortmaker
     
  • The Kconfig currently controlling compilation of this code is:

    drivers/mfd/Kconfig:config MFD_INTEL_MSIC
    drivers/mfd/Kconfig: bool "Intel MSIC

    ...meaning that it currently is not being built as a module by anyone.

    Lets remove the couple instances of module references, so that
    when reading the driver there is no doubt it is builtin-only.

    Since module_platform_driver() uses the same init level priority as
    builtin_platform_driver() the init ordering remains unchanged with
    this commit.

    We also delete the MODULE_LICENSE tag etc. since all that information
    is already contained at the top of the file in the comments.

    Signed-off-by: Paul Gortmaker
    Acked-by: Mika Westerberg
    Signed-off-by: Lee Jones

    Paul Gortmaker
     
  • The Kconfig currently controlling compilation of this code is:

    drivers/mfd/Kconfig:config MFD_AS3722
    drivers/mfd/Kconfig: bool "ams AS3722 Power Management IC"

    ...meaning that it currently is not being built as a module by anyone.

    In response to an earlier patch set suggesting removal of the unused
    modular code, Laxman suggested that this driver be instead moved to
    tristate.

    We do that here, and confirm it can build and modpost as a tristate.
    However there remains to be runtime testing in order to ensure this
    change is 100% functional for "=m".

    Cc: Florian Lobmaier
    Cc: Laxman Dewangan
    Signed-off-by: Paul Gortmaker
    Signed-off-by: Lee Jones

    Paul Gortmaker
     
  • The Kconfig currently controlling compilation of this code is:

    drivers/mfd/Kconfig:config MFD_ALTERA_A10SR
    drivers/mfd/Kconfig: bool "Altera Arria10 DevKit System Resource chip"

    ...meaning that it currently is not being built as a module by anyone.

    Lets remove the modular code that is essentially orphaned, so that
    when reading the driver there is no doubt it is builtin-only.

    Since builtin_driver() uses the same init level priority as
    module_spi_driver() the init ordering remains unchanged with
    this commit. [Note that there is no builtin_spi_driver macro,
    so we open-code what it would be via builtin_driver().]

    Also note that MODULE_DEVICE_TABLE is a no-op for non-modular code.

    We also delete the MODULE_LICENSE tag etc. since all that information
    was (or is now) contained at the top of the file in the comments.

    Cc: Thor Thayer
    Signed-off-by: Paul Gortmaker
    Signed-off-by: Lee Jones

    Paul Gortmaker
     
  • Add tps65217 power buttor subdevice with assigned IRQ resources.

    Signed-off-by: Marcin Niestroj
    Acked-by: Tony Lindgren
    Signed-off-by: Lee Jones

    Marcin Niestroj
     
  • Add support for handling IRQs: power button, AC and USB power state
    changes. Mask and interrupt bits are shared within one register, which
    prevents us to use regmap_irq implementation. New irq_domain is created in
    order to add interrupt handling for each tps65217's subsystem. IRQ
    resources have been added for charger subsystem to be able to notify about
    AC and USB state changes.

    Signed-off-by: Marcin Niestroj
    Reviewed-by: Grygorii Strashko
    Tested-by: Tony Lindgren
    Signed-off-by: Lee Jones

    Marcin Niestroj
     
  • These structures are only used to copy into other structures, so declare
    them as const.

    The semantic patch that makes this change is as follows:
    (http://coccinelle.lip6.fr/)

    //
    @r disable optional_qualifier@
    identifier i;
    position p;
    @@
    static struct gpio_chip i@p = { ... };

    @ok@
    identifier r.i;
    expression e;
    position p;
    @@
    e = i@p;

    @bad@
    position p != {r.p,ok.p};
    identifier r.i;
    struct gpio_chip e;
    @@
    e@i@p

    @depends on !bad disable optional_qualifier@
    identifier r.i;
    @@
    static
    +const
    struct gpio_chip i = { ... };
    //

    Signed-off-by: Julia Lawall
    Signed-off-by: Lee Jones

    Julia Lawall
     
  • Signed-off-by: Andrew Jeffery
    Acked-by: Rob Herring
    Acked-by: Joel Stanley
    Acked-by: Linus Walleij
    Signed-off-by: Lee Jones

    Andrew Jeffery
     
  • Reviewed-by: Andrew Jeffery
    Signed-off-by: Lee Jones

    Lee Jones
     
  • probe_irq_off() returns '0' on failure, not NO_IRQ, so the check
    in this driver is clearly wrong. This replaces it with the
    regular '!irq' check used in other drivers.

    The sa1100 platform that this driver is used on originally numbered
    all its interrupts starting at '0', which would have conflicted with
    this change, but as of commit 18f3aec ("ARM: 8230/1: sa1100: shift
    IRQs by one"), this is not a problem any more.

    Signed-off-by: Arnd Bergmann
    Signed-off-by: Lee Jones

    Arnd Bergmann
     
  • Since the act8945a-charger is regarded as a sub-device and it using
    "interrupts" property, update the examples section.

    Signed-off-by: Wenyou Yang
    Acked-by: Rob Herring
    Signed-off-by: Lee Jones

    Wenyou Yang
     
  • Bulk access is not working with twl6040, we need to use single register
    access. Bulk access would happen when we try to sync the regcache after
    power on.

    Signed-off-by: Peter Ujfalusi
    Signed-off-by: Lee Jones

    Peter Ujfalusi
     
  • As runtime PM doesn't function whilst processing system suspend/resume
    operations and the Arizona IRQ handlers need runtime PM to function
    we must disable IRQs during these operations. Whilst this is
    already done in the driver we are using suspend/suspend_late and
    resume/resume_noirq to do so which has two problems. Firstly, as
    suspend_late is before suspend_noirq that means we still have a
    small window where an IRQ can cause issues. Secondly, if another
    suspend_late handler fails after ours has run then (as resume_noirq
    will not run) we will make unbalanced calls to enable_irq.

    This is all simply fixed by using the suspend_noirq callback rather
    than suspend_late. Whilst we are doing this tidy the code up a little,
    and use the appropriate helper macros.

    Signed-off-by: Charles Keepax
    Signed-off-by: Lee Jones

    Charles Keepax
     
  • To regard the act8945a-charger as a sub-device, add .of_compatible for
    act8945a-charger cell.

    Signed-off-by: Wenyou Yang
    Signed-off-by: Lee Jones

    Wenyou Yang
     
  • There are some cases in arizona_dev_init, such as where we don't
    recognise the chip ID, in which we head to the error path without
    setting a sensible error code in ret. This would lead to the chip
    silently failing probe, as it would still return 0. Fix this up by
    adding appropriate sets of the return value.

    Whilst adding these update the existing paths that do return an error
    when the chip is not recognised to use ENODEV, which seems like a better
    fit.

    Signed-off-by: Charles Keepax
    Signed-off-by: Lee Jones

    Charles Keepax
     
  • This patch adds common driver for the Top block of the Samsung Exynos
    SoC Low Power Audio Subsystem. This is a minimal driver which prepares
    resources for IP blocks like I2S, audio DMA and UART and exposes
    a regmap for the Top block registers. Also system power ops are added
    to ensure the Audio Subsystem is operational after system suspend/resume
    cycle.

    Signed-off-by: Inha Song
    Signed-off-by: Beomho Seo
    Signed-off-by: Sylwester Nawrocki
    Tested-by: Chanwoo Choi
    Signed-off-by: Lee Jones

    Sylwester Nawrocki
     
  • This patch adds documentation of the DT bindings for the Samsung
    Exynos SoC Low Power Audio Subsystem.

    Signed-off-by: Sylwester Nawrocki
    Acked-by: Rob Herring
    Signed-off-by: Lee Jones

    Sylwester Nawrocki
     
  • The function da9052_clear_fault_log() is added to mitigate the case of
    persistent data being transferred between reboots.

    Clearance of any the persistent information within the DA9053 FAULT_LOG
    register must be completed during start-up so the fault-log does not
    continue with previous values. A clearance function has been added here in
    the kernel driver because wiping the fault-log cannot be counted on outside
    the Linux kernel.

    Signed-off-by: Steve Twiss
    Reviewed-by: Adam Thomson
    Signed-off-by: Lee Jones

    Steve Twiss
     
  • Adjust jump targets according to the Linux coding style convention.
    Another check for the variable "status" can be omitted then at the end.

    Link: https://lkml.kernel.org/g/
    Signed-off-by: Markus Elfring
    Signed-off-by: Lee Jones

    Markus Elfring
     
  • Member "status" of struct usb_sg_request is managed by usb core. A
    spin lock is used to serialize the change of it. The driver could
    check the value of req->status, but should avoid changing it without
    the hold of the spinlock. Otherwise, it could cause race or error
    in usb core.

    This patch could be backported to stable kernels with version later
    than v3.14.

    Cc: stable@vger.kernel.org # 3.14+
    Cc: Alan Stern
    Cc: Roger Tseng
    Signed-off-by: Lu Baolu
    Signed-off-by: Lee Jones

    Lu Baolu
     
  • probe_irq_on() only returns non-zero if it found any interrupts below
    IRQ32 which could be probe candidates. If all the probable interrupts
    are higher than 32, then this will cause a failure. Fix this.

    Signed-off-by: Russell King
    Signed-off-by: Lee Jones

    Russell King
     
  • The MSM8660, APQ8060, IPQ806x and MSM8960 have a GCC clock
    to the message RAM used by the RPM. This needs to be enabled
    for messages to pass through. This is a crude solution that
    simply prepare/enable at probe() and disable/unprepare
    at remove(). More elaborate PM is probably possible to
    add later.

    The construction uses IS_ERR() to gracefully handle the
    platforms that do not provide a message RAM clock. It will
    bail out of probe only if the clock is hitting a probe
    deferral situation.

    Of course this requires the proper device tree set-up:

    rpm: rpm@104000 {
    compatible = "qcom,rpm-msm8660";
    clocks = ;
    clock-names = "ram";
    ...
    };

    I have provided this in the MSM8660 device tree, and will
    provide patches for the other targets.

    Cc: Björn Andersson
    Signed-off-by: Linus Walleij
    Signed-off-by: Lee Jones

    Linus Walleij
     
  • Change my email address to kernel.org instead of Samsung one for the
    purpose of any future contact. The copyrights remain untouched and are
    attributed to Samsung.

    Signed-off-by: Krzysztof Kozlowski
    Signed-off-by: Lee Jones

    Krzysztof Kozlowski
     
  • The lp873x series of PMICs have a bunch of regulators and a couple
    of GPO(General Purpose Outputs).
    Add information for the MFD and regulator drivers.

    Signed-off-by: Keerthy
    Acked-by: Rob Herring
    Signed-off-by: Lee Jones

    Keerthy
     
  • The Intel Whiskey Cove PMIC includes several function units, e.g.
    ADC, thermal, USB Type-C, GPIO, etc. The corresponding device has
    to be created in the mfd driver(intel_soc_pmic_bxtwc.c). This change
    adds the USB Type-c device.

    Signed-off-by: Bin Gao
    Signed-off-by: Lee Jones

    Bin Gao
     
  • Intel Kaby Lake PCH-H has the same LPSS than Intel Sunrisepoint. Add the new
    IDs to the list of supported devices.

    Signed-off-by: Mika Westerberg
    Signed-off-by: Lee Jones

    Mika Westerberg