Commit graph

299 commits

Author SHA1 Message Date
Linus Torvalds
c1c76700a0 SPDX changes for 6.0-rc1
Here is the set of SPDX comment updates for 6.0-rc1.
 
 Nothing huge here, just a number of updated SPDX license tags and
 cleanups based on the review of a number of common patterns in GPLv2
 boilerplate text.  Also included in here are a few other minor updates,
 2 USB files, and one Documentation file update to get the SPDX lines
 correct.
 
 All of these have been in the linux-next tree for a very long time.
 
 Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
 -----BEGIN PGP SIGNATURE-----
 
 iG0EABECAC0WIQT0tgzFv3jCIUoxPcsxR9QN2y37KQUCYupz3g8cZ3JlZ0Brcm9h
 aC5jb20ACgkQMUfUDdst+ynPUgCgslaf2ssCgW5IeuXbhla+ZBRAzisAnjVgOvLN
 4AKdqbiBNlFbCroQwmeQ
 =v1sg
 -----END PGP SIGNATURE-----

Merge tag 'spdx-6.0-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/spdx

Pull SPDX updates from Greg KH:
 "Here is the set of SPDX comment updates for 6.0-rc1.

  Nothing huge here, just a number of updated SPDX license tags and
  cleanups based on the review of a number of common patterns in GPLv2
  boilerplate text.

  Also included in here are a few other minor updates, two USB files,
  and one Documentation file update to get the SPDX lines correct.

  All of these have been in the linux-next tree for a very long time"

* tag 'spdx-6.0-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/spdx: (28 commits)
  Documentation: samsung-s3c24xx: Add blank line after SPDX directive
  x86/crypto: Remove stray comment terminator
  treewide: Replace GPLv2 boilerplate/reference with SPDX - gpl-2.0_406.RULE
  treewide: Replace GPLv2 boilerplate/reference with SPDX - gpl-2.0_398.RULE
  treewide: Replace GPLv2 boilerplate/reference with SPDX - gpl-2.0_391.RULE
  treewide: Replace GPLv2 boilerplate/reference with SPDX - gpl-2.0_390.RULE
  treewide: Replace GPLv2 boilerplate/reference with SPDX - gpl-2.0_385.RULE
  treewide: Replace GPLv2 boilerplate/reference with SPDX - gpl-2.0_320.RULE
  treewide: Replace GPLv2 boilerplate/reference with SPDX - gpl-2.0_319.RULE
  treewide: Replace GPLv2 boilerplate/reference with SPDX - gpl-2.0_318.RULE
  treewide: Replace GPLv2 boilerplate/reference with SPDX - gpl-2.0_298.RULE
  treewide: Replace GPLv2 boilerplate/reference with SPDX - gpl-2.0_292.RULE
  treewide: Replace GPLv2 boilerplate/reference with SPDX - gpl-2.0_179.RULE
  treewide: Replace GPLv2 boilerplate/reference with SPDX - gpl-2.0_168.RULE (part 2)
  treewide: Replace GPLv2 boilerplate/reference with SPDX - gpl-2.0_168.RULE (part 1)
  treewide: Replace GPLv2 boilerplate/reference with SPDX - gpl-2.0_160.RULE
  treewide: Replace GPLv2 boilerplate/reference with SPDX - gpl-2.0_152.RULE
  treewide: Replace GPLv2 boilerplate/reference with SPDX - gpl-2.0_149.RULE
  treewide: Replace GPLv2 boilerplate/reference with SPDX - gpl-2.0_147.RULE
  treewide: Replace GPLv2 boilerplate/reference with SPDX - gpl-2.0_133.RULE
  ...
2022-08-04 12:12:54 -07:00
Thomas Gleixner
2aec85b26f treewide: Replace GPLv2 boilerplate/reference with SPDX - gpl-2.0_30.RULE (part 2)
Based on the normalized pattern:

    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 version 2  this program is distributed as is
    without any warranty of any kind whether express or implied without
    even the implied warranty of merchantability or fitness for a
    particular purpose see the gnu general public license for more details

extracted by the scancode license scanner the SPDX license identifier

    GPL-2.0-only

has been chosen to replace the boilerplate/reference.

Reviewed-by: Allison Randal <allison@lohutok.net>
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2022-06-10 14:51:35 +02:00
Miaoqian Lin
80192eff64 power/reset: arm-versatile: Fix refcount leak in versatile_reboot_probe
of_find_matching_node_and_match() returns a node pointer with refcount
incremented, we should use of_node_put() on it when not need anymore.
Add missing of_node_put() to avoid refcount leak.

Fixes: 0e545f57b7 ("power: reset: driver for the Versatile syscon reboot")
Signed-off-by: Miaoqian Lin <linmq006@gmail.com>
Reviewed-by: Linus Walleij <linus.walleij@linaro.org>
Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.com>
2022-06-09 21:08:38 +02:00
Miaoqian Lin
ba18dad0fb power: reset: gemini-poweroff: Fix IRQ check in gemini_poweroff_probe
platform_get_irq() returns negative error number instead 0 on failure.
And the doc of platform_get_irq() provides a usage example:

    int irq = platform_get_irq(pdev, 0);
    if (irq < 0)
        return irq;

Fix the check of return value to catch errors correctly.

Fixes: f7a388d6cd ("power: reset: Add a driver for the Gemini poweroff")
Signed-off-by: Miaoqian Lin <linmq006@gmail.com>
Reviewed-by: Linus Walleij <linus.walleij@linaro.org>
Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.com>
2022-02-01 11:07:59 +01:00
Linus Torvalds
039053c119 power supply and reset changes for the v5.17 series
power-supply core:
  - introduce "No Battery" health status
  - use library interpolation
  - add power_supply_battery_info documentation
  - migrate power_supply_battery_info to be fully heap allocated
    making it more obvious that it needs to be free'd manually
 
 Drivers:
  - max77976-charger: new driver
  - qcom-smbb: add pm8226 charger support
  - bq25890-charger: support battery temperature readings
  - ab8500: continue migrating towards using standard core APIs
 -----BEGIN PGP SIGNATURE-----
 
 iQIzBAABCgAdFiEE72YNB0Y/i3JqeVQT2O7X88g7+poFAmHb+9YACgkQ2O7X88g7
 +pqhGw/+NyqnkSIsU4udxYJY47ooaZ7f2rApFueJSre0Xzwi37SQFFvstBb196YP
 B1mr2H16Slni0kRItu+B1H04mI1y1o7zT4E84s1DoMQjILLtxh+LiT8tefhhWtBs
 5a6IiUKtxo2HZZgreTqyAAjqPYkdRGDkChK87zBZdxIGcaGHXkRlyuTSR2P406r/
 qvA5uCkVg7CMqXf0RemcIlEOvSxaPXZz+PVJjn6qbjSioQHtOekoxoMBziy31Nhm
 Qp0sEYYlW6ZRpaP/IFU21sZb8zaH+isOrg2U/LttgfABdwtEVUz/nygZwSD0ncBi
 zSUrc4Mu/goh7m5oY91HUsis3fzgABMd/xdaDDzJoh91LvguE9lA2vP5r7hEDLVD
 S7v9RNNEfALce5sHGAEXQX0IztD0xZhSRe6jpeAYLVB0OG1Tae3q/6dlEHQsz2rb
 oANYsxrAU0hf2MnsXa6FnR1cnVJNm7z/bQpTFbU7guSX8Vi5n8jzmghoi3piCjyk
 9YXMROuivXuaBz1wXNk2IXzdYwtOTeateo2yYdSQol3UnYgUtIrn+qBVeuElbC3C
 qkb21yTpEIk3aoZOjbKFze7ks6L8c5Nip+66s4WkcAucK3Uxii1QpTR9f1+TdxN0
 vjybsIRHqPnCh6yl1JR/0NNvFPGQWkJt6sveQXas/LAZ77MOMro=
 =9cda
 -----END PGP SIGNATURE-----

