Skip to content
Permalink
Manaf-Meethala…
Switch branches/tags

Commits on Dec 13, 2021

  1. power_supply: Register cooling device outside of probe

    Registering the cooling device from the probe can result in the
    execution of get_property() function before it gets initialized.
    
    To avoid this, register the cooling device from a workqueue
    instead of registering in the probe.
    
    Signed-off-by: Manaf Meethalavalappu Pallikunhi <quic_manafm@quicinc.com>
    Manaf Meethalavalappu Pallikunhi authored and intel-lab-lkp committed Dec 13, 2021

Commits on Dec 2, 2021

  1. power: bq25890: add POWER_SUPPLY_PROP_TEMP

    Add the POWER_SUPPLY_PROP_TEMP and a NTC 10K percent VREGN to degrees LUT.
    
    Make sure that a conversion is forced when the power supply is offline so
    the temperature is valid.
    
    Signed-off-by: Angus Ainslie <angus@akkea.ca>
    Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.com>
    nytowl authored and sre committed Dec 2, 2021

Commits on Nov 30, 2021

  1. power: supply: qcom_smbb: support pm8226

    PM8226 (used in MSM8226) has v1 smbb hardware and works fine with the
    current driver.
    
    Signed-off-by: Luca Weiss <luca@z3ntu.xyz>
    Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.com>
    z3ntu authored and sre committed Nov 30, 2021
  2. dt-bindings: power: supply: pm8941-charger: add pm8226

    The charger in PM8226 (used in MSM8226) is similar to the charger in
    PM8941.
    
    Signed-off-by: Luca Weiss <luca@z3ntu.xyz>
    Acked-by: Rob Herring <robh@kernel.org>
    Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.com>
    z3ntu authored and sre committed Nov 30, 2021

