09 May, 2020

1 commit

  • Change the regulator helpers to use common linear_ranges code.

    Signed-off-by: Matti Vaittinen
    Reviewed-by: Mark Brown
    Acked-by: Charles Keepax
    Acked-by: Adam Thomson
    Link: https://lore.kernel.org/r/64f01d5e381b8631a271616b7790f9d5640974fb.1588944082.git.matti.vaittinen@fi.rohmeurope.com
    Signed-off-by: Mark Brown

    Matti Vaittinen
     

15 Aug, 2019

1 commit

  • _opp_supported_by_regulators() wrongly ignored errors from
    regulator_is_supported_voltage(), so it considered errors as
    success. Since
    commit 498209445124 ("regulator: core: simplify return value on suported_voltage")
    regulator_is_supported_voltage() returns a real boolean, so
    errors make _opp_supported_by_regulators() return false.

    That reveals a problem with the declaration of the VDD1/2
    regulators on twl4030.
    The VDD1/VDD2 regulators on twl4030 are neither defined with
    voltage lists nor with the continuous flag set, so
    regulator_is_supported_voltage() returns false and an error
    before above mentioned commit (which was considered success)
    The result is that after the above mentioned commit cpufreq
    does not work properly e.g. dm3730.

    [ 2.490997] core: _opp_supported_by_regulators: OPP minuV: 1012500 maxuV: 1012500, not supported by regulator
    [ 2.501617] cpu cpu0: _opp_add: OPP not supported by regulators (300000000)
    [ 2.509246] core: _opp_supported_by_regulators: OPP minuV: 1200000 maxuV: 1200000, not supported by regulator
    [ 2.519775] cpu cpu0: _opp_add: OPP not supported by regulators (600000000)
    [ 2.527313] core: _opp_supported_by_regulators: OPP minuV: 1325000 maxuV: 1325000, not supported by regulator
    [ 2.537750] cpu cpu0: _opp_add: OPP not supported by regulators (800000000)

    The patch fixes declaration of VDD1/2 regulators by
    adding proper voltage lists.

    Fixes: 498209445124 ("regulator: core: simplify return value on suported_voltage")
    Cc: stable@vger.kernel.org
    Signed-off-by: Andreas Kemnade
    Tested-by: Adam Ford #logicpd-torpedo-37xx-devkit
    Link: https://lore.kernel.org/r/20190814214319.24087-1-andreas@kemnade.info
    Signed-off-by: Mark Brown

    Andreas Kemnade
     

31 May, 2019

1 commit

  • Based on 1 normalized pattern(s):

    this program is free software you can redistribute it and or modify
    it under the terms of the gnu general public license as published by
    the free software foundation either version 2 of the license or at
    your option any later version

    extracted by the scancode license scanner the SPDX license identifier

    GPL-2.0-or-later

    has been chosen to replace the boilerplate/reference in 3029 file(s).

    Signed-off-by: Thomas Gleixner
    Reviewed-by: Allison Randal
    Cc: linux-spdx@vger.kernel.org
    Link: https://lkml.kernel.org/r/20190527070032.746973796@linutronix.de
    Signed-off-by: Greg Kroah-Hartman

    Thomas Gleixner
     

03 Apr, 2019

1 commit


23 Jan, 2019

1 commit


20 Apr, 2018

1 commit

  • In of_get_regulation_constraints() we were taking the result of
    of_map_mode() (an unsigned int) and assigning it to an int. We were
    then checking whether this value was -EINVAL. Some implementers of
    of_map_mode() were returning -EINVAL (even though the return type of
    their function needed to be unsigned int) because they needed to
    signal an error back to of_get_regulation_constraints().

    In general in the regulator framework the mode is always referred to
    as an unsigned int. While we could fix this to be a signed int (the
    highest value we store in there right now is 0x8), it's actually
    pretty clean to just define the regulator mode 0x0 (the lack of any
    bits set) as an invalid mode. Let's do that.

    Fixes: 5e5e3a42c653 ("regulator: of: Add support for parsing initial and suspend modes")
    Suggested-by: Javier Martinez Canillas
    Signed-off-by: Douglas Anderson
    Reviewed-by: Javier Martinez Canillas
    Signed-off-by: Mark Brown

    Douglas Anderson
     

04 Sep, 2017

1 commit

  • include/linux/i2c is not for client devices. Move the header file to a
    more appropriate location.

    Signed-off-by: Wolfram Sang
    Acked-by: Greg Kroah-Hartman
    Acked-by: Alexandre Belloni
    Acked-by: Mark Brown
    Acked-by: Sebastian Reichel
    Acked-by: Jonathan Cameron
    Acked-by: Dmitry Torokhov
    Acked-by: Kishon Vijay Abraham I
    Acked-by: Bartlomiej Zolnierkiewicz
    Acked-by: Thierry Reding
    Acked-by: Tony Lindgren
    Acked-by: Daniel Thompson
    Acked-by: Linus Walleij
    Acked-by: Guenter Roeck
    Signed-off-by: Lee Jones

    Wolfram Sang
     