Merge tag 'for-v5.17' of git://git.kernel.org/pub/scm/linux/kernel/git/sre/linux-power-supply

Pull power supply and reset updates from Sebastian Reichel:
 "Power-supply core:

   - introduce "No Battery" health status

   - use library interpolation

   - add power_supply_battery_info documentation

   - migrate power_supply_battery_info to be fully heap allocated making
     it more obvious that it needs to be free'd manually

  Drivers:

   - max77976-charger: new driver

   - qcom-smbb: add pm8226 charger support

   - bq25890-charger: support battery temperature readings

   - ab8500: continue migrating towards using standard core APIs"

* tag 'for-v5.17' of git://git.kernel.org/pub/scm/linux/kernel/git/sre/linux-power-supply: (28 commits)
  power: supply_core: Pass pointer to battery info
  power: supply: ab8500: Fix the error handling path of ab8500_charger_probe()
  power: reset: mt6397: Check for null res pointer
  power: bq25890: add POWER_SUPPLY_PROP_TEMP
  power: supply: qcom_smbb: support pm8226
  dt-bindings: power: supply: pm8941-charger: add pm8226
  power: supply: ab8500: Standardize capacity lookup
  power: supply: ab8500: Standardize temp res lookup
  power: supply: ab8500: Standardize CV voltage
  power: supply: ab8500: Standardize CC current
  power: supply: ab8500: Make recharge capacity a constant
  power: supply: ab8500: Standardize termination current
  power: supply: ab8500: Standardize internal resistance
  power: supply: ab8500_fg: Init battery data in bind()
  power: supply: ab8500: Standardize voltages
  power: supply: ab8500: Standardize technology
  power: supply: ab8500: Standardize design capacity
  power: supply: ab8500: Use only one battery type
  power: supply: ab8500: Drop unused battery types
  power: supply: ab8500: Standardize operating temperature
  ...
2022-01-11 11:20:27 -08:00
Jiasheng Jiang
1c1348bf05 power: reset: mt6397: Check for null res pointer
The return value of platform_get_resource() needs to be checked.
To avoid use of error pointer in case that there is no suitable
resource.

Fixes: d28c74c107 ("power: reset: add driver for mt6323 poweroff")
Signed-off-by: Jiasheng Jiang <jiasheng@iscas.ac.cn>
Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.com>
2022-01-03 18:30:21 +01:00
Nathan Chancellor
644106cdb8 power: reset: ltc2952: Fix use of floating point literals
A new commit in LLVM causes an error on the use of 'long double' when
'-mno-x87' is used, which the kernel does through an alias,
'-mno-80387' (see the LLVM commit below for more details around why it
does this).

drivers/power/reset/ltc2952-poweroff.c:162:28: error: expression requires  'long double' type support, but target 'x86_64-unknown-linux-gnu' does not support it
        data->wde_interval = 300L * 1E6L;
                                  ^
drivers/power/reset/ltc2952-poweroff.c:162:21: error: expression requires  'long double' type support, but target 'x86_64-unknown-linux-gnu' does not support it
        data->wde_interval = 300L * 1E6L;
                           ^
drivers/power/reset/ltc2952-poweroff.c:163:41: error: expression requires  'long double' type support, but target 'x86_64-unknown-linux-gnu' does not support it
        data->trigger_delay = ktime_set(2, 500L*1E6L);
                                               ^
3 errors generated.

This happens due to the use of a 'long double' literal. The 'E6' part of
'1E6L' causes the literal to be a 'double' then the 'L' suffix promotes
it to 'long double'.

There is no visible reason for floating point values in this driver, as
the values are only assigned to integer types. Use NSEC_PER_MSEC, which
is the same integer value as '1E6L', to avoid changing functionality but
fix the error.

Fixes: 6647156c00 ("power: reset: add LTC2952 poweroff driver")
Link: https://github.com/ClangBuiltLinux/linux/issues/1497
Link: a8083d42b1
Signed-off-by: Nathan Chancellor <nathan@kernel.org>
Reviewed-by: Nick Desaulniers <ndesaulniers@google.com>
Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.com>
2021-11-16 15:22:39 +01:00
Claudiu Beznea
f558c8072c power: reset: at91-reset: check properly the return value of devm_of_iomap
devm_of_iomap() returns error code or valid pointer. Check its return
value with IS_ERR().

Fixes: bd3127733f ("power: reset: at91-reset: use devm_of_iomap")
Reported-by: Cristian Birsan <cristian.birsan@microchip.com>
Signed-off-by: Claudiu Beznea <claudiu.beznea@microchip.com>
Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.com>
2021-10-02 17:40:34 +02:00
Thomas Gleixner
067930724e power: reset: ltc2952: Use hrtimer_forward_now()
hrtimer_forward_now() provides the same functionality as the open coded
hrtimer_forward() invocation. Prepares for removal of hrtimer_forward()
from the public interfaces.

Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Cc: linux-pm@vger.kernel.org
Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.com>
2021-09-24 23:35:11 +02:00
Emil Renner Berthing
80698507e0 power: reset: Add TPS65086 restart driver
The only way to reset the BeagleV Starlight v0.9 board[1] properly is to
tell the PMIC to reset itself which will then assert the external reset
lines of the SoC, USB hub and ethernet phy.

This adds a driver to register a reset handler to do just that.

[1] https://github.com/beagleboard/beaglev-starlight

Signed-off-by: Emil Renner Berthing <kernel@esmil.dk>
Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.com>
2021-08-16 14:48:51 +02:00
Pawel Dembicki
0c77ec3da8 power: reset: linkstation-poweroff: add new device
This commit introduces support for NETGEAR ReadyNAS Duo v2.
This device use bit 4 of LED[2:0] Polarity Control Register to indicate
AC Power loss.