Commits on Nov 22, 2021

  1. power: supply: ab8500: Standardize capacity lookup

    The AB8500 charger only has one capacity table with
    unspecified temperature, so we assume this capacity is given
    for 20 degrees Celsius.
    
    Convert this table to use the OCV (open circuit voltage)
    tables in struct power_supply_battery_ocv_table.
    
    In the process, convert the fuel gauge driver to use
    microvolts and microamperes so we can use the same internals
    as the power supply subsystem without having to multiply
    and divide with 1000 in a few places.
    
    Also convert high_curr_threshold and lowbat_threshold to
    use microamperes and microvolts as these are closely
    related to these changes.
    
    Drop the unused overbat_threshold member in the custom
    struct ab8500_fg_parameters.
    
    Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
    Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.com>
    linusw authored and sre committed Nov 22, 2021
  2. power: supply: ab8500: Standardize temp res lookup

    The lookup from battery temperature to internal resistance was
    using its own format. Rewrite this to use the table inside
    struct power_supply_battery_info:s resist_table.
    
    The supplied resistance table has to be rewritten to express
    the resistance in percent of the factory resistance as a
    side effect.
    
    We can then rely on the library function
    power_supply_temp2resist_simple() to interpolate the internal
    resistance percent from the temperature.
    
    Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
    Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.com>
    linusw authored and sre committed Nov 22, 2021
  3. power: supply: ab8500: Standardize CV voltage

    The voltage used in the constant voltage phase of the charging
    exist in struct power_supply_battery_info as
    constant_charge_voltage_max_uv.
    
    Switch the custom property normal_vol_lvl to this and
    consequentially change everything that relates to this value
    over to using microvolts rather than millivolts so
    we align internal representation of current with the
    power core. Prefix every variable we change with *_uv
    to indicate the unit everywhere but also to make sure
    we do not miss any outlier.
    
    Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
    Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.com>
    linusw authored and sre committed Nov 22, 2021
  4. power: supply: ab8500: Standardize CC current

    The current used in the constant current phase of the charging
    exist in struct power_supply_battery_info as
    constant_charge_current_max_ua.
    
    Switch the custom property max_out_curr to this and
    consequentally change everything that relates to this value
    over to using microamperes rather than milliamperes so
    we align internal representation of current with the
    power core. Prefix every variable we change with *_ua
    to indicate the unit everywhere but also to make sure
    we do not miss any outlier.
    
    Drop some duplicate unused defines in a header.
    
    Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
    Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.com>
    linusw authored and sre committed Nov 22, 2021
  5. power: supply: ab8500: Make recharge capacity a constant

    The recharge capacity is the hysteresis level for a charger to
    restart when a battery does not support maintenance charging.
    
    All products using the AB8500 have batteries supporting
    maintenace charging and all code has always set this to 95%.
    
    Turn it into a constant.
    
    Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
    Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.com>
    linusw authored and sre committed Nov 22, 2021
  6. power: supply: ab8500: Standardize termination current

    The AB8500 custom termination current can be replaced by the
    corresponding struct power_supply_battery_info field.
    
    Remove the struct member and amend the code to use the
    standard property.
    
    Add *_ua suffix for clarity and to make sure we have
    changed all code sites using this member.
    
    Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
    Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.com>
    linusw authored and sre committed Nov 22, 2021
  7. power: supply: ab8500: Standardize internal resistance

    The nominal internal resistance isn't used by the AB8500
    charging code, instead this resistance is measured continuously,
    but we anyways migrate this to the standard property in
    struct power_supply_battery_info.
    
    Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
    Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.com>
    linusw authored and sre committed Nov 22, 2021
  8. power: supply: ab8500_fg: Init battery data in bind()

    We were assigning some battery data state in probe() but
    this is insecure as it depends on the proper probe order
    between the components: the charger must probe first so
    that the battery data is populated. Move the init to
    the bind() call which is certain to happen after the
    probe of the master and all components has happened.
    
    Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
    Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.com>
    linusw authored and sre committed Nov 22, 2021
  9. power: supply: ab8500: Standardize voltages

    The nominal voltage in this charge driver corresponds to
    both the voltage_min_design_uv and voltage_max_design_uv
    of struct power_supply_battery_info so assign both if this
    is undefined.
    
    The overcharge max voltage (when the charger should cut off)
    is migrated at the same time so we move both voltages to
    struct power_supply_battery_info.
    
    Adjust the code to deal directly with the microvolt values
    instead of converting them to millivolts.
    
    Add *_uv suffixes for clarity and to make sure we have
    changed all code sites using this member.
    
    Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
    Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.com>
    linusw authored and sre committed Nov 22, 2021
  10. power: supply: ab8500: Standardize technology

    The AB8500 custom battery type can be replaced by the
    corresponding struct power_supply_battery_info field.
    
    Remove the struct member and amend the code to use the
    standard property.
    
    Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
    Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.com>
    linusw authored and sre committed Nov 22, 2021
  11. power: supply: ab8500: Standardize design capacity

    Now that we know that we have only one battery type to
    deal with we can proceed to transfer properties to
    struct power_supply_battery_info.
    
    The designed capacity for the battery was in a custom field
    of the custom battery type in mAh, transfer this to the
    standard charge_full_design_uah property in
    struct power_supply_battery_info and augment the code
    accordingly.
    
    Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
    Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.com>
    linusw authored and sre committed Nov 22, 2021
  12. power: supply: ab8500: Use only one battery type

    The code was going through hoops and loops to detect what
    battery is connected and check the resistance for this battery
    etc.
    
    Skip this trouble: we will support one battery (currently
    "unknown") then we will find the connected battery in the
    device tree using a compatible string. The battery resistance
    may be used to double-check that the right battery is
    connected.
    
    Convert the array of battery types into one battery type so
    we can next move over the properties of this one type into
    the standard struct power_supply_battery_info.
    
    Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
    Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.com>
    linusw authored and sre committed Nov 22, 2021
  13. power: supply: ab8500: Drop unused battery types

    The code tries to detect a lot of battery variants on the reference
    designs, but we are not using the reference designs in practice, we
    are using real products such as Samsung Phones.
    
    The reference design with no battery plugged in will be detected as
    a LIPO battery with a thermistor on the batctrl pin so we will
    assume this and later on we can support other types through the
    device tree if we want, just like the products do.
    
    Drop the tables for external thermistor, only keep the internal
    thermistor tables that we will use as default.
    
    We can delete the assignment of the temperature to resistance table
    since the default will be the only and correct option.
    
    Also get rid of some unused variables and unused exports.
    
    Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
    Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.com>
    linusw authored and sre committed Nov 22, 2021
  14. power: supply: ab8500: Standardize operating temperature

    Instead of storing the temperature limits in our custom
    struct struct ab8500_bm_data, make struct power_supply_battery_info
    a member of this and store the min and max temperatures inside
    that struct as the temp_min/temp_max and
    temp_alert_min/temp_alert_max respectively.
    
    The values can be assigned from the device tree, but if
    not present will be set to the same defaults as are currently
    in the code.
    
    This way we start to move over to using
    struct power_supply_battery_info and make it possible to move
    the data over to the device tree and we will move piece by
    piece toward using the standard info struct.
    
    Temperature hysteresis is currently not supported by the
    standard struct but we move the assignment here as well so
    that we have all parameterization in one spot.
    
    Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
    Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.com>
    linusw authored and sre committed Nov 22, 2021
  15. power: supply: ab8500: Sink current tables into charger code

    The two tables for input and output current translation from
    register values does not need to be passed around from the
    battery manager data. Just push it down into the charger code
    where it is used, like other tables in that code.
    
    Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
    Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.com>
    linusw authored and sre committed Nov 22, 2021
  16. power: supply: ab8500: Use core battery parser

    This deploys the core battery DT parser to read the basic properties
    of the battery. We only use very little of it as we start out, but
    we will improve as we go along.
    
    Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
    Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.com>
    linusw authored and sre committed Nov 22, 2021