23 Nov, 2016

1 commit


17 Nov, 2016

4 commits


09 Jun, 2016

1 commit

  • The TWL6030_FIXED_LDO() macro passes the TWL_FIXED_LDO()
    macro an 0x0 instead of a NULL. Changing this to a NULL
    fixes the following warnings:

    drivers/regulator/twl-regulator.c:1068:1: warning: Using plain integer as NULL pointer
    drivers/regulator/twl-regulator.c:1069:1: warning: Using plain integer as NULL pointer
    drivers/regulator/twl-regulator.c:1070:1: warning: Using plain integer as NULL pointer
    drivers/regulator/twl-regulator.c:1071:1: warning: Using plain integer as NULL pointer
    drivers/regulator/twl-regulator.c:1072:1: warning: Using plain integer as NULL pointer
    drivers/regulator/twl-regulator.c:1073:1: warning: Using plain integer as NULL pointer

    Signed-off-by: Ben Dooks
    Signed-off-by: Mark Brown

    Ben Dooks
     

07 Apr, 2016

1 commit

  • Commit ("regulator: twl: Make
    sure we have access to powerbus before trying to write to it")
    has implemented the needed logic to correctly access powerbus through i2c,
    however it brought a typo when powerbus configuration is restored, which
    results in writing to a wrong register. Fix that by providing the correct
    register value.

    Signed-off-by: Ivaylo Dimitrov
    Signed-off-by: Mark Brown

    Ivaylo Dimitrov
     

06 Apr, 2016

1 commit


28 Mar, 2016

2 commits

  • When machine constraints are applied, regulator framework first sets
    initial mode (if any) and then enables the regulator if needed. The current
    code in twl4030reg_set_mode always checks if the regulator is enabled
    before applying the mode. That results in -EACCES error returned for
    "always-on" regulators which have "initial-mode" set in the board DTS. Fix
    that by removing the unneeded check.

    Signed-off-by: Ivaylo Dimitrov
    Signed-off-by: Mark Brown

    Ivaylo Dimitrov
     
  • According to the TRM, we need to enable i2c access to powerbus before
    writing to it. Also, a new write to powerbus should not be attempted if
    there is a pending transfer. The current code does not implement that
    functionality and while there are no known problems caused by that, it is
    better to follow what TRM says.

    Signed-off-by: Ivaylo Dimitrov
    Signed-off-by: Mark Brown

    Ivaylo Dimitrov
     

15 Dec, 2014

1 commit

  • Pull driver core update from Greg KH:
    "Here's the set of driver core patches for 3.19-rc1.

    They are dominated by the removal of the .owner field in platform
    drivers. They touch a lot of files, but they are "simple" changes,
    just removing a line in a structure.

    Other than that, a few minor driver core and debugfs changes. There
    are some ath9k patches coming in through this tree that have been
    acked by the wireless maintainers as they relied on the debugfs
    changes.

    Everything has been in linux-next for a while"

    * tag 'driver-core-3.19-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/driver-core: (324 commits)
    Revert "ath: ath9k: use debugfs_create_devm_seqfile() helper for seq_file entries"
    fs: debugfs: add forward declaration for struct device type
    firmware class: Deletion of an unnecessary check before the function call "vunmap"
    firmware loader: fix hung task warning dump
    devcoredump: provide a one-way disable function
    device: Add dev__once variants
    ath: ath9k: use debugfs_create_devm_seqfile() helper for seq_file entries
    ath: use seq_file api for ath9k debugfs files
    debugfs: add helper function to create device related seq_file
    drivers/base: cacheinfo: remove noisy error boot message
    Revert "core: platform: add warning if driver has no owner"
    drivers: base: support cpu cache information interface to userspace via sysfs
    drivers: base: add cpu_device_create to support per-cpu devices
    topology: replace custom attribute macros with standard DEVICE_ATTR*
    cpumask: factor out show_cpumap into separate helper function
    driver core: Fix unbalanced device reference in drivers_probe
    driver core: fix race with userland in device_add()
    sysfs/kernfs: make read requests on pre-alloc files use the buffer.
    sysfs/kernfs: allow attributes to request write buffer be pre-allocated.
    fs: sysfs: return EGBIG on write if offset is larger than file size
    ...

    Linus Torvalds
     

27 Nov, 2014

1 commit

  • The of_get_regulator_init_data() function is used to extract the regulator
    init_data but information on how to extract certain data is defined in the
    static regulator descriptor (e.g: how to map the hardware operating modes).

    Add a const struct regulator_desc * parameter to the function signature so
    the parsing logic could use the information in the struct regulator_desc.

    of_get_regulator_init_data() relies on of_get_regulation_constraints() to
    actually extract the init_data so it has to pass the struct regulator_desc
    but that is modified on a later patch.

    Signed-off-by: Javier Martinez Canillas
    Signed-off-by: Mark Brown

    Javier Martinez Canillas
     

20 Oct, 2014

1 commit


27 Jun, 2014

1 commit


09 Jan, 2014

1 commit

  • Fix the following checkpatch warnings.

    WARNING: please, no space before tabs
    WARNING: space prohibited between function name and open parenthesis '('

    Signed-off-by: Jingoo Han
    Acked-by: Nishanth Menon
    Signed-off-by: Mark Brown

    Jingoo Han
     

01 Oct, 2013

1 commit


30 Jul, 2013

1 commit


20 Jun, 2013

1 commit

  • The TWL6025 was never released beyond sample form and was replaced by
    the PhoenixLite range of chips - TWL6032. Change the references to
    reference the TWL6032 class and name the registers to twl6032 in line with
    an actual released chip name to avoid confusion.

    Currently there are no users of TWL6025 in the code.

    Signed-off-by: Graeme Gregory
    Signed-off-by: Oleksandr Kozaruk
    Acked-by: Lee Jones
    Reviwed-by: Mark Brown
    Signed-off-by: Samuel Ortiz

    Graeme Gregory
     

28 Apr, 2013

1 commit


01 Mar, 2013

4 commits


04 Jan, 2013

1 commit

  • CONFIG_HOTPLUG is going away as an option. As a result, the __dev*
    markings need to be removed.

    This change removes the use of __devinit, __devexit_p, __devinitdata,
    __devinitconst, and __devexit from these drivers.

    Based on patches originally written by Bill Pemberton, but redone by me
    in order to handle some of the coding style issues better, by hand.

    Cc: Bill Pemberton
    Cc: Liam Girdwood
    Cc: Mark Brown
    Signed-off-by: Greg Kroah-Hartman

    Greg Kroah-Hartman
     

20 Nov, 2012

3 commits


09 Sep, 2012

1 commit


29 Aug, 2012

5 commits

  • Fixes this build error:

    drivers/regulator/twl-regulator.c: In function 'twlreg_probe':
    drivers/regulator/twl-regulator.c:1229:3: error: implicit declaration of function 'kfree' [-Werror=implicit-function-declaration]

    Also added string.h for kmemdup().

    Signed-off-by: Stephen Rothwell
    Acked-by: Arnd Bergmann
    Signed-off-by: Mark Brown

    Stephen Rothwell
     
  • I currently carry the series to make of_device_id->data const in the
    arm-soc tree, which fixes a number of issues, but leaves one new
    compiler warning about the twl-regulator driver:

    drivers/regulator/twl-regulator.c: In function 'twlreg_probe':
    drivers/regulator/twl-regulator.c:1130:8: warning: assignment discards 'const'
    qualifier from pointer target type [enabled by default]
    drivers/regulator/twl-regulator.c:1139:9: warning: assignment discards 'const'
    qualifier from pointer target type [enabled by default]

    The warning indicates that the driver takes a static table with
    initialization data for each regulator, modifies the data in place
    and passes a pointer to that structure to the regulator_register
    function. This is probably ok because a system contains only one
    instance of each regulator, but it's still bad style because any
    driver should be written to support multiple instances of the same
    hardware.

    This patch changes the code to dynamically allocate the memory
    we pass to the regulator core so the table can be constant.

    Signed-off-by: Arnd Bergmann
    Signed-off-by: Mark Brown

    Arnd Bergmann
     
  • This is not required after commit f7df20ec
    "regulator: core: Use list_voltage() to read single voltage regulators"

    Signed-off-by: Axel Lin
    Signed-off-by: Mark Brown

    Axel Lin
     
  • Signed-off-by: Axel Lin
    Signed-off-by: Mark Brown

    Axel Lin
     
  • The voltage selection logic is supposed to find the samllest voltage falls
    within specified range. When using equation to calculate vsel, we need to
    ensure the requested min_uV meet the range of using the equation.
    Otherwise we may select a voltage that is out of specified range.

    For example, in the case vsel = 62 means select voltage of 2100000uV.
    What we want is to ensure the requested min_uV = 2100000. And this also means in the case min_uV > 2100000, vsel = 62
    does not meet the request.

    Also calling twl6030smps_list_voltage() for all cases to ensure the selected
    voltage still in bounds.

    Signed-off-by: Axel Lin
    Signed-off-by: Mark Brown

    Axel Lin