For more details about AC loss detection in NETGEAR ReadyNAS Duo v2,
please look at the file:
RND_5.3.13_WW.src/u-boot/board/mv_feroceon/mv_hal/usibootup/usibootup.c
from Netgear GPL sources.

Signed-off-by: Pawel Dembicki <paweldembicki@gmail.com>
Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.com>
2021-08-13 19:16:41 +02:00
Pawel Dembicki
e2f471efe1 power: reset: linkstation-poweroff: prepare for new devices
This commit prepare driver for another device support.

New power_off_cfg structure describes two most important things: name of
mdio bus and pointer to register setting function. It allow to add new
device with different mdio bus node and other phy register config.

Signed-off-by: Pawel Dembicki <paweldembicki@gmail.com>
Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.com>
2021-08-13 19:12:26 +02:00
Linus Torvalds
c6e8c51f69 power supply and reset changes for the v5.14 series
battery/charger driver changes:
  * convert charger-manager binding to YAML
  * drop bd70528-charger driver
  * drop pm2301-charger driver
  * introduce rt5033-battery driver
  * misc. improvements and fixes
 -----BEGIN PGP SIGNATURE-----
 
 iQIzBAABCgAdFiEE72YNB0Y/i3JqeVQT2O7X88g7+poFAmDdZH0ACgkQ2O7X88g7
 +pqLpxAAixSqw2UrKCipLUaWWH1vanwPeU78z8XEzpHdNayrTR9PujBMhWH+ps+R
 IgHNjsQuJsnvbedWfmzkgjrZe5amAuN6Va8OkVDSVzEY+RZvLmXfj9POC5d4LmNK
 wpIBM/Okjie097j3ZWz7CJp47rsQnkS9EvRY4FevNjz1zt1VSpQNyDHAjemsn+j9
 1F9BnBMr2gzgTMxLDIloa71VMEaA8cZlAWulIKwxaN5FaSwoacK0NfestjM1R/Bc
 Z50pfqzAXBrofm14WKQRIgSEkf9zM6S1AjHG/y4b/C69XbzmBJxn+FK1F+yukWfN
 Kiq1kGvE9zWqOrDYPd7LxYDetTJ9JgNDxMreLIP7N+syurFYizl7v0JU9TL6BKsh
 EXCklOx/xaCs0Y3a3kBH8dJ72MBppW1loE0XbAqhkMDkzQybTxg9xUI1gnhVTIlb
 5b6KbU5kUo4AghJ279zSNxYNHABKxyu/WCZKNafsLT9pC41muGIPT8ZNgAs2Z3fG
 V60RSiAFpRrHU7efuizbXYchLEv+vWJG7kfdWmHWawMIqE11cUHgMIjFvkv/41t/
 zD3ZnlvvQe/ZZFO16aasvpj99BsZkI5tmNjmVnfPc2cOsLw/HFHIObSe+7x2PpVe
 7peflSz6DHL48NAsoq71WxeoPVPm3YYMMA9kr4tt9ZnVBbLJaCM=
 =EFOr
 -----END PGP SIGNATURE-----

Merge tag 'for-v5.14' of git://git.kernel.org/pub/scm/linux/kernel/git/sre/linux-power-supply

Pull power supply and reset updates from Sebastian Reichel:
 "Battery/charger driver changes:

   - convert charger-manager binding to YAML

   - drop bd70528-charger driver

   - drop pm2301-charger driver

   - introduce rt5033-battery driver

   - misc improvements and fixes"

* tag 'for-v5.14' of git://git.kernel.org/pub/scm/linux/kernel/git/sre/linux-power-supply: (42 commits)
  power: supply: ab8500: Fix an old bug
  power: supply: axp288_fuel_gauge: remove redundant continue statement
  power: supply: axp288_fuel_gauge: Make "T3 MRD" no_battery_list DMI entry more generic
  power: supply: axp288_fuel_gauge: Rename fuel_gauge_blacklist to no_battery_list
  power: supply: bq24190_charger: drop of_match_ptr() from device ID table
  drivers: power: add missing MODULE_DEVICE_TABLE in keystone-reset.c
  power: supply: ab8500: add missing MODULE_DEVICE_TABLE
  power: supply: charger-manager: add missing MODULE_DEVICE_TABLE
  power: reset: regulator-poweroff: add missing MODULE_DEVICE_TABLE
  power: supply: cpcap-charger: get the battery inserted infomation from cpcap-battery
  power: supply: cpcap-battery: invalidate config when incompatible measurements are read
  power: supply: axp20x_battery: allow disabling battery charging
  power: supply: max17040: drop unused platform data support
  power: supply: max17040: simplify POWER_SUPPLY_PROP_ONLINE
  power: supply: max17040: remove non-working POWER_SUPPLY_PROP_STATUS
  power: reset: at91-sama5d2_shdwc: Remove redundant error printing in at91_shdwc_probe()
  power: reset: gpio-poweroff: add missing MODULE_DEVICE_TABLE
  power: supply: rt5033_battery: Fix device tree enumeration
  dt-bindings: power: supply: Add DT schema for richtek,rt5033-battery
  power: supply: Drop BD70528 support
  ...
2021-07-07 13:17:48 -07:00
Andy Shevchenko
f39650de68 kernel.h: split out panic and oops helpers
kernel.h is being used as a dump for all kinds of stuff for a long time.
Here is the attempt to start cleaning it up by splitting out panic and
oops helpers.

There are several purposes of doing this:
- dropping dependency in bug.h
- dropping a loop by moving out panic_notifier.h
- unload kernel.h from something which has its own domain

At the same time convert users tree-wide to use new headers, although for
the time being include new header back to kernel.h to avoid twisted
indirected includes for existing users.

[akpm@linux-foundation.org: thread_info.h needs limits.h]
[andriy.shevchenko@linux.intel.com: ia64 fix]
  Link: https://lkml.kernel.org/r/20210520130557.55277-1-andriy.shevchenko@linux.intel.com

Link: https://lkml.kernel.org/r/20210511074137.33666-1-andriy.shevchenko@linux.intel.com
Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Reviewed-by: Bjorn Andersson <bjorn.andersson@linaro.org>
Co-developed-by: Andrew Morton <akpm@linux-foundation.org>
Acked-by: Mike Rapoport <rppt@linux.ibm.com>
Acked-by: Corey Minyard <cminyard@mvista.com>
Acked-by: Christian Brauner <christian.brauner@ubuntu.com>
Acked-by: Arnd Bergmann <arnd@arndb.de>
Acked-by: Kees Cook <keescook@chromium.org>
Acked-by: Wei Liu <wei.liu@kernel.org>
Acked-by: Rasmus Villemoes <linux@rasmusvillemoes.dk>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Acked-by: Sebastian Reichel <sre@kernel.org>
Acked-by: Luis Chamberlain <mcgrof@kernel.org>
Acked-by: Stephen Boyd <sboyd@kernel.org>
Acked-by: Thomas Bogendoerfer <tsbogend@alpha.franken.de>
Acked-by: Helge Deller <deller@gmx.de> # parisc
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2021-07-01 11:06:04 -07:00
Yu Jiahua
30e677a2ba drivers: power: add missing MODULE_DEVICE_TABLE in keystone-reset.c
This patch adds missing MODULE_DEVICE_TABLE definition which generates
correct modalias for automatic loading of this driver when it is built
as an external module.