Commits on Nov 17, 2021

  1. power: supply: core: Add kerneldoc to battery struct

    This complements the struct power_supply_battery_info with
    extensive kerneldoc explaining the different semantics of the
    fields, including an overview of the CC/CV charging concepts
    implicit in some of the struct members.
    
    This is done to first establish semantics before I can
    add more charging methods by breaking out the CC/CV parameters
    to its own struct.
    
    Tested-by: Randy Dunlap <rdunlap@infradead.org>
    Acked-by: Randy Dunlap <rdunlap@infradead.org>
    Reviewed-by: Matti Vaittinen <matti.vaittinen@fi.rohmeurope.com>
    Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
    Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.com>
    linusw authored and sre committed Nov 17, 2021
  2. power: supply: core: Use library interpolation

    The power supply core appears to contain two open coded
    linear interpolations. Use the kernel fixpoint arithmetic
    interpolation library function instead.
    
    Cc: Chunyan Zhang <chunyan.zhang@unisoc.com>
    Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
    Reviewed-by: Baolin Wang <baolin.wang@linux.alibaba.com>
    Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.com>
    linusw authored and sre committed Nov 17, 2021

Commits on Nov 16, 2021

  1. power: supply: max77976: add Maxim MAX77976 charger driver

    Add support for the MAX77976 3.5/5.5A 1-Cell Li+ Battery Charger.
    
    This is a simple implementation enough to be used as a simple battery
    charger without OTG and boost.
    
    Signed-off-by: Luca Ceresoli <luca@lucaceresoli.net>
    Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.com>
    lucaceresoli authored and sre committed Nov 16, 2021
  2. power: supply: core: add POWER_SUPPLY_HEALTH_NO_BATTERY

    Some chargers can keep the system powered from the mains even when no
    battery is present. It this case none of the currently defined health
    statuses applies. Add a new status to report that no battery is present.
    
    Suggested-by: Sebastian Reichel <sebastian.reichel@collabora.com>
    Signed-off-by: Luca Ceresoli <luca@lucaceresoli.net>
    Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.com>
    lucaceresoli authored and sre committed Nov 16, 2021
  3. dt-bindings: power: supply: add Maxim MAX77976 battery charger

    Add bindings for the Maxim MAX77976 I2C-controlled battery charger.
    
    Signed-off-by: Luca Ceresoli <luca@lucaceresoli.net>
    Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.com>
    lucaceresoli authored and sre committed Nov 16, 2021
  4. dt-bindings: power: reset: gpio-poweroff: Convert txt bindings to yaml

    Convert power-off action connected to the GPIO documentation to the YAML syntax.
    
    Signed-off-by: David Heidelberg <david@ixit.cz>
    Reviewed-by: Rob Herring <robh@kernel.org>
    Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.com>
    okias authored and sre committed Nov 16, 2021

