* refs/heads/tmp-0d3cca0c: UPSTREAM: driver core: Skip unnecessary work when device doesn't have sync_state() Linux 5.4.26 net/smc: cancel event worker during device removal net/smc: check for valid ib_client_data ipv6: restrict IPV6_ADDRFORM operation iommu/amd: Fix IOMMU AVIC not properly update the is_run bit in IRTE i2c: acpi: put device when verifying client fails iommu/vt-d: Ignore devices with out-of-spec domain number iommu/vt-d: Fix the wrong printing in RHSA parsing netfilter: nft_chain_nat: inet family is missing module ownership netfilter: nf_tables: dump NFTA_CHAIN_FLAGS attribute netfilter: nft_tunnel: add missing attribute validation for tunnels netfilter: nft_payload: add missing attribute validation for payload csum flags netfilter: cthelper: add missing attribute validation for cthelper perf bench futex-wake: Restore thread count default to online CPU count nl80211: add missing attribute validation for channel switch nl80211: add missing attribute validation for beacon report scanning nl80211: add missing attribute validation for critical protocol indication i2c: gpio: suppress error on probe defer iommu/vt-d: Fix RCU-list bugs in intel_iommu_init() driver code: clarify and fix platform device DMA mask allocation drm/i915/gvt: Fix unnecessary schedule timer when no vGPU exits pinctrl: core: Remove extra kref_get which blocks hogs being freed drm/i915/gvt: Fix dma-buf display blur issue on CFL virtio_ring: Fix mem leak with vring_new_virtqueue() pinctrl: imx: scu: Align imx sc msg structs to 4 pinctrl: meson-gxl: fix GPIOX sdio pins clk: imx8mn: Fix incorrect clock defines batman-adv: Don't schedule OGM for disabled interface iommu/vt-d: Fix a bug in intel_iommu_iova_to_phys() for huge page iommu/vt-d: Fix RCU list debugging warnings iommu/vt-d: dmar: replace WARN_TAINT with pr_warn + add_taint iommu/dma: Fix MSI reservation allocation x86/mce: Fix logic and comments around MSR_PPIN_CTL perf/amd/uncore: Replace manual sampling check with CAP_NO_INTERRUPT flag mt76: fix array overflow on receiving too many fragments for a packet i2c: designware-pci: Fix BUG_ON during device removal efi: Add a sanity check to efivar_store_raw() efi: Fix a race and a buffer overflow while reading efivars via sysfs x86/ioremap: Map EFI runtime services data as encrypted for SEV macintosh: windfarm: fix MODINFO regression fscrypt: don't evict dirty inodes after removing key blk-iocost: fix incorrect vtime comparison in iocg_is_idle() ipmi_si: Avoid spurious errors for optional IRQs s390/dasd: fix data corruption for thin provisioned devices fuse: fix stack use after return ARC: define __ALIGN_STR and __ALIGN symbols for ARC KVM: nVMX: avoid NULL pointer dereference with incorrect EVMCS GPAs KVM: x86: clear stale x86_emulate_ctxt->intercept value gfs2_atomic_open(): fix O_EXCL|O_CREAT handling on cold dcache cifs_atomic_open(): fix double-put on late allocation failure ktest: Add timeout for ssh sync testing pinctrl: falcon: fix syntax error mmc: sdhci-pci-gli: Enable MSI interrupt for GL975x drm/i915: Defer semaphore priority bumping to a workqueue drm/i915: be more solid in checking the alignment drm/amd/display: remove duplicated assignment to grph_obj_type workqueue: don't use wq_select_unbound_cpu() for bound works netfilter: x_tables: xt_mttg_seq_next should increase position index netfilter: xt_recent: recent_seq_next should increase position index netfilter: synproxy: synproxy_cpu_seq_next should increase position index netfilter: nf_conntrack: ct_cpu_seq_next should increase position index iommu/vt-d: quirk_ioat_snb_local_iommu: replace WARN_TAINT with pr_warn + add_taint virtio-blk: fix hw_queue stopped on arbitrary error iwlwifi: mvm: Do not require PHY_SKU NVM section for 3168 devices netfilter: nf_tables: fix infinite loop when expr is not available cgroup: Iterate tasks that did not finish do_exit() cgroup: cgroup_procs_next should increase position index net: phy: Avoid multiple suspends net: dsa: Don't instantiate phylink for CPU/DSA ports unless needed selftests/net/fib_tests: update addr_metric_test for peer route testing net/ipv6: remove the old peer route if change it to a new one net/ipv6: need update peer route when modify metric net: phy: fix MDIO bus PM PHY resuming net: phy: avoid clearing PHY interrupts twice in irq handler nfc: add missing attribute validation for vendor subcommand nfc: add missing attribute validation for deactivate target nfc: add missing attribute validation for SE API tipc: add missing attribute validation for MTU property team: add missing attribute validation for array index team: add missing attribute validation for port ifindex net: taprio: add missing attribute validation for txtime delay net: fq: add missing attribute validation for orphan mask macsec: add missing attribute validation for port can: add missing attribute validation for termination nl802154: add missing attribute validation for dev_type nl802154: add missing attribute validation fib: add missing attribute validation for tun_id devlink: validate length of region addr/len devlink: validate length of param values net: memcg: fix lockdep splat in inet_csk_accept() net: memcg: late association of sock to memcg cgroup: memcg: net: do not associate sock with unrelated cgroup bnxt_en: fix error handling when flashing from file bnxt_en: reinitialize IRQs when MTU is modified bonding/alb: make sure arp header is pulled before accessing it taprio: Fix sending packets without dequeueing them slip: make slhc_compress() more robust against malicious packets sfc: detach from cb_page in efx_copy_channel() r8152: check disconnect status after long sleep net: systemport: fix index check to avoid an array out of bounds access net: stmmac: dwmac1000: Disable ACS if enhanced descs are not used net: phy: bcm63xx: fix OOPS due to missing driver name net/packet: tpacket_rcv: do not increment ring index on drop net: nfc: fix bounds checking bugs on "pipe" net: macsec: update SCI upon MAC address change. netlink: Use netlink header as base to calculate bad attribute offset net/ipv6: use configured metric when add peer route net: hns3: fix a not link up issue when fibre port supports autoneg net: fec: validate the new settings in fec_enet_set_coalesce() net: dsa: mv88e6xxx: fix lockup on warm boot net: dsa: fix phylink_start()/phylink_stop() calls macvlan: add cond_resched() during multicast processing ipvlan: don't deref eth hdr before checking it's set ipvlan: do not use cond_resched_rcu() in ipvlan_process_multicast() ipvlan: do not add hardware address of master to its unicast filter list ipvlan: add cond_resched_rcu() while processing muticast backlog ipv6/addrconf: call ipv6_mc_up() for non-Ethernet interface inet_diag: return classid for all socket types gre: fix uninit-value in __iptunnel_pull_header cgroup, netclassid: periodically release file_lock on classid updating ALSA: hda/realtek - Fixed one of HP ALC671 platform Headset Mic supported ALSA: hda/realtek - Add Headset Mic supported for HP cPC ALSA: hda/realtek - More constifications virtio_balloon: Adjust label in virtballoon_probe ANDROID: GKI: Revert "mm: unexport free_reserved_area" ANDROID: Export functions to be used with dma_map_ops in modules ANDROID: GKI: add android_kabi.h ANDROID: GKI: update abi due to CONFIG_JUMP_LABEL being enabled ANDROID: GKI: enable CONFIG_JUMP_LABEL ANDROID: Add build.config.gki-debug.x86_64 ANDROID: update the abi signatures ANDROID: Add build.config.gki-debug.aarch64 Revert "ANDROID: drm: edid: add support for additional CEA extension blocks" Revert "ANDROID: drm: Parse Colorimetry data block from EDID" ANDROID: Add build.config files for ARM 32-bit ANDROID: Kconfig.gki: Add FRAME_VECTOR UPSTREAM: cgroup: Iterate tasks that did not finish do_exit() ANDROID: gki_defconfig: Enable more USB_CONFIGFS gadgets Revert "ANDROID: tty: serdev: Fix broken serial console input" ANDROID: serdev: restrict claim of platform devices ANDROID: Add TPM support and the vTPM proxy to Cuttlefish. FROMGIT: ASoC: sprd: Allow the MCDT driver to build into modules FROMGIT: thermal: sprd: Add Spreadtrum thermal driver support FROMGIT: dt-bindings: thermal: sprd: Add the Spreadtrum thermal documentation ANDROID: ABI update due to power supply patches being merged FROMGIT: pinctrl: sprd: Fix the kconfig warning FROMGIT: pinctrl: sprd: Allow the SPRD pinctrl driver building into a module FROMGIT: pinctrl: Export some needed symbols at module load time FROMGIT: power: reset: sc27xx: Allow the SC27XX poweroff driver building into a module FROMGIT: power: reset: sc27xx: Change to use cpu_down() FROMGIT: power: reset: sc27xx: Power off the external subsystems' connection FROMGIT: power: supply: sc27xx: Add POWER_SUPPLY_PROP_CHARGE_NOW attribute UPSTREAM: power: supply: sc27xx: Calibrate the resistance of coulomb counter UPSTREAM: dt-bindings: power: sc27xx: Add a new property to describe the real resistance of coulomb counter chip UPSTREAM: power: supply: sc27xx: Optimize the battery resistance with measuring temperature UPSTREAM: power: supply: core: Add battery internal resistance temperature table support UPSTREAM: dt-bindings: power: Introduce one property to describe the battery resistance with temperature changes ANDROID: abi_gki_aarch64_whitelist: update after whitelist changes ANDROID: update abi_gki_aarch64_cuttlefish_whitelist ANDROID: update abi_gki_aarch64_db845c_whitelist ANDROID: update abi due to interconnect changes UPSTREAM: interconnect: Handle memory allocation errors UPSTREAM: interconnect: Add basic tracepoints UPSTREAM: interconnect: Add a name to struct icc_path UPSTREAM: interconnect: Move internal structs into a separate file Linux 5.4.25 drm/virtio: module_param_named() requires linux/moduleparam.h csky: Implement copy_thread_tls block, bfq: remove ifdefs from around gets/puts of bfq groups block, bfq: get a ref to a group when adding it to a service tree efi: READ_ONCE rng seed size before munmap efi/x86: Handle by-ref arguments covering multiple pages in mixed mode efi/x86: Align GUIDs to their size in the mixed mode runtime wrapper powerpc: fix hardware PMU exception bug on PowerVM compatibility mode systems EDAC/synopsys: Do not print an error with back-to-back snprintf() calls bus: ti-sysc: Fix 1-wire reset quirk arm64: dts: meson: fix gxm-khadas-vim2 wifi dmaengine: coh901318: Fix a double lock bug in dma_tc_handle() dma-buf: free dmabuf->name in dma_buf_release() hwmon: (adt7462) Fix an error return in ADT7462_REG_VOLT() ARM: dts: imx7-colibri: Fix frequency for sd/mmc ARM: dts: dra7xx-clocks: Fixup IPU1 mux clock parent source ARM: dts: am437x-idk-evm: Fix incorrect OPP node names ARM: imx: build v7_cpu_resume() unconditionally IB/hfi1, qib: Ensure RCU is locked when accessing list RMDA/cm: Fix missing ib_cm_destroy_id() in ib_cm_insert_listen() regulator: stm32-vrefbuf: fix a possible overshoot when re-enabling RDMA/core: Fix protection fault in ib_mr_pool_destroy RDMA/iwcm: Fix iwcm work deallocation RDMA/siw: Fix failure handling during device creation RDMA/nldev: Fix crash when set a QP to a new counter but QPN is missing RDMA/rw: Fix error flow during RDMA context initialization Revert "RDMA/cma: Simplify rdma_resolve_addr() error flow" soc: imx-scu: Align imx sc msg structs to 4 firmware: imx: Align imx_sc_msg_req_cpu_start to 4 firmware: imx: scu-pd: Align imx sc msg structs to 4 firmware: imx: misc: Align imx sc msg structs to 4 arm64: dts: imx8qxp-mek: Remove unexisting Ethernet PHY ARM: dts: imx6: phycore-som: fix emmc supply phy: mapphone-mdm6600: Fix write timeouts with shorter GPIO toggle interval phy: mapphone-mdm6600: Fix timeouts by adding wake-up handling drm/i915/selftests: Fix return in assert_mmap_offset() drm/i915: Program MBUS with rmw during initialization drm/sun4i: de2/de3: Remove unsupported VI layer formats drm/sun4i: Fix DE2 VI layer format support drm/sun4i: Add separate DE3 VI layer formats drm: kirin: Revert "Fix for hikey620 display offset problem" drm/panfrost: Don't try to map on error faults spi: atmel-quadspi: fix possible MMIO window size overrun ASoC: dapm: Correct DAPM handling of active widgets during shutdown ASoC: Intel: Skylake: Fix available clock counter incrementation ASoC: pcm512x: Fix unbalanced regulator enable call in probe error path ASoC: pcm: Fix possible buffer overflow in dpcm state sysfs output powerpc/mm: Fix missing KUAP disable in flush_coherent_icache() powerpc: Convert flush_icache_range & friends to C powerpc: define helpers to get L1 icache sizes ASoC: intel: skl: Fix possible buffer overflow in debug outputs ASoC: intel: skl: Fix pin debug prints ASoC: SOF: Fix snd_sof_ipc_stream_posn() ASoC: topology: Fix memleak in soc_tplg_manifest_load() ASoC: topology: Fix memleak in soc_tplg_link_elems_load() drm/virtio: fix resource id creation race drm/virtio: make resource id workaround runtime switchable. spi: bcm63xx-hsspi: Really keep pll clk enabled ARM: dts: ls1021a: Restore MDIO compatible to gianfar arm64: dts: meson-sm1-sei610: add missing interrupt-names dm: fix congested_fn for request-based device dm zoned: Fix reference counter initial value of chunk works dm writecache: verify watermark during resume dm: report suspended device during destroy dm cache: fix a crash due to incorrect work item cancelling dm integrity: fix invalid table returned due to argument count mismatch dm integrity: fix a deadlock due to offloading to an incorrect workqueue dm integrity: fix recalculation when moving from journal mode to bitmap mode dmaengine: tegra-apb: Prevent race conditions of tasklet vs free list dmaengine: tegra-apb: Fix use-after-free dmaengine: imx-sdma: Fix the event id check to include RX event for UART6 dmaengine: imx-sdma: fix context cache s390/mm: fix panic in gup_fast on large pud s390/pci: Fix unexpected write combine on resource x86/pkeys: Manually set X86_FEATURE_OSPKE to preserve existing changes spi: spidev: Fix CS polarity if GPIO descriptors are used perf arm-spe: Fix endless record after being terminated perf cs-etm: Fix endless record after being terminated perf intel-bts: Fix endless record after being terminated perf intel-pt: Fix endless record after being terminated media: v4l2-mem2mem.c: fix broken links media: vicodec: process all 4 components for RGB32 formats media: mc-entity.c: use & to check pad flags, not == media: hantro: Fix broken media controller links vt: selection, push sel_lock up vt: selection, push console lock down vt: selection, close sel_buffer race serial: 8250_exar: add support for ACCES cards tty: serial: fsl_lpuart: free IDs allocated by IDA tty:serial:mvebu-uart:fix a wrong return arm: dts: dra76x: Fix mmc3 max-frequency arm64: dts: socfpga: agilex: Fix gmac compatible btrfs: fix RAID direct I/O reads with alternate csums fat: fix uninit-memory access for partial initialized inode mm, hotplug: fix page online with DEBUG_PAGEALLOC compiled but not enabled mm: fix possible PMD dirty bit lost in set_pmd_migration_entry() mm, numa: fix bad pmd by atomically check for pmd_trans_huge when marking page tables prot_numa vgacon: Fix a UAF in vgacon_invert_region usb: core: port: do error out if usb_autopm_get_interface() fails usb: core: hub: do error out if usb_autopm_get_interface() fails usb: core: hub: fix unhandled return by employing a void function usb: cdns3: gadget: toggle cycle bit before reset endpoint usb: cdns3: gadget: link trb should point to next request usb: dwc3: gadget: Update chain bit correctly when using sg list usb: quirks: add NO_LPM quirk for Logitech Screen Share usb: storage: Add quirk for Samsung Fit flash cifs: fix rename() by ensuring source handle opened with DELETE bit cifs: don't leak -EAGAIN for stat() during reconnect ALSA: hda/realtek - Enable the headset of ASUS B9450FA with ALC294 ALSA: hda/realtek - Fix silent output on Gigabyte X570 Aorus Master ALSA: hda/realtek - Add Headset Button supported for ThinkPad X1 ALSA: hda/realtek - Add Headset Mic supported binder: prevent UAF for binderfs devices II binder: prevent UAF for binderfs devices firmware: imx: scu: Ensure sequential TX selftests: forwarding: vxlan_bridge_1d: use more proper tos value arch/csky: fix some Kconfig typos csky: Fixup compile warning for three unimplemented syscalls csky: Fixup ftrace modify panic csky/smp: Fixup boot failed when CONFIG_SMP csky: Set regs->usp to kernel sp, when the exception is from kernel csky/mm: Fixup export invalid_pte_table symbol net: thunderx: workaround BGX TX Underflow issue x86/xen: Distribute switch variables for initialization ice: Don't tell the OS that link is going down nvme: Fix uninitialized-variable warning s390/qdio: fill SL with absolute addresses x86/boot/compressed: Don't declare __force_order in kaslr_64.c nvme-pci: Use single IRQ vector for old Apple models nvme/pci: Add sleep quirk for Samsung and Toshiba drives iommu/amd: Disable IOMMU on Stoney Ridge systems net/mlx5: DR, Fix matching on vport gvmi efi: Only print errors about failing to get certs if EFI vars are found s390: make 'install' not depend on vmlinux s390/cio: cio_ignore_proc_seq_next should increase position index watchdog: da9062: do not ping the hw during stop() net: ethernet: dm9000: Handle -EPROBE_DEFER in dm9000_parse_dt() net: ks8851-ml: Fix 16-bit IO operation net: ks8851-ml: Fix 16-bit data access net: ks8851-ml: Remove 8-bit bus accessors net: atlantic: check rpc result and wait for rpc address selftests: forwarding: vxlan_bridge_1d: fix tos value selftests: forwarding: use proto icmp for {gretap, ip6gretap}_mac testing drm/msm/dsi/pll: call vco set rate explicitly drm/msm/dsi: save pll state before dsi host is powered off scsi: megaraid_sas: silence a warning drm/modes: Allow DRM_MODE_ROTATE_0 when applying video mode parameters drm/modes: Make sure to parse valid rotation value from cmdline drm: msm: Fix return type of dsi_mgr_connector_mode_valid for kCFI drm/msm/mdp5: rate limit pp done timeout warnings habanalabs: patched cb equals user cb in device memset habanalabs: do not halt CoreSight during hard reset habanalabs: halt the engines before hard-reset usb: gadget: serial: fix Tx stall after buffer overflow usb: gadget: ffs: ffs_aio_cancel(): Save/restore IRQ flags usb: gadget: composite: Support more than 500mA MaxPower selftests: fix too long argument serial: ar933x_uart: set UART_CS_{RX,TX}_READY_ORIDE ALSA: hda: do not override bus codec_mask in link_get() blktrace: fix dereference after null check kprobes: Fix optimize_kprobe()/unoptimize_kprobe() cancellation logic kbuild: fix 'No such file or directory' warning when cleaning RDMA/core: Fix use of logical OR in get_new_pps RDMA/core: Fix pkey and port assignment in get_new_pps dm thin metadata: fix lockdep complaint net: stmmac: fix notifier registration net: dsa: bcm_sf2: Forcibly configure IMP port for 1Gb/sec ALSA: hda/realtek - Fix a regression for mute led on Lenovo Carbon X1 block, bfq: do not insert oom queue into position tree block, bfq: get extra ref to prevent a queue from being freed during a group move FROMGIT: kallsyms: unexport kallsyms_lookup_name() and kallsyms_on_each_symbol() FROMGIT: samples/hw_breakpoint: drop use of kallsyms_lookup_name() FROMGIT: samples/hw_breakpoint: drop HW_BREAKPOINT_R when reporting writes UPSTREAM: fscrypt: don't evict dirty inodes after removing key ANDROID: ABI/Whitelist: update whitelist of unisoc upstream code ANDROID: gki_defconfig: Enable CONFIG_VM_EVENT_COUNTERS ANDROID: gki_defconfig: Enable CONFIG_CLEANCACHE ANDROID: arm64: update the abi with the new gki_defconfig ANDROID: gki_defconfig: disable CONFIG_DEBUG_DEVRES ANDROID: Update the abi xml file ANDROID: GKI: arm64: reserve space in cpu_hwcaps and cpu_hwcap_keys arrays FROMGIT: power: supply: Allow charger manager can be built as a module ANDROID: arm64: gki_defconfig: disable CONFIG_DEBUG_PREEMPT ANDROID: iommu/iova: Fix to use __alloc_and_insert_iova_best_fit ANDROID: enable CONFIG_WATCHDOG_CORE=y ANDROID: kbuild: align UNUSED_KSYMS_WHITELIST with upstream FROMLIST: f2fs: fix wrong check on F2FS_IOC_FSSETXATTR ANDROID: gki_defconfig: enable CONFIG_TYPEC UPSTREAM: scsi: ufs: ufs-mediatek: add waiting time for reference clock UPSTREAM: scsi: ufs: introduce common function to disable host TX LCC UPSTREAM: scsi: ufs: ufs-mediatek: fix TX LCC disabling timing UPSTREAM: scsi: ufs: ufs-mediatek: gate ref-clk during Auto-Hibern8 UPSTREAM: scsi: ufs: fix Auto-Hibern8 error detection UPSTREAM: scsi: ufs: ufs-mediatek: support linkoff state during suspend UPSTREAM: scsi: ufs: ufs-mediatek: ensure UniPro is not powered down before linkup UPSTREAM: scsi: ufs: Move ufshcd_get_max_pwr_mode() to ufshcd_device_params_init() BACKPORT: scsi: ufs: Split ufshcd_probe_hba() based on its called flow FROMGIT: driver core: Reevaluate dev->links.need_for_probe as suppliers are added FROMGIT: driver core: Call sync_state() even if supplier has no consumers ANDROID: cpufreq: times: Remove per-UID time in state tracking Revert "ANDROID: proc: Add /proc/uid directory" Revert "ANDROID: cpufreq: Add time_in_state to /proc/uid directories" ANDROID: cpufreq: times: Remove /proc/uid_concurrent_{active,policy}_time ANDROID: drm: Add support for DP 1.4 Compliance edid corruption test Revert "ANDROID: drm: Add support for DP 1.4 Compliance edid corruption test" ANDROID: staging: ion: Add an in-kernel interface to request heap info. FROMLIST: lib: test_stackinit.c: XFAIL switch variable init tests UPSTREAM: scsi: ufs: Abort gating if clock on request is pending UPSTREAM: scsi: ufs: Fix irq return code UPSTREAM: scsi: ufs: Fix register dump caused sleep in atomic context UPSTREAM: scsi: ufs-qcom: Add reset control support for host controller UPSTREAM: scsi: ufs: Add device reset in link recovery path FROMGIT: scsi: ufs-qcom: Delay specific time before gate ref clk BACKPORT: FROMGIT: scsi: ufs: Add dev ref clock gating wait time support Revert "FROMLIST: scsi: ufs: Add dev ref clock gating wait time support" FROMGIT: scsi: ufs-qcom: Adjust bus bandwidth voting and unvoting Revert "FROMLIST: scsi: ufs-qcom: Adjust bus bandwidth voting and unvoting" ANDROID: CC_FLAGS_CFI add -fno-sanitize-blacklist Conflicts: Documentation/devicetree/bindings Documentation/devicetree/bindings/power/supply/battery.txt Documentation/devicetree/bindings/power/supply/sc27xx-fg.txt drivers/dma-buf/dma-buf.c drivers/interconnect/core.c drivers/interconnect/internal.h drivers/scsi/ufs/ufs-qcom.c drivers/scsi/ufs/ufs-qcom.h drivers/scsi/ufs/ufshcd.h drivers/thermal/Makefile drivers/usb/dwc3/gadget.c drivers/usb/gadget/composite.c drivers/usb/gadget/function/f_fs.c scripts/gen_autoksyms.sh Change-Id: Ic3227858328ceef3f34273428d1c4f81b78757b2 Signed-off-by: Blagovest Kolenichev <bkolenichev@codeaurora.org>
512 lines
16 KiB
C
512 lines
16 KiB
C
/* SPDX-License-Identifier: GPL-2.0-only */
|
|
/*
|
|
* Universal power supply monitor class
|
|
*
|
|
* Copyright © 2007 Anton Vorontsov <cbou@mail.ru>
|
|
* Copyright © 2004 Szabolcs Gyurko
|
|
* Copyright © 2003 Ian Molton <spyro@f2s.com>
|
|
*
|
|
* Modified: 2004, Oct Szabolcs Gyurko
|
|
*/
|
|
|
|
#ifndef __LINUX_POWER_SUPPLY_H__
|
|
#define __LINUX_POWER_SUPPLY_H__
|
|
|
|
#include <linux/device.h>
|
|
#include <linux/workqueue.h>
|
|
#include <linux/leds.h>
|
|
#include <linux/spinlock.h>
|
|
#include <linux/notifier.h>
|
|
|
|
/*
|
|
* All voltages, currents, charges, energies, time and temperatures in uV,
|
|
* µA, µAh, µWh, seconds and tenths of degree Celsius unless otherwise
|
|
* stated. It's driver's job to convert its raw values to units in which
|
|
* this class operates.
|
|
*/
|
|
|
|
/*
|
|
* For systems where the charger determines the maximum battery capacity
|
|
* the min and max fields should be used to present these values to user
|
|
* space. Unused/unknown fields will not appear in sysfs.
|
|
*/
|
|
|
|
enum {
|
|
POWER_SUPPLY_STATUS_UNKNOWN = 0,
|
|
POWER_SUPPLY_STATUS_CHARGING,
|
|
POWER_SUPPLY_STATUS_DISCHARGING,
|
|
POWER_SUPPLY_STATUS_NOT_CHARGING,
|
|
POWER_SUPPLY_STATUS_FULL,
|
|
};
|
|
|
|
/* What algorithm is the charger using? */
|
|
enum {
|
|
POWER_SUPPLY_CHARGE_TYPE_UNKNOWN = 0,
|
|
POWER_SUPPLY_CHARGE_TYPE_NONE,
|
|
POWER_SUPPLY_CHARGE_TYPE_TRICKLE, /* slow speed */
|
|
POWER_SUPPLY_CHARGE_TYPE_FAST, /* fast speed */
|
|
POWER_SUPPLY_CHARGE_TYPE_STANDARD, /* normal speed */
|
|
POWER_SUPPLY_CHARGE_TYPE_ADAPTIVE, /* dynamically adjusted speed */
|
|
POWER_SUPPLY_CHARGE_TYPE_CUSTOM, /* use CHARGE_CONTROL_* props */
|
|
};
|
|
|
|
enum {
|
|
POWER_SUPPLY_HEALTH_UNKNOWN = 0,
|
|
POWER_SUPPLY_HEALTH_GOOD,
|
|
POWER_SUPPLY_HEALTH_OVERHEAT,
|
|
POWER_SUPPLY_HEALTH_DEAD,
|
|
POWER_SUPPLY_HEALTH_OVERVOLTAGE,
|
|
POWER_SUPPLY_HEALTH_UNSPEC_FAILURE,
|
|
POWER_SUPPLY_HEALTH_COLD,
|
|
POWER_SUPPLY_HEALTH_WATCHDOG_TIMER_EXPIRE,
|
|
POWER_SUPPLY_HEALTH_SAFETY_TIMER_EXPIRE,
|
|
POWER_SUPPLY_HEALTH_OVERCURRENT,
|
|
POWER_SUPPLY_HEALTH_WARM,
|
|
POWER_SUPPLY_HEALTH_COOL,
|
|
POWER_SUPPLY_HEALTH_HOT,
|
|
};
|
|
|
|
enum {
|
|
POWER_SUPPLY_TECHNOLOGY_UNKNOWN = 0,
|
|
POWER_SUPPLY_TECHNOLOGY_NiMH,
|
|
POWER_SUPPLY_TECHNOLOGY_LION,
|
|
POWER_SUPPLY_TECHNOLOGY_LIPO,
|
|
POWER_SUPPLY_TECHNOLOGY_LiFe,
|
|
POWER_SUPPLY_TECHNOLOGY_NiCd,
|
|
POWER_SUPPLY_TECHNOLOGY_LiMn,
|
|
};
|
|
|
|
enum {
|
|
POWER_SUPPLY_CAPACITY_LEVEL_UNKNOWN = 0,
|
|
POWER_SUPPLY_CAPACITY_LEVEL_CRITICAL,
|
|
POWER_SUPPLY_CAPACITY_LEVEL_LOW,
|
|
POWER_SUPPLY_CAPACITY_LEVEL_NORMAL,
|
|
POWER_SUPPLY_CAPACITY_LEVEL_HIGH,
|
|
POWER_SUPPLY_CAPACITY_LEVEL_FULL,
|
|
};
|
|
|
|
enum {
|
|
POWER_SUPPLY_SCOPE_UNKNOWN = 0,
|
|
POWER_SUPPLY_SCOPE_SYSTEM,
|
|
POWER_SUPPLY_SCOPE_DEVICE,
|
|
};
|
|
|
|
enum power_supply_property {
|
|
/* Properties of type `int' */
|
|
POWER_SUPPLY_PROP_STATUS = 0,
|
|
POWER_SUPPLY_PROP_CHARGE_TYPE,
|
|
POWER_SUPPLY_PROP_HEALTH,
|
|
POWER_SUPPLY_PROP_PRESENT,
|
|
POWER_SUPPLY_PROP_ONLINE,
|
|
POWER_SUPPLY_PROP_AUTHENTIC,
|
|
POWER_SUPPLY_PROP_TECHNOLOGY,
|
|
POWER_SUPPLY_PROP_CYCLE_COUNT,
|
|
POWER_SUPPLY_PROP_VOLTAGE_MAX,
|
|
POWER_SUPPLY_PROP_VOLTAGE_MIN,
|
|
POWER_SUPPLY_PROP_VOLTAGE_MAX_DESIGN,
|
|
POWER_SUPPLY_PROP_VOLTAGE_MIN_DESIGN,
|
|
POWER_SUPPLY_PROP_VOLTAGE_NOW,
|
|
POWER_SUPPLY_PROP_VOLTAGE_AVG,
|
|
POWER_SUPPLY_PROP_VOLTAGE_OCV,
|
|
POWER_SUPPLY_PROP_VOLTAGE_BOOT,
|
|
POWER_SUPPLY_PROP_CURRENT_MAX,
|
|
POWER_SUPPLY_PROP_CURRENT_NOW,
|
|
POWER_SUPPLY_PROP_CURRENT_AVG,
|
|
POWER_SUPPLY_PROP_CURRENT_BOOT,
|
|
POWER_SUPPLY_PROP_POWER_NOW,
|
|
POWER_SUPPLY_PROP_POWER_AVG,
|
|
POWER_SUPPLY_PROP_CHARGE_FULL_DESIGN,
|
|
POWER_SUPPLY_PROP_CHARGE_EMPTY_DESIGN,
|
|
POWER_SUPPLY_PROP_CHARGE_FULL,
|
|
POWER_SUPPLY_PROP_CHARGE_EMPTY,
|
|
POWER_SUPPLY_PROP_CHARGE_NOW,
|
|
POWER_SUPPLY_PROP_CHARGE_AVG,
|
|
POWER_SUPPLY_PROP_CHARGE_COUNTER,
|
|
POWER_SUPPLY_PROP_CONSTANT_CHARGE_CURRENT,
|
|
POWER_SUPPLY_PROP_CONSTANT_CHARGE_CURRENT_MAX,
|
|
POWER_SUPPLY_PROP_CONSTANT_CHARGE_VOLTAGE,
|
|
POWER_SUPPLY_PROP_CONSTANT_CHARGE_VOLTAGE_MAX,
|
|
POWER_SUPPLY_PROP_CHARGE_CONTROL_LIMIT,
|
|
POWER_SUPPLY_PROP_CHARGE_CONTROL_LIMIT_MAX,
|
|
POWER_SUPPLY_PROP_CHARGE_CONTROL_START_THRESHOLD, /* in percents! */
|
|
POWER_SUPPLY_PROP_CHARGE_CONTROL_END_THRESHOLD, /* in percents! */
|
|
POWER_SUPPLY_PROP_INPUT_CURRENT_LIMIT,
|
|
POWER_SUPPLY_PROP_INPUT_VOLTAGE_LIMIT,
|
|
POWER_SUPPLY_PROP_INPUT_POWER_LIMIT,
|
|
POWER_SUPPLY_PROP_ENERGY_FULL_DESIGN,
|
|
POWER_SUPPLY_PROP_ENERGY_EMPTY_DESIGN,
|
|
POWER_SUPPLY_PROP_ENERGY_FULL,
|
|
POWER_SUPPLY_PROP_ENERGY_EMPTY,
|
|
POWER_SUPPLY_PROP_ENERGY_NOW,
|
|
POWER_SUPPLY_PROP_ENERGY_AVG,
|
|
POWER_SUPPLY_PROP_CAPACITY, /* in percents! */
|
|
POWER_SUPPLY_PROP_CAPACITY_ALERT_MIN, /* in percents! */
|
|
POWER_SUPPLY_PROP_CAPACITY_ALERT_MAX, /* in percents! */
|
|
POWER_SUPPLY_PROP_CAPACITY_LEVEL,
|
|
POWER_SUPPLY_PROP_TEMP,
|
|
POWER_SUPPLY_PROP_TEMP_MAX,
|
|
POWER_SUPPLY_PROP_TEMP_MIN,
|
|
POWER_SUPPLY_PROP_TEMP_ALERT_MIN,
|
|
POWER_SUPPLY_PROP_TEMP_ALERT_MAX,
|
|
POWER_SUPPLY_PROP_TEMP_AMBIENT,
|
|
POWER_SUPPLY_PROP_TEMP_AMBIENT_ALERT_MIN,
|
|
POWER_SUPPLY_PROP_TEMP_AMBIENT_ALERT_MAX,
|
|
POWER_SUPPLY_PROP_TIME_TO_EMPTY_NOW,
|
|
POWER_SUPPLY_PROP_TIME_TO_EMPTY_AVG,
|
|
POWER_SUPPLY_PROP_TIME_TO_FULL_NOW,
|
|
POWER_SUPPLY_PROP_TIME_TO_FULL_AVG,
|
|
POWER_SUPPLY_PROP_TYPE, /* use power_supply.type instead */
|
|
POWER_SUPPLY_PROP_USB_TYPE,
|
|
POWER_SUPPLY_PROP_SCOPE,
|
|
POWER_SUPPLY_PROP_PRECHARGE_CURRENT,
|
|
POWER_SUPPLY_PROP_CHARGE_TERM_CURRENT,
|
|
POWER_SUPPLY_PROP_CALIBRATE,
|
|
/* Properties of type `const char *' */
|
|
POWER_SUPPLY_PROP_MODEL_NAME,
|
|
POWER_SUPPLY_PROP_MANUFACTURER,
|
|
POWER_SUPPLY_PROP_SERIAL_NUMBER,
|
|
};
|
|
|
|
enum power_supply_type {
|
|
POWER_SUPPLY_TYPE_UNKNOWN = 0,
|
|
POWER_SUPPLY_TYPE_BATTERY,
|
|
POWER_SUPPLY_TYPE_UPS,
|
|
POWER_SUPPLY_TYPE_MAINS,
|
|
POWER_SUPPLY_TYPE_USB, /* Standard Downstream Port */
|
|
POWER_SUPPLY_TYPE_USB_DCP, /* Dedicated Charging Port */
|
|
POWER_SUPPLY_TYPE_USB_CDP, /* Charging Downstream Port */
|
|
POWER_SUPPLY_TYPE_USB_ACA, /* Accessory Charger Adapters */
|
|
POWER_SUPPLY_TYPE_USB_TYPE_C, /* Type C Port */
|
|
POWER_SUPPLY_TYPE_USB_PD, /* Power Delivery Port */
|
|
POWER_SUPPLY_TYPE_USB_PD_DRP, /* PD Dual Role Port */
|
|
POWER_SUPPLY_TYPE_APPLE_BRICK_ID, /* Apple Charging Method */
|
|
};
|
|
|
|
enum power_supply_usb_type {
|
|
POWER_SUPPLY_USB_TYPE_UNKNOWN = 0,
|
|
POWER_SUPPLY_USB_TYPE_SDP, /* Standard Downstream Port */
|
|
POWER_SUPPLY_USB_TYPE_DCP, /* Dedicated Charging Port */
|
|
POWER_SUPPLY_USB_TYPE_CDP, /* Charging Downstream Port */
|
|
POWER_SUPPLY_USB_TYPE_ACA, /* Accessory Charger Adapters */
|
|
POWER_SUPPLY_USB_TYPE_C, /* Type C Port */
|
|
POWER_SUPPLY_USB_TYPE_PD, /* Power Delivery Port */
|
|
POWER_SUPPLY_USB_TYPE_PD_DRP, /* PD Dual Role Port */
|
|
POWER_SUPPLY_USB_TYPE_PD_PPS, /* PD Programmable Power Supply */
|
|
POWER_SUPPLY_USB_TYPE_APPLE_BRICK_ID, /* Apple Charging Method */
|
|
};
|
|
|
|
enum power_supply_notifier_events {
|
|
PSY_EVENT_PROP_CHANGED,
|
|
};
|
|
|
|
union power_supply_propval {
|
|
int intval;
|
|
const char *strval;
|
|
};
|
|
|
|
struct device_node;
|
|
struct power_supply;
|
|
|
|
/* Run-time specific power supply configuration */
|
|
struct power_supply_config {
|
|
struct device_node *of_node;
|
|
struct fwnode_handle *fwnode;
|
|
|
|
/* Driver private data */
|
|
void *drv_data;
|
|
|
|
/* Device specific sysfs attributes */
|
|
const struct attribute_group **attr_grp;
|
|
|
|
char **supplied_to;
|
|
size_t num_supplicants;
|
|
};
|
|
|
|
/* Description of power supply */
|
|
struct power_supply_desc {
|
|
const char *name;
|
|
enum power_supply_type type;
|
|
enum power_supply_usb_type *usb_types;
|
|
size_t num_usb_types;
|
|
enum power_supply_property *properties;
|
|
size_t num_properties;
|
|
|
|
/*
|
|
* Functions for drivers implementing power supply class.
|
|
* These shouldn't be called directly by other drivers for accessing
|
|
* this power supply. Instead use power_supply_*() functions (for
|
|
* example power_supply_get_property()).
|
|
*/
|
|
int (*get_property)(struct power_supply *psy,
|
|
enum power_supply_property psp,
|
|
union power_supply_propval *val);
|
|
int (*set_property)(struct power_supply *psy,
|
|
enum power_supply_property psp,
|
|
const union power_supply_propval *val);
|
|
/*
|
|
* property_is_writeable() will be called during registration
|
|
* of power supply. If this happens during device probe then it must
|
|
* not access internal data of device (because probe did not end).
|
|
*/
|
|
int (*property_is_writeable)(struct power_supply *psy,
|
|
enum power_supply_property psp);
|
|
void (*external_power_changed)(struct power_supply *psy);
|
|
void (*set_charged)(struct power_supply *psy);
|
|
|
|
/*
|
|
* Set if thermal zone should not be created for this power supply.
|
|
* For example for virtual supplies forwarding calls to actual
|
|
* sensors or other supplies.
|
|
*/
|
|
bool no_thermal;
|
|
/* For APM emulation, think legacy userspace. */
|
|
int use_for_apm;
|
|
};
|
|
|
|
struct power_supply {
|
|
const struct power_supply_desc *desc;
|
|
|
|
char **supplied_to;
|
|
size_t num_supplicants;
|
|
|
|
char **supplied_from;
|
|
size_t num_supplies;
|
|
struct device_node *of_node;
|
|
|
|
/* Driver private data */
|
|
void *drv_data;
|
|
|
|
/* private */
|
|
struct device dev;
|
|
struct work_struct changed_work;
|
|
struct delayed_work deferred_register_work;
|
|
spinlock_t changed_lock;
|
|
bool changed;
|
|
bool initialized;
|
|
bool removing;
|
|
atomic_t use_cnt;
|
|
#ifdef CONFIG_THERMAL
|
|
struct thermal_zone_device *tzd;
|
|
struct thermal_cooling_device *tcd;
|
|
#endif
|
|
|
|
#ifdef CONFIG_LEDS_TRIGGERS
|
|
struct led_trigger *charging_full_trig;
|
|
char *charging_full_trig_name;
|
|
struct led_trigger *charging_trig;
|
|
char *charging_trig_name;
|
|
struct led_trigger *full_trig;
|
|
char *full_trig_name;
|
|
struct led_trigger *online_trig;
|
|
char *online_trig_name;
|
|
struct led_trigger *charging_blink_full_solid_trig;
|
|
char *charging_blink_full_solid_trig_name;
|
|
#endif
|
|
};
|
|
|
|
/*
|
|
* This is recommended structure to specify static power supply parameters.
|
|
* Generic one, parametrizable for different power supplies. Power supply
|
|
* class itself does not use it, but that's what implementing most platform
|
|
* drivers, should try reuse for consistency.
|
|
*/
|
|
|
|
struct power_supply_info {
|
|
const char *name;
|
|
int technology;
|
|
int voltage_max_design;
|
|
int voltage_min_design;
|
|
int charge_full_design;
|
|
int charge_empty_design;
|
|
int energy_full_design;
|
|
int energy_empty_design;
|
|
int use_for_apm;
|
|
};
|
|
|
|
struct power_supply_battery_ocv_table {
|
|
int ocv; /* microVolts */
|
|
int capacity; /* percent */
|
|
};
|
|
|
|
struct power_supply_resistance_temp_table {
|
|
int temp; /* celsius */
|
|
int resistance; /* internal resistance percent */
|
|
};
|
|
|
|
#define POWER_SUPPLY_OCV_TEMP_MAX 20
|
|
|
|
/*
|
|
* This is the recommended struct to manage static battery parameters,
|
|
* populated by power_supply_get_battery_info(). Most platform drivers should
|
|
* use these for consistency.
|
|
* Its field names must correspond to elements in enum power_supply_property.
|
|
* The default field value is -EINVAL.
|
|
* Power supply class itself doesn't use this.
|
|
*/
|
|
|
|
struct power_supply_battery_info {
|
|
int energy_full_design_uwh; /* microWatt-hours */
|
|
int charge_full_design_uah; /* microAmp-hours */
|
|
int voltage_min_design_uv; /* microVolts */
|
|
int voltage_max_design_uv; /* microVolts */
|
|
int precharge_current_ua; /* microAmps */
|
|
int charge_term_current_ua; /* microAmps */
|
|
int constant_charge_current_max_ua; /* microAmps */
|
|
int constant_charge_voltage_max_uv; /* microVolts */
|
|
int factory_internal_resistance_uohm; /* microOhms */
|
|
int ocv_temp[POWER_SUPPLY_OCV_TEMP_MAX];/* celsius */
|
|
struct power_supply_battery_ocv_table *ocv_table[POWER_SUPPLY_OCV_TEMP_MAX];
|
|
int ocv_table_size[POWER_SUPPLY_OCV_TEMP_MAX];
|
|
struct power_supply_resistance_temp_table *resist_table;
|
|
int resist_table_size;
|
|
};
|
|
|
|
extern struct atomic_notifier_head power_supply_notifier;
|
|
extern int power_supply_reg_notifier(struct notifier_block *nb);
|
|
extern void power_supply_unreg_notifier(struct notifier_block *nb);
|
|
extern struct power_supply *power_supply_get_by_name(const char *name);
|
|
extern void power_supply_put(struct power_supply *psy);
|
|
#ifdef CONFIG_OF
|
|
extern struct power_supply *power_supply_get_by_phandle(struct device_node *np,
|
|
const char *property);
|
|
extern struct power_supply *devm_power_supply_get_by_phandle(
|
|
struct device *dev, const char *property);
|
|
#else /* !CONFIG_OF */
|
|
static inline struct power_supply *
|
|
power_supply_get_by_phandle(struct device_node *np, const char *property)
|
|
{ return NULL; }
|
|
static inline struct power_supply *
|
|
devm_power_supply_get_by_phandle(struct device *dev, const char *property)
|
|
{ return NULL; }
|
|
#endif /* CONFIG_OF */
|
|
|
|
extern int power_supply_get_battery_info(struct power_supply *psy,
|
|
struct power_supply_battery_info *info);
|
|
extern void power_supply_put_battery_info(struct power_supply *psy,
|
|
struct power_supply_battery_info *info);
|
|
extern int power_supply_ocv2cap_simple(struct power_supply_battery_ocv_table *table,
|
|
int table_len, int ocv);
|
|
extern struct power_supply_battery_ocv_table *
|
|
power_supply_find_ocv2cap_table(struct power_supply_battery_info *info,
|
|
int temp, int *table_len);
|
|
extern int power_supply_batinfo_ocv2cap(struct power_supply_battery_info *info,
|
|
int ocv, int temp);
|
|
extern int
|
|
power_supply_temp2resist_simple(struct power_supply_resistance_temp_table *table,
|
|
int table_len, int temp);
|
|
extern void power_supply_changed(struct power_supply *psy);
|
|
extern int power_supply_am_i_supplied(struct power_supply *psy);
|
|
extern int power_supply_set_input_current_limit_from_supplier(
|
|
struct power_supply *psy);
|
|
extern int power_supply_set_battery_charged(struct power_supply *psy);
|
|
|
|
#ifdef CONFIG_POWER_SUPPLY
|
|
extern int power_supply_is_system_supplied(void);
|
|
#else
|
|
static inline int power_supply_is_system_supplied(void) { return -ENOSYS; }
|
|
#endif
|
|
|
|
extern int power_supply_get_property(struct power_supply *psy,
|
|
enum power_supply_property psp,
|
|
union power_supply_propval *val);
|
|
extern int power_supply_set_property(struct power_supply *psy,
|
|
enum power_supply_property psp,
|
|
const union power_supply_propval *val);
|
|
extern int power_supply_property_is_writeable(struct power_supply *psy,
|
|
enum power_supply_property psp);
|
|
extern void power_supply_external_power_changed(struct power_supply *psy);
|
|
|
|
extern struct power_supply *__must_check
|
|
power_supply_register(struct device *parent,
|
|
const struct power_supply_desc *desc,
|
|
const struct power_supply_config *cfg);
|
|
extern struct power_supply *__must_check
|
|
power_supply_register_no_ws(struct device *parent,
|
|
const struct power_supply_desc *desc,
|
|
const struct power_supply_config *cfg);
|
|
extern struct power_supply *__must_check
|
|
devm_power_supply_register(struct device *parent,
|
|
const struct power_supply_desc *desc,
|
|
const struct power_supply_config *cfg);
|
|
extern struct power_supply *__must_check
|
|
devm_power_supply_register_no_ws(struct device *parent,
|
|
const struct power_supply_desc *desc,
|
|
const struct power_supply_config *cfg);
|
|
extern void power_supply_unregister(struct power_supply *psy);
|
|
extern int power_supply_powers(struct power_supply *psy, struct device *dev);
|
|
|
|
#define to_power_supply(device) container_of(device, struct power_supply, dev)
|
|
|
|
extern void *power_supply_get_drvdata(struct power_supply *psy);
|
|
/* For APM emulation, think legacy userspace. */
|
|
extern struct class *power_supply_class;
|
|
|
|
static inline bool power_supply_is_amp_property(enum power_supply_property psp)
|
|
{
|
|
switch (psp) {
|
|
case POWER_SUPPLY_PROP_CHARGE_FULL_DESIGN:
|
|
case POWER_SUPPLY_PROP_CHARGE_EMPTY_DESIGN:
|
|
case POWER_SUPPLY_PROP_CHARGE_FULL:
|
|
case POWER_SUPPLY_PROP_CHARGE_EMPTY:
|
|
case POWER_SUPPLY_PROP_CHARGE_NOW:
|
|
case POWER_SUPPLY_PROP_CHARGE_AVG:
|
|
case POWER_SUPPLY_PROP_CHARGE_COUNTER:
|
|
case POWER_SUPPLY_PROP_PRECHARGE_CURRENT:
|
|
case POWER_SUPPLY_PROP_CHARGE_TERM_CURRENT:
|
|
case POWER_SUPPLY_PROP_CONSTANT_CHARGE_CURRENT:
|
|
case POWER_SUPPLY_PROP_CONSTANT_CHARGE_CURRENT_MAX:
|
|
case POWER_SUPPLY_PROP_CURRENT_MAX:
|
|
case POWER_SUPPLY_PROP_CURRENT_NOW:
|
|
case POWER_SUPPLY_PROP_CURRENT_AVG:
|
|
case POWER_SUPPLY_PROP_CURRENT_BOOT:
|
|
return 1;
|
|
default:
|
|
break;
|
|
}
|
|
|
|
return 0;
|
|
}
|
|
|
|
static inline bool power_supply_is_watt_property(enum power_supply_property psp)
|
|
{
|
|
switch (psp) {
|
|
case POWER_SUPPLY_PROP_ENERGY_FULL_DESIGN:
|
|
case POWER_SUPPLY_PROP_ENERGY_EMPTY_DESIGN:
|
|
case POWER_SUPPLY_PROP_ENERGY_FULL:
|
|
case POWER_SUPPLY_PROP_ENERGY_EMPTY:
|
|
case POWER_SUPPLY_PROP_ENERGY_NOW:
|
|
case POWER_SUPPLY_PROP_ENERGY_AVG:
|
|
case POWER_SUPPLY_PROP_VOLTAGE_MAX:
|
|
case POWER_SUPPLY_PROP_VOLTAGE_MIN:
|
|
case POWER_SUPPLY_PROP_VOLTAGE_MAX_DESIGN:
|
|
case POWER_SUPPLY_PROP_VOLTAGE_MIN_DESIGN:
|
|
case POWER_SUPPLY_PROP_VOLTAGE_NOW:
|
|
case POWER_SUPPLY_PROP_VOLTAGE_AVG:
|
|
case POWER_SUPPLY_PROP_VOLTAGE_OCV:
|
|
case POWER_SUPPLY_PROP_VOLTAGE_BOOT:
|
|
case POWER_SUPPLY_PROP_CONSTANT_CHARGE_VOLTAGE:
|
|
case POWER_SUPPLY_PROP_CONSTANT_CHARGE_VOLTAGE_MAX:
|
|
case POWER_SUPPLY_PROP_POWER_NOW:
|
|
return 1;
|
|
default:
|
|
break;
|
|
}
|
|
|
|
return 0;
|
|
}
|
|
|
|
#ifdef CONFIG_POWER_SUPPLY_HWMON
|
|
int power_supply_add_hwmon_sysfs(struct power_supply *psy);
|
|
void power_supply_remove_hwmon_sysfs(struct power_supply *psy);
|
|
#else
|
|
static inline int power_supply_add_hwmon_sysfs(struct power_supply *psy)
|
|
{
|
|
return 0;
|
|
}
|
|
|
|
static inline
|
|
void power_supply_remove_hwmon_sysfs(struct power_supply *psy) {}
|
|
#endif
|
|
|
|
#endif /* __LINUX_POWER_SUPPLY_H__ */
|