Signed-off-by: Yu Jiahua <yujiahua1@huawei.com>
Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.com>
2021-06-30 00:06:37 +02:00
Zou Wei
4465b3a621 power: reset: regulator-poweroff: add missing MODULE_DEVICE_TABLE
This patch adds missing MODULE_DEVICE_TABLE definition which generates
correct modalias for automatic loading of this driver when it is built
as an external module.

Reported-by: Hulk Robot <hulkci@huawei.com>
Signed-off-by: Zou Wei <zou_wei@huawei.com>
Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.com>
2021-06-29 23:55:12 +02:00
Zhen Lei
8ef9f687ab power: reset: at91-sama5d2_shdwc: Remove redundant error printing in at91_shdwc_probe()
When devm_ioremap_resource() fails, a clear enough error message will be
printed by its subfunction __devm_ioremap_resource(). The error
information contains the device name, failure cause, and possibly resource
information.

Therefore, remove the error printing here to simplify code and reduce the
binary size.

Reported-by: Hulk Robot <hulkci@huawei.com>
Signed-off-by: Zhen Lei <thunder.leizhen@huawei.com>
Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.com>
2021-06-04 13:04:01 +02:00
Bixuan Cui
ed3443fb4d power: reset: gpio-poweroff: add missing MODULE_DEVICE_TABLE
This patch adds missing MODULE_DEVICE_TABLE definition which generates
correct modalias for automatic loading of this driver when it is built
as an external module.

Reported-by: Hulk Robot <hulkci@huawei.com>
Signed-off-by: Bixuan Cui <cuibixuan@huawei.com>
Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.com>
2021-06-04 12:58:30 +02:00
Bixuan Cui
e318c3c2ae power: reset: restart-poweroff: Add missing MODULE_DEVICE_TABLE
This patch adds missing MODULE_DEVICE_TABLE definition which generates
correct modalias for automatic loading of this driver when it is built
as an external module.

Reported-by: Hulk Robot <hulkci@huawei.com>
Signed-off-by: Bixuan Cui <cuibixuan@huawei.com>
Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.com>
2021-04-12 21:18:52 +02:00
Chen Lifu
2d54a2222c power: reset: hisi-reboot: add missing MODULE_DEVICE_TABLE
This patch adds missing MODULE_DEVICE_TABLE definition which generates
correct modalias for automatic loading of this driver when it is built
as an external module.

Reported-by: Hulk Robot <hulkci@huawei.com>
Signed-off-by: Chen Lifu <chenlifu@huawei.com>
Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.com>
2021-04-09 13:50:01 +02:00
Marek Czerski
52473b0740 power: reset: ltc2952: make trigger delay configurable
Make trigger delay configurable through device tree with
trigger-delay-ms property.

Trigger delay is the time to wait before starting shutdown
sequence after trigger line assertion.
Trigger delay must take into account the OFFT time configured
with the capacitor connected to OFFT pin of the LTC2952 chip.
Basically, the higher the capacitance connected to OFFT pin,
the larger trigger delay must be.

Signed-off-by: Marek Czerski <ma.czerski@gmail.com>
Acked-by: Rob Herring <robh@kernel.org>
Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.com>
2021-04-05 12:05:51 +02:00
Hao Fang
9f45275a34 power: reset: hisi-reboot: use the correct HiSilicon copyright
s/Hisilicon/HiSilicon/g.
It should use capital S, according to
https://www.hisilicon.com/en/terms-of-use.

Signed-off-by: Hao Fang <fanghao11@huawei.com>
Acked-by: Haojian Zhuang <haojian.zhuang@linaro.org>
Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.com>
2021-04-02 13:58:34 +02:00
Claudiu Beznea
bd3127733f power: reset: at91-reset: use devm_of_iomap
Use devm_of_iomap() to map resources. This will avoid the necessity to
track the mapped resources and free them on failure path or on remove.

Reported-by: kernel test robot <lkp@intel.com>
Reported-by: Dan Carpenter <dan.carpenter@oracle.com>
Suggested-by: Nicolas Ferre <nicolas.ferre@microchip.com>
Signed-off-by: Claudiu Beznea <claudiu.beznea@microchip.com>
Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.com>
2021-04-02 13:11:45 +02:00
Daniel Golle
3aeaf50938 power: reset: replace curly brackets in Makefile
Normal parentheses should be used when referring to config variables
in Makefile. Replace the accidentally introduced curly brackets by
regular parentheses.

Fixes: a7f79f9954 ("power: reset: add driver for LinkStation power off")
Acked-by: Daniel González Cabanelas <dgcbueu@gmail.com>
Signed-off-by: Daniel Golle <daniel@makrotopia.org>
Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.com>
2021-03-23 16:25:56 +01:00
dongjian
091d0a3a48 power: reset: remove unneeded semicolon
Fixes coccicheck warning:
drivers/power/reset/vexpress-poweroff.c:136:2-3: Unneeded semicolon

Signed-off-by: dongjian <dongjian@yulong.com>
Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.com>
2021-03-22 14:55:50 +01:00
Arnd Bergmann
9483b961ad power/reset: remove zte zx driver
The zte zx platform is getting removed, so this driver is no
longer needed.

Cc: Jun Nie <jun.nie@linaro.org>
Cc: Shawn Guo <shawnguo@kernel.org>
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.com>
2021-01-25 01:00:06 +01:00
Claudiu Beznea
b7e15bd0c1 power: reset: at91-sama5d2_shdwc: add support for sama7g5
Add support for SAMA7G5 by adding proper struct reg_config structure
and since SAMA7G5 is not currently on LPDDR setups the commit also
avoid the mapping of DDR controller.

Signed-off-by: Claudiu Beznea <claudiu.beznea@microchip.com>
Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.com>
2021-01-16 14:41:48 +01:00
Claudiu Beznea
95aa21a3f1 power: reset: at91-sama5d2_shdwc: fix wkupdbc mask
According to datasheet WKUPDBC mask is b/w bits 26..24.

Fixes: f80cb48843 ("power: reset: at91-shdwc: add new shutdown controller driver")
Signed-off-by: Claudiu Beznea <claudiu.beznea@microchip.com>
Reviewed-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.com>
2021-01-16 14:41:48 +01:00
Cristian Ciocaltea
3235d13050 power: reset: Add poweroff driver for ATC260x PMICs
This driver provides poweroff and reboot support for a system through
the ATC2603C and ATC2609A chip variants of the Actions Semi ATC260x
family of PMICs.