Commits on Nov 14, 2021

  1. Linux 5.16-rc1

    torvalds committed Nov 14, 2021
  2. kconfig: Add support for -Wimplicit-fallthrough

    Add Kconfig support for -Wimplicit-fallthrough for both GCC and Clang.
    
    The compiler option is under configuration CC_IMPLICIT_FALLTHROUGH,
    which is enabled by default.
    
    Special thanks to Nathan Chancellor who fixed the Clang bug[1][2]. This
    bugfix only appears in Clang 14.0.0, so older versions still contain
    the bug and -Wimplicit-fallthrough won't be enabled for them, for now.
    
    This concludes a long journey and now we are finally getting rid
    of the unintentional fallthrough bug-class in the kernel, entirely. :)
    
    Link: llvm/llvm-project@9ed4a94 [1]
    Link: https://bugs.llvm.org/show_bug.cgi?id=51094 [2]
    Link: KSPP#115
    Link: ClangBuiltLinux#236
    Co-developed-by: Kees Cook <keescook@chromium.org>
    Signed-off-by: Kees Cook <keescook@chromium.org>
    Co-developed-by: Linus Torvalds <torvalds@linux-foundation.org>
    Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
    Signed-off-by: Gustavo A. R. Silva <gustavoars@kernel.org>
    Reviewed-by: Nathan Chancellor <nathan@kernel.org>
    Tested-by: Nathan Chancellor <nathan@kernel.org>
    Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
    GustavoARSilva authored and torvalds committed Nov 14, 2021
  3. Merge tag 'xfs-5.16-merge-5' of git://git.kernel.org/pub/scm/fs/xfs/x…

    …fs-linux
    
    Pull xfs cleanups from Darrick Wong:
     "The most 'exciting' aspect of this branch is that the xfsprogs
      maintainer and I have worked through the last of the code
      discrepancies between kernel and userspace libxfs such that there are
      no code differences between the two except for #includes.
    
      IOWs, diff suffices to demonstrate that the userspace tools behave the
      same as the kernel, and kernel-only bits are clearly marked in the
      /kernel/ source code instead of just the userspace source.
    
      Summary:
    
       - Clean up open-coded swap() calls.
    
       - A little bit of #ifdef golf to complete the reunification of the
         kernel and userspace libxfs source code"
    
    * tag 'xfs-5.16-merge-5' of git://git.kernel.org/pub/scm/fs/xfs/xfs-linux:
      xfs: sync xfs_btree_split macros with userspace libxfs
      xfs: #ifdef out perag code for userspace
      xfs: use swap() to make dabtree code cleaner
    torvalds committed Nov 14, 2021
  4. Merge tag 'for-5.16/parisc-3' of git://git.kernel.org/pub/scm/linux/k…

    …ernel/git/deller/parisc-linux
    
    Pull more parisc fixes from Helge Deller:
     "Fix a build error in stracktrace.c, fix resolving of addresses to
      function names in backtraces, fix single-stepping in assembly code and
      flush userspace pte's when using set_pte_at()"
    
    * tag 'for-5.16/parisc-3' of git://git.kernel.org/pub/scm/linux/kernel/git/deller/parisc-linux:
      parisc/entry: fix trace test in syscall exit path
      parisc: Flush kernel data mapping in set_pte_at() when installing pte for user page
      parisc: Fix implicit declaration of function '__kernel_text_address'
      parisc: Fix backtrace to always include init funtion names
    torvalds committed Nov 14, 2021
  5. Merge tag 'sh-for-5.16' of git://git.libc.org/linux-sh

    Pull arch/sh updates from Rich Felker.
    
    * tag 'sh-for-5.16' of git://git.libc.org/linux-sh:
      sh: pgtable-3level: Fix cast to pointer from integer of different size
      sh: fix READ/WRITE redefinition warnings
      sh: define __BIG_ENDIAN for math-emu
      sh: math-emu: drop unused functions
      sh: fix kconfig unmet dependency warning for FRAME_POINTER
      sh: Cleanup about SPARSE_IRQ
      sh: kdump: add some attribute to function
      maple: fix wrong return value of maple_bus_init().
      sh: boot: avoid unneeded rebuilds under arch/sh/boot/compressed/
      sh: boot: add intermediate vmlinux.bin* to targets instead of extra-y
      sh: boards: Fix the cacography in irq.c
      sh: check return code of request_irq
      sh: fix trivial misannotations
    torvalds committed Nov 14, 2021
  6. Merge tag 'for-linus' of git://git.armlinux.org.uk/~rmk/linux-arm

    Pull ARM fixes from Russell King:
    
     - Fix early_iounmap
    
     - Drop cc-option fallbacks for architecture selection
    
    * tag 'for-linus' of git://git.armlinux.org.uk/~rmk/linux-arm:
      ARM: 9156/1: drop cc-option fallbacks for architecture selection
      ARM: 9155/1: fix early early_iounmap()
    torvalds committed Nov 14, 2021
  7. Merge tag 'devicetree-fixes-for-5.16-1' of git://git.kernel.org/pub/s…

    …cm/linux/kernel/git/robh/linux
    
    Pull devicetree fixes from Rob Herring:
    
     - Two fixes due to DT node name changes on Arm, Ltd. boards
    
     - Treewide rename of Ingenic CGU headers
    
     - Update ST email addresses
    
     - Remove Netlogic DT bindings
    
     - Dropping few more cases of redundant 'maxItems' in schemas
    
     - Convert toshiba,tc358767 bridge binding to schema
    
    * tag 'devicetree-fixes-for-5.16-1' of git://git.kernel.org/pub/scm/linux/kernel/git/robh/linux:
      dt-bindings: watchdog: sunxi: fix error in schema
      bindings: media: venus: Drop redundant maxItems for power-domain-names
      dt-bindings: Remove Netlogic bindings
      clk: versatile: clk-icst: Ensure clock names are unique
      of: Support using 'mask' in making device bus id
      dt-bindings: treewide: Update @st.com email address to @FOSS.st.com
      dt-bindings: media: Update maintainers for st,stm32-hwspinlock.yaml
      dt-bindings: media: Update maintainers for st,stm32-cec.yaml
      dt-bindings: mfd: timers: Update maintainers for st,stm32-timers
      dt-bindings: timer: Update maintainers for st,stm32-timer
      dt-bindings: i2c: imx: hardware do not restrict clock-frequency to only 100 and 400 kHz
      dt-bindings: display: bridge: Convert toshiba,tc358767.txt to yaml
      dt-bindings: Rename Ingenic CGU headers to ingenic,*.h
    torvalds committed Nov 14, 2021
  8. Merge tag 'timers-urgent-2021-11-14' of git://git.kernel.org/pub/scm/…

    …linux/kernel/git/tip/tip
    
    Pull timer fix from Thomas Gleixner:
     "A single fix for POSIX CPU timers to address a problem where POSIX CPU
      timer delivery stops working for a new child task because
      copy_process() copies state information which is only valid for the
      parent task"
    
    * tag 'timers-urgent-2021-11-14' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip:
      posix-cpu-timers: Clear task::posix_cputimers_work in copy_process()
    torvalds committed Nov 14, 2021
  9. Merge tag 'irq-urgent-2021-11-14' of git://git.kernel.org/pub/scm/lin…

    …ux/kernel/git/tip/tip
    
    Pull irq fixes from Thomas Gleixner:
     "A set of fixes for the interrupt subsystem
    
      Core code:
    
       - A regression fix for the Open Firmware interrupt mapping code where
         a interrupt controller property in a node caused a map property in
         the same node to be ignored.
    
      Interrupt chip drivers:
    
       - Workaround a limitation in SiFive PLIC interrupt chip which
         silently ignores an EOI when the interrupt line is masked.
    
       - Provide the missing mask/unmask implementation for the CSKY MP
         interrupt controller.
    
      PCI/MSI:
    
       - Prevent a use after free when PCI/MSI interrupts are released by
         destroying the sysfs entries before freeing the memory which is
         accessed in the sysfs show() function.
    
       - Implement a mask quirk for the Nvidia ION AHCI chip which does not
         advertise masking capability despite implementing it. Even worse
         the chip comes out of reset with all MSI entries masked, which due
         to the missing masking capability never get unmasked.
    
       - Move the check which prevents accessing the MSI[X] masking for XEN
         back into the low level accessors. The recent consolidation missed
         that these accessors can be invoked from places which do not have
         that check which broke XEN. Move them back to he original place
         instead of sprinkling tons of these checks all over the code"
    
    * tag 'irq-urgent-2021-11-14' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip:
      of/irq: Don't ignore interrupt-controller when interrupt-map failed
      irqchip/sifive-plic: Fixup EOI failed when masked
      irqchip/csky-mpintc: Fixup mask/unmask implementation
      PCI/MSI: Destroy sysfs before freeing entries
      PCI: Add MSI masking quirk for Nvidia ION AHCI
      PCI/MSI: Deal with devices lying about their MSI mask capability
      PCI/MSI: Move non-mask check back into low level accessors
    torvalds committed Nov 14, 2021
Older