/linux/drivers/power/supply/ |
H A D | qcom_smbb.c | 1 // SPDX-License-Identifier: GPL-2.0-only 4 * This driver is for the multi-block Switch-Mode Battery Charger and Boost 6 * integrated, single-cell lithium-ion battery charger. 8 * Sub-components: 9 * - Charger core 10 * - Buck 11 * - DC charge-path 12 * - USB charge-path 13 * - Battery interface 14 * - Boost (not implemented) [all …]
|
H A D | pm8916_lbc.c | 1 // SPDX-License-Identifier: GPL-2.0-only 15 #include <linux/extcon-provider.h> 63 unsigned int reg[4]; 65 unsigned int charge_voltage_max; 66 unsigned int charge_voltage_safe; 67 unsigned int charge_current_max; 68 unsigned int charge_current_safe; 71 static const unsigned int pm8916_lbc_charger_cable[] = { 83 static int pm8916_lbc_charger_configure(struct pm8916_lbc_charger *chg) in pm8916_lbc_charger_configure() argument 85 int ret = 0; in pm8916_lbc_charger_configure() [all …]
|
H A D | max77693_charger.c | 1 // SPDX-License-Identifier: GPL-2.0+ 3 // max77693_charger.c - Battery charger driver for the Maxim 77693 13 #include <linux/mfd/max77693-common.h> 14 #include <linux/mfd/max77693-private.h> 16 #define MAX77693_CHARGER_NAME "max77693-charger" 32 static int max77693_get_charger_state(struct regmap *regmap, int *val) in max77693_get_charger_state() 34 int ret; in max77693_get_charger_state() 35 unsigned int data; in max77693_get_charger_state() 73 static int max77693_get_charge_type(struct regmap *regmap, int *val) in max77693_get_charge_type() 75 int ret; in max77693_get_charge_type() [all …]
|
H A D | max14577_charger.c | 1 // SPDX-License-Identifier: GPL-2.0+ 3 // max14577_charger.c - Battery charger driver for the Maxim 14577/77836 11 #include <linux/mfd/max14577-private.h> 47 static int max14577_get_charger_state(struct max14577_charger *chg, int *val) in max14577_get_charger_state() argument 49 struct regmap *rmap = chg->max14577->regmap; in max14577_get_charger_state() 50 int ret; in max14577_get_charger_state() 55 * - CHGCTRL2/MBCHOSTEN == 1 in max14577_get_charger_state() 56 * - STATUS2/CGMBC == 1 in max14577_get_charger_state() 59 * - handle FULL after Top-off timer (EOC register may be off in max14577_get_charger_state() 61 * - handle properly dead-battery charging (respect timer) in max14577_get_charger_state() [all …]
|
H A D | max77976_charger.c | 1 // SPDX-License-Identifier: GPL-2.0+ 3 * max77976_charger.c - Driver for the Maxim MAX77976 battery charger 14 #define MAX77976_DRIVER_NAME "max77976-charger" 20 /* -------------------------------------------------------------------------- 110 /* -------------------------------------------------------------------------- 120 /* -------------------------------------------------------------------------- 124 static int max77976_get_status(struct max77976 *chg, int *val) in max77976_get_status() argument 126 unsigned int regval; in max77976_get_status() 127 int err; in max77976_get_status() 129 err = regmap_field_read(chg->rfield[CHG_DTLS], ®val); in max77976_get_status() [all …]
|
H A D | max77650-charger.c | 1 // SPDX-License-Identifier: GPL-2.0 6 // Battery charger driver for MAXIM 77650/77651 charger/power-supply. 28 /* Charger is in fast-charge constant current mode. */ 30 /* Charger is in JEITA modified fast-charge constant-current mode. */ 32 /* Charger is in fast-charge constant-voltage mode. */ 34 /* Charger is in JEITA modified fast-charge constant-voltage mode. */ 36 /* Charger is in top-off mode. */ 38 /* Charger is in JEITA modified top-off mode. */ 46 /* Charger is suspended due to a fast-charge timer fault. */ 80 static const unsigned int max77650_charger_vchgin_min_table[] = { [all …]
|
H A D | rt5033_charger.c | 1 // SPDX-License-Identifier: GPL-2.0-only 9 #include <linux/devm-helpers.h> 18 #include <linux/mfd/rt5033-private.h> 21 unsigned int pre_uamp; 22 unsigned int pre_uvolt; 23 unsigned int const_uvolt; 24 unsigned int eoc_uamp; 25 unsigned int fast_uamp; 32 struct rt5033_charger_data chg; member 43 static int rt5033_get_charger_state(struct rt5033_charger *charger) in rt5033_get_charger_state() [all …]
|
H A D | max8903_charger.c | 1 // SPDX-License-Identifier: GPL-2.0-or-later 3 * max8903_charger.c - Maxim 8903 USB/Adapter Charger Driver 23 * chg, flt, dcm and usus are optional. 30 struct gpio_desc *chg; /* Charger status output */ member 32 struct gpio_desc *dcm; /* Current-Limit Mode input (1: DC, 2: USB) */ 45 static int max8903_get_property(struct power_supply *psy, in max8903_get_property() 53 val->intval = POWER_SUPPLY_STATUS_UNKNOWN; in max8903_get_property() 54 if (data->chg) { in max8903_get_property() 55 if (gpiod_get_value(data->chg)) in max8903_get_property() 56 /* CHG asserted */ in max8903_get_property() [all …]
|
H A D | twl4030_madc_battery.c | 1 // SPDX-License-Identifier: GPL-2.0-only 45 static int madc_read(struct iio_channel *channel) in madc_read() 47 int val, err; in madc_read() 55 static int twl4030_madc_bat_get_charging_status(struct twl4030_madc_battery *bt) in twl4030_madc_bat_get_charging_status() 57 return (madc_read(bt->channel_ichg) > 0) ? 1 : 0; in twl4030_madc_bat_get_charging_status() 60 static int twl4030_madc_bat_get_voltage(struct twl4030_madc_battery *bt) in twl4030_madc_bat_get_voltage() 62 return madc_read(bt->channel_vbat); in twl4030_madc_bat_get_voltage() 65 static int twl4030_madc_bat_get_current(struct twl4030_madc_battery *bt) in twl4030_madc_bat_get_current() 67 return madc_read(bt->channel_ichg) * 1000; in twl4030_madc_bat_get_current() 70 static int twl4030_madc_bat_get_temp(struct twl4030_madc_battery *bt) in twl4030_madc_bat_get_temp() [all …]
|
H A D | ab8500_bmdata.c | 1 // SPDX-License-Identifier: GPL-2.0 6 #include "ab8500-bm.h" 57 { .temp = -10, .resistance = 158 /* 445 mOhm */ }, 58 { .temp = -20, .resistance = 198 /* 595 mOhm */ }, 113 static const struct ab8500_bm_charger_parameters chg = { variable 136 .chg_params = &chg, 140 int ab8500_bm_of_probe(struct power_supply *psy, in ab8500_bm_of_probe() 144 struct device *dev = &psy->dev; in ab8500_bm_of_probe() 145 int ret; in ab8500_bm_of_probe() 147 ret = power_supply_get_battery_info(psy, &bm->bi); in ab8500_bm_of_probe() [all …]
|
H A D | mt6360_charger.c | 1 // SPDX-License-Identifier: GPL-2.0 6 #include <linux/devm-helpers.h> 135 int psy_usb_type; 157 static int mt6360_get_chrdet_ext_stat(struct mt6360_chg_info *mci, in mt6360_get_chrdet_ext_stat() 160 int ret; in mt6360_get_chrdet_ext_stat() 161 unsigned int regval; in mt6360_get_chrdet_ext_stat() 163 ret = regmap_read(mci->regmap, MT6360_PMU_FOD_STAT, ®val); in mt6360_get_chrdet_ext_stat() 170 static int mt6360_charger_get_online(struct mt6360_chg_info *mci, in mt6360_charger_get_online() 173 int ret; in mt6360_charger_get_online() 179 val->intval = pwr_rdy ? true : false; in mt6360_charger_get_online() [all …]
|
/linux/tools/gpio/ |
H A D | gpio-watch.c | 1 // SPDX-License-Identifier: GPL-2.0-only 3 * gpio-watch - monitor unrequested lines for property changes using the 23 int main(int argc, char **argv) in main() 25 struct gpio_v2_line_info_changed chg; in main() local 28 int fd, i, j, ret; in main() 41 for (i = 0, j = 2; i < argc - 2; i++, j++) { in main() 64 memset(&chg, 0, sizeof(chg)); in main() 65 rd = read(pfd.fd, &chg, sizeof(chg)); in main() 66 if (rd < 0 || rd != sizeof(chg)) { in main() 67 if (rd != sizeof(chg)) in main() [all …]
|
/linux/drivers/net/fddi/skfp/ |
H A D | ess.c | 1 // SPDX-License-Identifier: GPL-2.0-or-later 27 * FDDI sub-system supporting the SBA application. 50 ------------------------------------------------------------- 52 ------------------------------------------------------------- 66 ------------------------------------------------------------- 68 ------------------------------------------------------------- 73 ------------------------------------------------------------- 75 ------------------------------------------------------------- 79 int sba_cmd); 85 ------------------------------------------------------------- [all …]
|
/linux/fs/xfs/ |
H A D | xfs_trans.h | 1 // SPDX-License-Identifier: GPL-2.0 3 * Copyright (c) 2000-2002,2005 Silicon Graphics, Inc. 34 xfs_lsn_t li_lsn; /* last on-disk lsn */ 73 void (*iop_size)(struct xfs_log_item *, int *, int *); 76 void (*iop_unpin)(struct xfs_log_item *, int remove); 78 int (*iop_precommit)(struct xfs_trans *tp, struct xfs_log_item *lip); 101 return lip->li_ops->flags & XFS_ITEM_INTENT; in xlog_item_is_intent() 107 return lip->li_ops->flags & XFS_ITEM_INTENT_DONE; in xlog_item_is_intent_done() 111 int type, const struct xfs_item_ops *ops); 125 unsigned int t_magic; /* magic number */ [all …]
|
/linux/drivers/net/ethernet/intel/ice/ |
H A D | ice_flex_pipe.c | 1 // SPDX-License-Identifier: GPL-2.0 77 * ice_sect_id - returns section ID 90 * ice_hw_ptype_ena - check if the PTYPE is enabled or not 97 test_bit(ptype, hw->hw_ptype); in ice_hw_ptype_ena() 112 * ice_gen_key_word - generate 16-bits of a key/mask word 120 * This function generates 16-bits from a 8-bit value, an 8-bit don't care mask 121 * and an 8-bit never match mask. The 16-bits of output are divided into 8 bits 133 * ------------------------------ 136 static int 145 return -EIO; in ice_gen_key_word() [all …]
|
/linux/drivers/usb/gadget/udc/aspeed-vhub/ |
H A D | hub.c | 1 // SPDX-License-Identifier: GPL-2.0+ 3 * aspeed-vhub -- Driver for Aspeed SoC "vHub" USB gadget 5 * hub.c - virtual hub handling 25 #include <linux/dma-mapping.h> 37 * - We may need to indicate TT support 38 * - We may need a device qualifier descriptor 40 * - Make vid/did overridable 41 * - make it look like usb1 if usb1 mode forced 144 * These strings converted to UTF-16 must be smaller than 168 static int ast_vhub_hub_dev_status(struct ast_vhub_ep *ep, in ast_vhub_hub_dev_status() [all …]
|
/linux/Documentation/devicetree/bindings/gpio/ |
H A D | gpio-pca95xx.yaml | 1 # SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause) 3 --- 4 $id: http://devicetree.org/schemas/gpio/gpio-pca95xx.yaml# 5 $schema: http://devicetree.org/meta-schemas/core.yaml# 10 - Krzysztof Kozlowski <krzk@kernel.org> 19 - items: 20 - const: diodes,pi4ioe5v6534q 21 - const: nxp,pcal6534 22 - items: 23 - enum: [all …]
|
/linux/drivers/clk/mediatek/ |
H A D | clk-pll.c | 1 // SPDX-License-Identifier: GPL-2.0-only 7 #include <linux/clk-provider.h> 16 #include "clk-pll.h" 33 int mtk_pll_is_prepared(struct clk_hw *hw) in mtk_pll_is_prepared() 37 return (readl(pll->en_addr) & BIT(pll->data->pll_en_bit)) != 0; in mtk_pll_is_prepared() 41 u32 pcw, int postdiv) in __mtk_pll_recalc_rate() 43 int pcwbits = pll->data->pcwbits; in __mtk_pll_recalc_rate() 44 int pcwfbits = 0; in __mtk_pll_recalc_rate() 45 int ibits; in __mtk_pll_recalc_rate() 50 ibits = pll->data->pcwibits ? pll->data->pcwibits : INTEGER_BITS; in __mtk_pll_recalc_rate() [all …]
|
/linux/drivers/gpu/drm/msm/hdmi/ |
H A D | hdmi_hpd.c | 1 // SPDX-License-Identifier: GPL-2.0-only 16 unsigned int val; in msm_hdmi_phy_reset() 65 const struct hdmi_platform_config *config = hdmi->config; in enable_hpd_clocks() 66 struct device *dev = &hdmi->pdev->dev; in enable_hpd_clocks() 67 int i, ret; in enable_hpd_clocks() 70 for (i = 0; i < config->hpd_clk_cnt; i++) { in enable_hpd_clocks() 71 if (config->hpd_freq && config->hpd_freq[i]) { in enable_hpd_clocks() 72 ret = clk_set_rate(hdmi->hpd_clks[i], in enable_hpd_clocks() 73 config->hpd_freq[i]); in enable_hpd_clocks() 77 config->hpd_clk_names[i], ret); in enable_hpd_clocks() [all …]
|
/linux/mm/ |
H A D | hugetlb.c | 1 // SPDX-License-Identifier: GPL-2.0-only 52 int hugetlb_max_hstate __read_mostly; 53 unsigned int default_hstate_idx; 69 static unsigned int default_hugepages_in_node[MAX_NUMNODES] __initdata; 81 static int num_fault_mutexes __ro_after_init; 85 static int hugetlb_acct_memory(struct hstate *h, long delta); 96 int nid = folio_nid(folio); in hugetlb_free_folio() 106 if (spool->count) in subpool_is_free() 108 if (spool->max_hpages != -1) in subpool_is_free() 109 return spool->used_hpages == 0; in subpool_is_free() [all …]
|
/linux/drivers/mfd/ |
H A D | rohm-bd71828.c | 1 // SPDX-License-Identifier: GPL-2.0-only 14 #include <linux/mfd/rohm-bd71815.h> 15 #include <linux/mfd/rohm-bd71828.h> 16 #include <linux/mfd/rohm-generic.h> 24 .gpio = -1, 31 .name = "bd71828-pwrkey", 35 DEFINE_RES_IRQ_NAMED(BD71815_INT_RTC0, "bd71815-rtc-alm-0"), 36 DEFINE_RES_IRQ_NAMED(BD71815_INT_RTC1, "bd71815-rtc-alm-1"), 37 DEFINE_RES_IRQ_NAMED(BD71815_INT_RTC2, "bd71815-rtc-alm-2"), 41 DEFINE_RES_IRQ_NAMED(BD71828_INT_RTC0, "bd71828-rtc-alm-0"), [all …]
|
H A D | max8907.c | 1 // SPDX-License-Identifier: GPL-2.0-only 3 * max8907.c - mfd driver for MAX8907 5 * Copyright (C) 2010 Gyungoh Yoo <jack.yoo@maxim-ic.com> 6 * Copyright (C) 2010-2012, NVIDIA CORPORATION. All rights reserved. 22 { .name = "max8907-regulator", }, 23 { .name = "max8907-rtc", }, 26 static bool max8907_gen_is_volatile_reg(struct device *dev, unsigned int reg) in max8907_gen_is_volatile_reg() 41 static bool max8907_gen_is_precious_reg(struct device *dev, unsigned int reg) in max8907_gen_is_precious_reg() 54 static bool max8907_gen_is_writeable_reg(struct device *dev, unsigned int reg) in max8907_gen_is_writeable_reg() 69 static bool max8907_rtc_is_volatile_reg(struct device *dev, unsigned int reg) in max8907_rtc_is_volatile_reg() [all …]
|
/linux/drivers/extcon/ |
H A D | extcon-sm5502.c | 1 // SPDX-License-Identifier: GPL-2.0-or-later 3 * extcon-sm5502.c - Silicon Mitus SM5502 extcon drvier to support USB switches 18 #include <linux/extcon-provider.h> 20 #include "extcon-sm5502.h" 25 unsigned int irq; 27 unsigned int virq; 32 unsigned int val; 45 int irq; 63 unsigned int num_muic_irqs; 67 unsigned int num_reg_data; [all …]
|
/linux/arch/arm/boot/dts/rockchip/ |
H A D | rk3188-bqedison2qc.dts | 1 // SPDX-License-Identifier: (GPL-2.0+ OR MIT) 7 /dts-v1/; 8 #include <dt-bindings/i2c/i2c.h> 9 #include <dt-bindings/input/input.h> 10 #include <dt-bindings/interrupt-controller/irq.h> 14 model = "BQ Edison2 Quad-Core"; 15 compatible = "mundoreader,bq-edison2qc", "rockchip,rk3188"; 29 compatible = "pwm-backlight"; 30 power-supply = <&vsys>; 34 gpio-keys { [all …]
|
/linux/tools/perf/scripts/python/ |
H A D | parallel-perf.py | 2 # SPDX-License-Identifier: GPL-2.0 5 # options --cpu and --time so that each job processes a different chunk 20 glb_prog_name = "parallel-perf.py" 88 return [ f"Non-empty error file {self.stderr_name}" ] 139 x = "0" * (10 - len(x)) + x 140 return x[:len(x) - 9] + "." + x[-9:] 150 max_len = len(str(cpus[-1])) 151 cpu_dir_fmt = f"cpu-%.{max_len}u" 157 cpu_option = f"--cpu={cpu}" 162 tr_dir_fmt = "time-range" [all …]
|