Signed-off-by: Cristian Ciocaltea <cristian.ciocaltea@gmail.com>
Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.com>
2021-01-13 22:17:23 +01:00
Daniel González Cabanelas
1027a42c25 power: reset: linkstation-poweroff: add missing put_device()
The of_mdio_find_bus() takes a reference to the underlying device
structure, we should release that reference using a put_device() call.

Signed-off-by: Daniel González Cabanelas <dgcbueu@gmail.com>
Signed-off-by: Sebastian Reichel <sre@kernel.org>
2020-12-29 15:59:49 +01:00
Michael Klein
ec66096b76 power: reset: new driver regulator-poweroff
This driver registers a pm_power_off function to turn off the board
by force-disabling a devicetree-defined regulator.

Signed-off-by: Michael Klein <michael@fossekall.de>
Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.com>
2020-12-13 00:14:15 +01:00
Helge Deller
36dbca148b power: reset: Use printk format symbol resolver
Instead of looking up a symbol name by hand, use the %ps printk format
specifier.

Signed-off-by: Helge Deller <deller@gmx.de>
Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.com>
2020-11-30 02:10:18 +01:00
Gregory CLEMENT
aa4302c493 power: reset: ocelot: Add support 2 other MIPS based SoCs
This adds reset support for Luton and Jaguar2 in the ocelot-reset
driver. They are both MIPS based belonging to the Vcore III family.

Acked-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
Signed-off-by: Gregory CLEMENT <gregory.clement@bootlin.com>
Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.com>
2020-11-29 22:34:07 +01:00
Geert Uytterhoeven
7007fab4ae power: reset: POWER_RESET_OCELOT_RESET should depend on Ocelot or Sparx5
To add support for Sparx5, the dependency on MSCC_OCELOT was removed.
However, this increases exposure of the driver question not only to
Sparx5 platforms, but to everyone.  Hence re-add the dependency on
MSCC_OCELOT, and extend it with ARCH_SPARX5, to prevent asking the user
about this driver when configuring a kernel without Ocelot and Sparx5
support.

Fixes: ec871696b7 ("power: reset: ocelot: Add support for Sparx5")
Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.com>
2020-10-15 21:37:59 +02:00
Lars Povlsen
ec871696b7 power: reset: ocelot: Add support for Sparx5
This adds reset support for Sparx5 in the ocelot-reset driver.

Signed-off-by: Lars Povlsen <lars.povlsen@microchip.com>
Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.com>
2020-10-08 23:24:04 +02:00
Daniel González Cabanelas
a7f79f9954 power: reset: add driver for LinkStation power off
Some Buffalo LinkStations perform the power off operation, at restart
time, depending on the state of an output pin (LED2/INTn) at the ethernet
PHY. This pin is also used to wake the machine when a WoL packet is
received by the PHY.

The driver is required by the Buffalo LinkStation LS421DE (ARM MVEBU),
and other models. Without it, the board remains forever halted if a
power off command is executed, unless the PSU is disconnected and
connected again.

Add the driver to provide the power off function and also make the WoL
feature to be available.

Signed-off-by: Daniel González Cabanelas <dgcbueu@gmail.com>
Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.com>
2020-07-28 01:49:32 +02:00
Alexander A. Klimov
f03a3497fb power: reset: keystone-reset: Replace HTTP links with HTTPS ones
Rationale:
Reduces attack surface on kernel devs opening the links for MITM
as HTTPS traffic is much harder to manipulate.

Deterministic algorithm:
For each file:
  If not .svg:
    For each line:
      If doesn't contain `\bxmlns\b`:
        For each link, `\bhttp://[^# \t\r\n]*(?:\w|/)`:
	  If neither `\bgnu\.org/license`, nor `\bmozilla\.org/MPL\b`:
            If both the HTTP and HTTPS versions
            return 200 OK and serve the same content:
              Replace HTTP with HTTPS.

Signed-off-by: Alexander A. Klimov <grandmaster@al2klimov.de>
Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.com>
2020-07-26 23:46:16 +02:00
Linus Torvalds
3a2a875174 power supply and reset changes for the v5.8 series
kobject:
  * Increase number of allowed uevent variables
 
 power-supply core:
  * Add power-supply type in uevent
  * Cleanup property handling in core
  * Make property and usb_type pointers const
  * Convert core power-supply DT binding to YAML
  * Cleanup HWMON code
  * Add new health status "calibration required"
  * Add new properties for manufacture date and
    capacity error margin
 
 battery drivers:
  * new cw2015 battery driver used by pine64 Pinebook Pro laptop
  * axp22: blacklist on Meegopad T02
  * sc27xx: support current/voltage reading
  * max17042: support time-to-empty reading
  * simple-battery: add more battery parameters
  * bq27xxx: convert DT binding document to YAML
  * sbs-battery: add TI BQ20Z65 support, fix technology property, convert
                 DT binding to YAML, add option to disable charger
 		broadcasts, add new properties: manufacture date,
 		capacity error margin, average current, charge current
 		and voltage and support calibration required health
 		status
  * misc. fixes
 
 charger drivers:
  * bq25890: cleanup, implement charge type, precharge current and input
             current limiting properties
  * bd70528: use new linear range helper library
  * bd99954: new charger driver
  * mp2629: new charger driver
  * misc. fixes
 
 reboot drivers:
  * oxnas-restart: introduce new driver
  * syscon-reboot: convert DT binding to YAML, add parent syscon device support
  * misc. fixes
 -----BEGIN PGP SIGNATURE-----
 
 iQIzBAABCgAdFiEE72YNB0Y/i3JqeVQT2O7X88g7+poFAl7a2L0ACgkQ2O7X88g7
 +poAIg//caN2sHqOFEsukXWe1oft/X0IQeGNmlCnj55l1zGJ/x03Yn0GeKb0FZgM
 go+sfMaM/a6NNdmKhseLIsYFlhVBa2E7qW1nvaxgt66JKS+GXAHfE8LWVwazDJex
 rq0esXuegsqFdbCUth81YLk2H+0qwnhVVv/Urvv1RaE/woeFHAHL1cYfcFa+YDXm
 XRDT0W73YozslFkMnZMLBLyQzad3yVnNcnRYF3Dx0CMnUsjGfPjBlyk4RLPTcgUk
 8ChTvCcHRG7IhEtF0a1HUr3UjCy9rjwiqWIobQltnbEYImxY0LWkCVVr1EsNjeyr
 ikl3c4JfwmdlVCBCSPn294mPlGKu8DNBMLN1IgAuJHKW1GuQxd0Tcbd9OwF6VlVj
 WTFWp2GcoIjKQtOWKDeCqby+hoWhgclxTHUudo7FGTT0xBP9OWTKWDpDL18cZWd8
 dNCFMEI6MDMRtwL8+3ilLcnvSoMzyZ94TZmwii9toD3xSI7TMn7oVRuOlq1TkOEw
 ZuPS3QP6jBHm8NN9JEhLbrwradP+R8qpE/jpsnWiBDR6Jt7xx4W7W0xupq4GdHAl
 u0Lbh38/0bkTijeo9xoPe03KsSBV8HOr9Lf/QVW3zLcYcGKW17j8QTkes3a0bOs0
 DZHVCFeXuWNFa/tJxe6c+J+NsroLucTMwA3lBmlZhI/TPsG2vb8=
 =He9L
 -----END PGP SIGNATURE-----

Merge tag 'for-v5.8' of git://git.kernel.org/pub/scm/linux/kernel/git/sre/linux-power-supply

Pull power supply and reset updates from Sebastian Reichel:
 "This time there are lots of changes. Quite a few changes to the core,
  lots of driver changes and one change to kobject core (with Ack from
  Greg).

  Summary:

  kobject:
   - Increase number of allowed uevent variables

  power-supply core:
   - Add power-supply type in uevent
   - Cleanup property handling in core
   - Make property and usb_type pointers const
   - Convert core power-supply DT binding to YAML
   - Cleanup HWMON code
   - Add new health status "calibration required"
   - Add new properties for manufacture date and capacity error margin

  battery drivers:
   - new cw2015 battery driver used by pine64 Pinebook Pro laptop
   - axp22: blacklist on Meegopad T02
   - sc27xx: support current/voltage reading
   - max17042: support time-to-empty reading
   - simple-battery: add more battery parameters
   - bq27xxx: convert DT binding document to YAML
   - sbs-battery: add TI BQ20Z65 support, fix technology property,
         convert DT binding to YAML, add option to disable charger
         broadcasts, add new properties: manufacture date, capacity
         error margin, average current, charge current and voltage and
         support calibration required health status
   - misc fixes

  charger drivers:
   - bq25890: cleanup, implement charge type, precharge current and
         input current limiting properties
   - bd70528: use new linear range helper library
   - bd99954: new charger driver
   - mp2629: new charger driver
   - misc fixes

  reboot drivers:
   - oxnas-restart: introduce new driver
   - syscon-reboot: convert DT binding to YAML, add parent syscon device
         support
   - misc fixes"

* tag 'for-v5.8' of git://git.kernel.org/pub/scm/linux/kernel/git/sre/linux-power-supply: (85 commits)
  power: supply: cw2015: Attach OF ID table to the driver
  power: reset: gpio-poweroff: add missing '\n' in dev_err()
  Revert "power: supply: sbs-battery: simplify read_read_string_data"
  Revert "power: supply: sbs-battery: add PEC support"
  dt-bindings: power: sbs-battery: Convert to yaml
  power: supply: sbs-battery: constify power-supply property array
  power: supply: sbs-battery: switch to i2c's probe_new
  power: supply: sbs-battery: switch from of_property_* to device_property_*
  power: supply: sbs-battery: add ability to disable charger broadcasts
  power: supply: sbs-battery: fix idle battery status
  power: supply: sbs-battery: add POWER_SUPPLY_HEALTH_CALIBRATION_REQUIRED support
  power: supply: sbs-battery: add MANUFACTURE_DATE support
  power: supply: sbs-battery: add POWER_SUPPLY_PROP_CONSTANT_CHARGE_CURRENT/VOLTAGE_MAX support
  power: supply: sbs-battery: Improve POWER_SUPPLY_PROP_TECHNOLOGY support
  power: supply: sbs-battery: add POWER_SUPPLY_PROP_CURRENT_AVG support
  power: supply: sbs-battery: add PEC support
  power: supply: sbs-battery: simplify read_read_string_data
  power: supply: sbs-battery: add POWER_SUPPLY_PROP_CAPACITY_ERROR_MARGIN support
  power: supply: sbs-battery: Add TI BQ20Z65 support
  power: supply: core: add POWER_SUPPLY_HEALTH_CALIBRATION_REQUIRED
  ...
2020-06-10 11:28:35 -07:00
Luca Ceresoli
5a1c9565c0 power: reset: gpio-poweroff: add missing '\n' in dev_err()
dev_err() needs a terminating newline.

Signed-off-by: Luca Ceresoli <luca@lucaceresoli.net>
Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.com>
2020-06-06 01:13:26 +02:00
Linus Torvalds
694b5a5d31 ARM: SoC changes for v5.8
One new platform gets added, the Realtek RTD1195, which is an older
 Cortex-a7 based relative of the RTD12xx chips that are already supported
 in arch/arm64. The platform may also be extended to support running
 32-bit kernels on those 64-bit chips for memory-constrained machines.
 
 In the Renesas shmobile platform, we gain support for "RZ/G1H" or R8A7742,
 an eight-core chip based on Cortex-A15 and Cortex-A7 cores, originally
 released in 2016 as one of the last high-end 32-bit designs.
 
 There is ongoing cleanup for the integrator, tegra, imx, and omap2
 platforms, with integrator getting very close to the goal of having
 zero code in arch/arm/, and omap2 moving more of the chip specifics
 from old board code into device tree files.
 
 The Versatile Express platform is made more modular, with built-in
 drivers now becoming loadable modules. This is part of a greater effort
 for the Android OS to have a common kernel binary for all platforms and
 any platform specific code in loadable modules.
 
 The PXA platform drops support for Compulab's pxa2xx boards that had
 rather unusual flash and PCI drivers but no known users remaining.
 All device drivers specific to those boards can now get removed as
 well.
 
 Across platforms, there is ongoing cleanup, with Geert and Rob
 revisiting some a lot of Kconfig options.
 
 Signed-off-by: Arnd Bergmann <arnd@arndb.de>
 -----BEGIN PGP SIGNATURE-----
 
 iQIzBAABCgAdFiEEo6/YBQwIrVS28WGKmmx57+YAGNkFAl7XvmAACgkQmmx57+YA
 GNk4vRAAs3TxlwLAUk5dknAi+UstlviNPG/ys6mViFuLqktPyhkA/v6nFOBI5Ldf
 8xAsaSk3+oAX3Dd7aTaudl5WMFWFtzT5xA4gEI7CBZrBaAL0BVns1JfnVxpPRIcF
 B09Sb3wv7++E/+AxYcoVLWd5wkc9tlMesrIV5FPHHasOp3rRjVI0cExXnXzqJU8M
 TbwrWEOczZNVAm2q4Eh1ttbuSIvPd3s4NMnI755MRSQ7u/rYFSPf6Ay8/eFTqx1e
 0SMWHRmrGeP6yhLy7+Li0x0jsK3ReZ9SkLXp3iEZ9huKbBTHIPBUeBB1RMnCYGe+
 M2OL+9ySSe9UI9sjvsLGPDAnJaZI/UDUOVhatZCTvYB7CZY5nYNrYp+heYFONWm6
 Up3e1t2iGPbgs8/1y78a9YPxAdsW0iavRtjVUYb+nwX+savYZgSBATA1pZqLc317
 5FAGmTh//OLKYBSjfAxu9H8aInJPZA595lUiPHEQujzZH5Xz0QNtv4dapeNL2I4g
 LO20PMvuEgmwlwj/Npnwdl0UQK3ztoeR2upCrk91VwtNWGiOWTzCMT/OkYAAjKuo
 QYMGu3UvbbTCHPsIdrUz8gZ2T3VnJoeE3ldny2QbNAtVdpH/F8htJcilrBbyv1vI
 IKB1oogf5zfUwXVwZRxCfI9s5hELUlAKMGTtNcybzdsKpN5xtTo=
 =gzCp
 -----END PGP SIGNATURE-----

Merge tag 'arm-soc-5.8' of git://git.kernel.org/pub/scm/linux/kernel/git/soc/soc

Pull ARM SoC updates from Arnd Bergmann:
 "One new platform gets added, the Realtek RTD1195, which is an older
  Cortex-a7 based relative of the RTD12xx chips that are already
  supported in arch/arm64. The platform may also be extended to support
  running 32-bit kernels on those 64-bit chips for memory-constrained
  machines.

  In the Renesas shmobile platform, we gain support for "RZ/G1H" or
  R8A7742, an eight-core chip based on Cortex-A15 and Cortex-A7 cores,
  originally released in 2016 as one of the last high-end 32-bit
  designs.

  There is ongoing cleanup for the integrator, tegra, imx, and omap2
  platforms, with integrator getting very close to the goal of having
  zero code in arch/arm/, and omap2 moving more of the chip specifics
  from old board code into device tree files.

  The Versatile Express platform is made more modular, with built-in
  drivers now becoming loadable modules. This is part of a greater
  effort for the Android OS to have a common kernel binary for all
  platforms and any platform specific code in loadable modules.

  The PXA platform drops support for Compulab's pxa2xx boards that had
  rather unusual flash and PCI drivers but no known users remaining. All
  device drivers specific to those boards can now get removed as well.

  Across platforms, there is ongoing cleanup, with Geert and Rob
  revisiting some a lot of Kconfig options"

* tag 'arm-soc-5.8' of git://git.kernel.org/pub/scm/linux/kernel/git/soc/soc: (94 commits)
  ARM: omap2: fix omap5_realtime_timer_init definition
  ARM: zynq: Don't select CONFIG_ICST
  ARM: OMAP2+: Fix regression for using local timer on non-SMP SoCs
  clk: versatile: Fix kconfig dependency on COMMON_CLK_VERSATILE
  ARM: davinci: fix build failure without I2C
  power: reset: vexpress: fix build issue
  power: vexpress: cleanup: use builtin_platform_driver
  power: vexpress: add suppress_bind_attrs to true
  Revert "ARM: vexpress: Don't select VEXPRESS_CONFIG"
  MAINTAINERS: pxa: remove Compulab arm/pxa support
  ARM: pxa: remove Compulab pxa2xx boards
  bus: arm-integrator-lm: Fix return value check in integrator_ap_lm_probe()
  soc: imx: move cpu code to drivers/soc/imx
  ARM: imx: move cpu definitions into a header
  ARM: imx: use device_initcall for imx_soc_device_init
  ARM: imx: pcm037: make pcm970_sja1000_platform_data static
  bus: ti-sysc: Timers no longer need legacy quirk handling
  ARM: OMAP2+: Drop old timer code for dmtimer and 32k counter
  ARM: dts: Configure system timers for omap2
  ARM: dts: Configure system timers for ti81xx
  ...
2020-06-04 19:47:11 -07:00
Anders Roxell
d0c7dc1739 power: reset: vexpress: fix build issue
An allmodconfig kernel makes CONFIG_VEXPRESS_CONFIG a module and
CONFIG_POWER_RESET_VEXPRESS builtin. That makes us see this build
error:

aarch64-linux-gnu-ld: drivers/power/reset/vexpress-poweroff.o: in function `vexpress_reset_probe':
../drivers/power/reset/vexpress-poweroff.c:119: undefined reference to `devm_regmap_init_vexpress_config'
../drivers/power/reset/vexpress-poweroff.c:119:(.text+0x48c): relocation truncated to fit: R_AARCH64_CALL26 against undefined symbol
`devm_regmap_init_vexpress_config'
make[1]: *** [/srv/src/kernel/next/Makefile:1126: vmlinux] Error 1

Rework so that POWER_RESET_VEXPRESS depends on 'VEXPRESS_CONFIG=y'.

Link: https://lore.kernel.org/r/20200527112608.3886105-5-anders.roxell@linaro.org
Fixes: d06cfe3f12 ("bus: vexpress-config: Merge vexpress-syscfg into vexpress-config")
Signed-off-by: Anders Roxell <anders.roxell@linaro.org>
Acked-by: Rob Herring <robh@kernel.org>
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
2020-05-28 12:31:49 +02:00
Anders Roxell
a90d990452 power: vexpress: cleanup: use builtin_platform_driver
Use the helper macro for builtin drivers taht don't do anything special
in driver init. This removes some boilerplate code.

Link: https://lore.kernel.org/r/20200527112608.3886105-3-anders.roxell@linaro.org
Signed-off-by: Anders Roxell <anders.roxell@linaro.org>
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
2020-05-28 12:31:30 +02:00
Anders Roxell
73174acc9c power: vexpress: add suppress_bind_attrs to true
Make sure that the POWER_RESET_VEXPRESS driver won't have bind/unbind
attributes available via the sysfs, so lets be explicit here and use
".suppress_bind_attrs = true" to prevent userspace from doing something
silly.

Link: https://lore.kernel.org/r/20200527112608.3886105-2-anders.roxell@linaro.org
Cc: stable@vger.kernel.org
Signed-off-by: Anders Roxell <anders.roxell@linaro.org>
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
2020-05-28 12:30:47 +02:00
Serge Semin
c3d8052223 power: reset: syscon-reboot: Add parental syscon support
Since normally syscon-reboot block is supposed to be a part of a system
controller, lets look for the syscon regmap in a parental DT node if
regmap property isn't specified. DT binding from now considers the regmap
property as deprecated.

Signed-off-by: Serge Semin <Sergey.Semin@baikalelectronics.ru>
Cc: Alexey Malahov <Alexey.Malahov@baikalelectronics.ru>
Cc: Thomas Bogendoerfer <tsbogend@alpha.franken.de>
Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.com>
2020-05-28 09:00:30 +02:00
Ran Bi
29ee40091e rtc: mt6397: Add support for the MediaTek MT6358 RTC
This add support for the MediaTek MT6358 RTC. Driver using
compatible data to store different RTC_WRTGR address offset.
This replace RTC_WRTGR to RTC_WRTGR_MT6323 in mt6323-poweroff
driver which only needed by armv7 CPU without ATF.

Signed-off-by: Ran Bi <ran.bi@mediatek.com>
Signed-off-by: Hsin-Hsiung Wang <hsin-hsiung.wang@mediatek.com>
Reviewed-by: Nicolas Boichat <drinkcat@chromium.org>
Acked-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
Acked-by: Sebastian Reichel <sre@kernel.org>
Reviewed-by: Yingjoe Chen <yingjoe.chen@mediatek.com>
Signed-off-by: Lee Jones <lee.jones@linaro.org>
2020-05-21 08:55:48 +01:00
Hongbo Yao
1072ceada4 power: reset: ltc2952: remove unused variable
Fix gcc '-Wunused-but-set-variable' warning:
drivers/power/reset/ltc2952-poweroff.c:97:16: warning: variable
‘overruns’ set but not used [-Wunused-but-set-variable]
  unsigned long overruns;

Reported-by: Hulk Robot <hulkci@huawei.com>
Signed-off-by: Hongbo Yao <yaohongbo@huawei.com>
Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.com>
2020-05-10 01:20:41 +02:00
Daniel Golle
0edb259c98 power: reset: introduce oxnas-restart
Add reboot handler for Oxford OX820 chips as reboot currenly hangs on
those boards. Code is based on ox820_assert_system_reset() found in
https://github.com/kref/linux-oxnas.git in
arch/arm/mach-oxnas/mach-ox820.c line 181.

Signed-off-by: Daniel Golle <daniel@makrotopia.org>
Acked-by: Neil Armstrong <narmstrong@baylibre.com>
Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.com>
2020-04-30 23:24:33 +02:00
Kejia Hu
fc5be29f9b power: reset: qcom-pon: reg write mask depends on pon generation
Instead of hardcode the mask, it should be depends
on which generation of pon it was.

Signed-off-by: Kejia Hu <kejia.hu@codethink.co.uk>
Fixes: fce5430f6a ("reset: qcom-pon: Add support for gen2 pon")
Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.com>
2020-04-28 21:16:45 +02:00
Linus Torvalds
a10c9c710f power supply and reset changes for the v5.7 series
Core:
  * Nothing
 
 Drivers:
  * at91-reset: cleanups, proper handling for sam9x60
  * sc27xx, charger-manager: allow building as module
  * sc27xx: add support to read current charge capacity
  * axp288: more quirks for weird hardware
  * misc. fixes
 -----BEGIN PGP SIGNATURE-----
 
 iQIzBAABCgAdFiEE72YNB0Y/i3JqeVQT2O7X88g7+poFAl6I5QEACgkQ2O7X88g7
 +pqAuw//a7kiTyhmRVd06OrYZRJNXjHB2bGqsZhW6skjgfZnIGqd8RAGEEFvfFkf
 ga9ChtIbWAscZwcud77t9NeNksQEBDjHaekL9LtQ1zuwYHWbpS2fZb89SHrGhk0q
 tJ/JegZpEWFH+6ZqmXrIxMV32/XSs2prWZRb+8RyuTq6mJE3DOaeL9e9rfkXUW1N
 s+wWW2a6JXAriFHgPk/BZMM/AUOlYpRaRmF77QvYK3Tfq2x2CeEvzHNr4e6fI9af
 LycVLkK5kjTXTnGyPn11LhGia8I+YGDB6NXyOEYD9wfnDRA/IlLAOYbuNzmxA+U7
 oTm/swY8yHYpiOWM9A+I57c44wUIAp/rxIs6xafz6f1gPScClXKX9SQ0WjQfknCp
 vS7VZ4WjIjZSFrghND/CUjE0bEtbYNZC25T3NomU2MXuJAUvO83QjSaPG0Q9DzCw
 jVkrbS3gcq9ePAmZEvVhMh37By5IWzalM2DxRE9zuNxRZ2Px4T+zP6sJ4Wp4LWpK
 Ufss2WtjzpixYIEc3M3WjptXEaGWynpOnj69iDkPekSTOhuHH69ykiwyM4fA0jGN
 bttCV19e0HVSGxeXXyOEznwMqeBwv+EMgxEasm71TewEJzu/5caagihLCZuJv/Ji
 /O+T5uHiONhIHXKZMkYIa3SCcHSCKVBxbADuyCNUEWT7pehm2Uk=
 =BCS7
 -----END PGP SIGNATURE-----

Merge tag 'for-v5.7' of git://git.kernel.org/pub/scm/linux/kernel/git/sre/linux-power-supply

Pull power supply and reset changes from Sebastian Reichel:
 "Core:
   - Nothing

  Drivers:
   - at91-reset: cleanups, proper handling for sam9x60
   - sc27xx, charger-manager: allow building as module
   - sc27xx: add support to read current charge capacity
   - axp288: more quirks for weird hardware
   - misc fixes"

* tag 'for-v5.7' of git://git.kernel.org/pub/scm/linux/kernel/git/sre/linux-power-supply: (26 commits)
  power: reset: sc27xx: Allow the SC27XX poweroff driver building into a module
  power: reset: sc27xx: Change to use cpu_down()
  power: reset: sc27xx: Power off the external subsystems' connection
  power: twl4030: Use scnprintf() for avoiding potential buffer overflow
  power: supply: bq27xxx_battery: Silence deferred-probe error
  power: reset: at91-reset: handle nrst async for sam9x60
  power: reset: at91-reset: get rid of at91_reset_data
  power: reset: at91-reset: keep only one reset function
  power: reset: at91-reset: make at91sam9g45_restart() generic
  power: reset: at91-reset: introduce ramc_lpr to struct at91_reset
  power: reset: at91-reset: use r4 as tmp argument
  power: reset: at91-reset: introduce args member in at91_reset_data
  power: reset: at91-reset: introduce struct at91_reset_data
  power: reset: at91-reset: devm_kzalloc() for at91_reset data structure
  power: reset: at91-reset: pass rstc base address to at91_reset_status()
  power: reset: at91-reset: convert reset in pointer to struct at91_reset
  power: reset: at91-reset: add notifier block to struct at91_reset
  power: reset: at91-reset: add sclk to struct at91_reset
  power: reset: at91-reset: add ramc_base[] to struct at91_reset
  power: reset: at91-reset: introduce struct at91_reset
  ...
2020-04-05 13:47:57 -07:00
Baolin Wang
f78c55e3b4 power: reset: sc27xx: Allow the SC27XX poweroff driver building into a module
Change the config to 'tristate' and use module_platform_driver() to
allow the SC27XX poweroff driver building into a module, as well as
adding some mudule information.

Signed-off-by: Baolin Wang <baolin.wang7@gmail.com>
Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.com>
2020-03-11 23:32:09 +01:00