/linux/Documentation/devicetree/bindings/leds/backlight/ |
H A D | mediatek,mt6370-backlight.yaml | 1 # SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause) 3 --- 4 $id: http://devicetree.org/schemas/leds/backlight/mediatek,mt6370-backlight.yaml# 5 $schema: http://devicetree.org/meta-schemas/core.yaml# 10 - ChiaEn Wu <chiaen_wu@richtek.com> 21 - $ref: common.yaml# 26 - mediatek,mt6370-backlight 27 - mediatek,mt6372-backlight 29 default-brightness: 32 max-brightness: [all …]
|
H A D | qcom-wled.yaml | 1 # SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause) 3 --- 4 $id: http://devicetree.org/schemas/leds/backlight/qcom-wled.yaml# 5 $schema: http://devicetree.org/meta-schemas/core.yaml# 10 - Bjorn Andersson <andersson@kernel.org> 11 - Kiran Gunda <quic_kgunda@quicinc.com> 21 - qcom,pm8941-wled 22 - qcom,pmi8950-wled 23 - qcom,pmi8994-wled 24 - qcom,pmi8998-wled [all …]
|
H A D | richtek,rt4831-backlight.yaml | 1 # SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause) 3 --- 4 $id: http://devicetree.org/schemas/leds/backlight/richtek,rt4831-backlight.yaml# 5 $schema: http://devicetree.org/meta-schemas/core.yaml# 10 - ChiYuan Huang <cy_huang@richtek.com> 20 https://www.richtek.com/assets/product_file/RT4831A/DS4831A-05.pdf 23 - $ref: common.yaml# 27 const: richtek,rt4831-backlight 29 default-brightness: 33 max-brightness: [all …]
|
/linux/drivers/video/backlight/ |
H A D | qcom-wled.c | 1 // SPDX-License-Identifier: GPL-2.0-only 61 /* WLED3 specific per-'string' registers below */ 93 /* WLED4 specific per-'string' registers below */ 140 /* WLED5 specific per-'string' registers below */ 167 u32 ovp; member 210 int (*wled_cabc_config)(struct wled *wled, bool enable); 219 * Time to wait before checking the OVP status after wled module enable. 238 for (i = 0; i < wled->cfg.num_strings; ++i) { in wled3_set_brightness() 239 rc = regmap_bulk_write(wled->regmap, wled->ctrl_addr + in wled3_set_brightness() 240 WLED3_SINK_REG_BRIGHT(wled->cfg.enabled_strings[i]), in wled3_set_brightness() [all …]
|
H A D | mp3309c.c | 1 // SPDX-License-Identifier: GPL-2.0-or-later 92 /* I2C register #0 - Device enable */ in mp3309c_enable_device() 93 ret = regmap_update_bits(chip->regmap, REG_I2C_0, REG_I2C_0_EN, in mp3309c_enable_device() 99 * I2C register #1 - Set working mode: in mp3309c_enable_device() 100 * - enable/disable synchronous mode in mp3309c_enable_device() 101 * - set overvoltage protection (OVP) in mp3309c_enable_device() 104 if (chip->pdata->sync_mode) in mp3309c_enable_device() 106 reg_val |= chip->pdata->over_voltage_protection; in mp3309c_enable_device() 107 ret = regmap_write(chip->regmap, REG_I2C_1, reg_val); in mp3309c_enable_device() 122 if (chip->pdata->dimming_mode == DIMMING_PWM) { in mp3309c_bl_update_status() [all …]
|
H A D | rt4831-backlight.c | 1 // SPDX-License-Identifier: GPL-2.0-only 3 #include <dt-bindings/leds/rt4831-backlight.h> 43 unsigned int enable = brightness ? RT4831_BLEN_MASK : 0; in rt4831_bl_update_status() local 48 v[0] = (brightness - 1) & RT4831_BLDIML_MASK; in rt4831_bl_update_status() 49 v[1] = ((brightness - 1) & RT4831_BLDIMH_MASK) >> RT4831_BLDIMH_SHIFT; in rt4831_bl_update_status() 51 ret = regmap_raw_write(priv->regmap, RT4831_REG_BLDIML, v, sizeof(v)); in rt4831_bl_update_status() 56 return regmap_update_bits(priv->regmap, RT4831_REG_ENABLE, RT4831_BLEN_MASK, enable); in rt4831_bl_update_status() 67 ret = regmap_read(priv->regmap, RT4831_REG_ENABLE, &val); in rt4831_bl_get_brightness() 74 ret = regmap_raw_read(priv->regmap, RT4831_REG_BLDIML, v, sizeof(v)); in rt4831_bl_get_brightness() 92 struct device *dev = priv->dev; in rt4831_parse_backlight_properties() [all …]
|
H A D | mt6370-backlight.c | 1 // SPDX-License-Identifier: GPL-2.0-only 82 brightness_val[0] = (brightness - 1) & priv->dim2_mask; in mt6370_bl_update_status() 83 brightness_val[1] = (brightness - 1) >> priv->dim2_shift; in mt6370_bl_update_status() 85 ret = regmap_raw_write(priv->regmap, MT6370_REG_BL_DIM2, in mt6370_bl_update_status() 91 gpiod_set_value(priv->enable_gpio, !!brightness); in mt6370_bl_update_status() 94 return regmap_update_bits(priv->regmap, MT6370_REG_BL_EN, in mt6370_bl_update_status() 101 unsigned int enable; in mt6370_bl_get_brightness() local 105 ret = regmap_read(priv->regmap, MT6370_REG_BL_EN, &enable); in mt6370_bl_get_brightness() 109 if (!(enable & MT6370_BL_EN_MASK)) in mt6370_bl_get_brightness() 112 ret = regmap_raw_read(priv->regmap, MT6370_REG_BL_DIM2, in mt6370_bl_get_brightness() [all …]
|
/linux/drivers/leds/ |
H A D | leds-lm3692x.c | 1 // SPDX-License-Identifier: GPL-2.0 3 // Copyright (C) 2017-18 Texas Instruments Incorporated - https://www.ti.com/ 103 * @enable_gpio: VDDIO/EN gpio to enable communication interface 150 ret = regmap_read(led->regmap, LM3692X_FAULT_FLAGS, &read_buf); in lm3692x_fault_check() 155 dev_err(&led->client->dev, "Detected a fault 0x%X\n", read_buf); in lm3692x_fault_check() 160 regmap_read(led->regmap, LM3692X_FAULT_FLAGS, &read_buf); in lm3692x_fault_check() 162 dev_err(&led->client->dev, "Second read of fault flags 0x%X\n", in lm3692x_fault_check() 173 if (led->enabled) in lm3692x_leds_enable() 176 if (led->regulator) { in lm3692x_leds_enable() 177 ret = regulator_enable(led->regulator); in lm3692x_leds_enable() [all …]
|
/linux/Documentation/devicetree/bindings/leds/ |
H A D | ti.lm36922.yaml | 1 # SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause) 3 --- 5 $schema: http://devicetree.org/meta-schemas/core.yaml# 7 title: Texas Instruments - LM3692x Highly Efficient White LED Driver 10 - Dan Murphy <dmurphy@ti.com> 13 The LM3692x is an ultra-compact, highly efficient, 14 white-LED driver designed for LCD display backlighting. 26 - ti,lm36922 27 - ti,lm36923 32 "#address-cells": [all …]
|
/linux/Documentation/devicetree/bindings/power/supply/ |
H A D | bq25980.yaml | 1 # SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause) 4 --- 6 $schema: http://devicetree.org/meta-schemas/core.yaml# 11 - Andrew Davis <afd@ti.com> 15 for use in high-power density portable electronics. These inductorless 20 - $ref: power-supply.yaml# 25 - ti,bq25980 26 - ti,bq25975 27 - ti,bq25960 32 ti,watchdog-timeout-ms: [all …]
|
/linux/drivers/regulator/ |
H A D | vctrl-regulator.c | 1 // SPDX-License-Identifier: GPL-2.0-only 50 struct vctrl_voltage_range *ctrl = &vctrl->vrange.ctrl; in vctrl_calc_ctrl_voltage() 51 struct vctrl_voltage_range *out = &vctrl->vrange.out; in vctrl_calc_ctrl_voltage() 53 return ctrl->min_uV + in vctrl_calc_ctrl_voltage() 54 DIV_ROUND_CLOSEST_ULL((s64)(out_uV - out->min_uV) * in vctrl_calc_ctrl_voltage() 55 (ctrl->max_uV - ctrl->min_uV), in vctrl_calc_ctrl_voltage() 56 out->max_uV - out->min_uV); in vctrl_calc_ctrl_voltage() 61 struct vctrl_voltage_range *ctrl = &vctrl->vrange.ctrl; in vctrl_calc_output_voltage() 62 struct vctrl_voltage_range *out = &vctrl->vrange.out; in vctrl_calc_output_voltage() 69 if (ctrl_uV < ctrl->min_uV) in vctrl_calc_output_voltage() [all …]
|
H A D | mpq7920.c | 1 // SPDX-License-Identifier: GPL-2.0+ 3 // mpq7920.c - regulator driver for mps mpq7920 22 ((MPQ7920_VOLT_MAX - MPQ7920_BUCK_VOLT_MIN)/MPQ7920_VOLT_STEP + 1) 24 ((MPQ7920_VOLT_MAX - MPQ7920_LDO_VOLT_MIN)/MPQ7920_VOLT_STEP + 1) 42 .enable_mask = BIT(MPQ7920_REGULATOR_EN_OFFSET - \ 71 .enable_mask = BIT(MPQ7920_REGULATOR_EN_OFFSET - \ 135 .enable = regulator_enable_regmap, 146 .enable = regulator_enable_regmap, 159 .enable = regulator_enable_regmap, 189 * 00-01: Reserved [all …]
|
H A D | lp8755.c | 1 // SPDX-License-Identifier: GPL-2.0-only 57 ret = regmap_read(rdev->regmap, 0x12 + id, ®val); in lp8755_buck_enable_time() 59 dev_err(&rdev->dev, "i2c access error %s\n", __func__); in lp8755_buck_enable_time() 78 /* enable automatic pwm/pfm mode */ in lp8755_buck_set_mode() 79 ret = regmap_update_bits(rdev->regmap, 0x08 + id, 0x20, 0x00); in lp8755_buck_set_mode() 84 /* enable automatic pwm/pfm/lppfm mode */ in lp8755_buck_set_mode() 85 ret = regmap_update_bits(rdev->regmap, 0x08 + id, 0x20, 0x20); in lp8755_buck_set_mode() 89 ret = regmap_update_bits(rdev->regmap, 0x10, 0x01, 0x01); in lp8755_buck_set_mode() 94 dev_err(pchip->dev, "Not supported buck mode %s\n", __func__); in lp8755_buck_set_mode() 99 ret = regmap_update_bits(rdev->regmap, 0x06, 0x01 << id, regbval); in lp8755_buck_set_mode() [all …]
|
/linux/drivers/usb/typec/tcpm/ |
H A D | maxim_contaminant.c | 1 // SPDX-License-Identifier: GPL-2.0+ 5 * USB-C module to reduce wakeups due to contaminants. 66 dev_err_once(chip->dev, "ADC ERROR: SCALE UNKNOWN"); in max_contaminant_adc_to_mv() 68 return -EINVAL; in max_contaminant_adc_to_mv() 74 struct regmap *regmap = chip->data.regmap; in max_contaminant_read_adc_mv() 84 /* Enable ADC */ in max_contaminant_read_adc_mv() 113 struct regmap *regmap = chip->data.regmap; in max_contaminant_read_resistance_kohm() 119 /* Enable 1uA current source */ in max_contaminant_read_resistance_kohm() 125 /* Enable 1uA current source */ in max_contaminant_read_resistance_kohm() 131 /* OVP disable */ in max_contaminant_read_resistance_kohm() [all …]
|
/linux/drivers/usb/typec/mux/ |
H A D | it5205.c | 1 // SPDX-License-Identifier: GPL-2.0 3 * ITE IT5205 Type-C USB alternate mode passive mux 25 #define IT5205FN_CHIP_ID 0x35303235 /* "5025" -> "5205" */ 75 regmap_update_bits(it->regmap, IT5205_REG_MUXCR, in it5205_switch_set() 79 regmap_update_bits(it->regmap, IT5205_REG_MUXCR, in it5205_switch_set() 85 regmap_write(it->regmap, IT5205_REG_MUXCR, 0); in it5205_switch_set() 97 if (state->mode >= TYPEC_STATE_MODAL && in it5205_mux_set() 98 state->alt->svid != USB_TYPEC_DP_SID) in it5205_mux_set() 99 return -EINVAL; in it5205_mux_set() 101 switch (state->mode) { in it5205_mux_set() [all …]
|
H A D | wcd939x-usbss.c | 1 // SPDX-License-Identifier: GPL-2.0-only 72 #define WCD_USBSS_SWITCH_SELECT0_DP_AUXP_SWITCHES BIT(7) /* 1-> MG2 */ 73 #define WCD_USBSS_SWITCH_SELECT0_DP_AUXM_SWITCHES BIT(6) /* 1-> MG2 */ 76 #define WCD_USBSS_SWITCH_SELECT0_SENSE_SWITCHES BIT(1) /* 1-> SBU2 */ 77 #define WCD_USBSS_SWITCH_SELECT0_MIC_SWITCHES BIT(0) /* 1-> MG2 */ 89 #define WCD_USBSS_SWITCH_SELECT1_AGND_SWITCHES BIT(0) /* 1-> MG2 */ 242 bool reverse = (usbss->orientation == TYPEC_ORIENTATION_REVERSE); in wcd939x_usbss_set() 249 if (usbss->mode < TYPEC_STATE_MODAL || in wcd939x_usbss_set() 250 (!usbss->svid && (usbss->mode == TYPEC_MODE_USB2 || in wcd939x_usbss_set() 251 usbss->mode == TYPEC_MODE_USB3))) { in wcd939x_usbss_set() [all …]
|
/linux/Documentation/devicetree/bindings/usb/ |
H A D | ite,it5205.yaml | 1 # SPDX-License-Identifier: GPL-2.0-only OR BSD-2-Clause 3 --- 5 $schema: http://devicetree.org/meta-schemas/core.yaml# 7 title: ITE IT5202 Type-C USB Alternate Mode Passive MUX 10 - AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com> 11 - Tianping Fang <tianping.fang@mediatek.com> 20 vcc-supply: 23 mode-switch: 27 orientation-switch: 31 ite,ovp-enable: [all …]
|
/linux/drivers/power/supply/ |
H A D | bq25980_charger.c | 1 // SPDX-License-Identifier: GPL-2.0 3 // Copyright (C) 2020 Texas Instruments Incorporated - http://www.ti.com/ 24 bool ovp; member 280 ret = regmap_read(bq->regmap, BQ25980_BUSOCP, &busocp_reg_code); in bq25980_get_input_curr_lim() 289 return regmap_update_bits(bq->regmap, BQ25980_CHRGR_CTRL_2, in bq25980_set_hiz() 306 if (bq->state.bypass) in bq25980_set_input_curr_lim() 307 busocp = min(busocp, bq->chip_info->busocp_sc_max); in bq25980_set_input_curr_lim() 309 busocp = min(busocp, bq->chip_info->busocp_byp_max); in bq25980_set_input_curr_lim() 311 busocp_reg_code = (busocp - BQ25980_BUSOCP_OFFSET_uA) in bq25980_set_input_curr_lim() 314 ret = regmap_write(bq->regmap, BQ25980_BUSOCP, busocp_reg_code); in bq25980_set_input_curr_lim() [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> 49 struct regmap *rmap = chg->max14577->regmap; 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() 62 * - handle timers (fast-charge and prequal) /MBCCHGERR/ in max14577_get_charger_state() 78 /* Charger or USB-cable is connected */ in max14577_get_charger_state() [all …]
|
H A D | mp2629_charger.c | 1 // SPDX-License-Identifier: GPL-2.0-or-later 140 "mp2629-batt-volt", 141 "mp2629-system-volt", 142 "mp2629-input-volt", 143 "mp2629-batt-current", 144 "mp2629-input-current", 154 ret = iio_read_channel_processed(charger->iiochan[ch], &chval); in mp2629_read_adc() 158 val->intval = chval * 1000; in mp2629_read_adc() 170 ret = regmap_field_read(charger->regmap_fields[fld], &rval); in mp2629_get_prop() 174 val->intval = rval * props[fld].step + props[fld].min; in mp2629_get_prop() [all …]
|
H A D | max8925_power.c | 1 // SPDX-License-Identifier: GPL-2.0-only 5 * Copyright (c) 2009-2010 Marvell International Ltd. 85 static int __set_charger(struct max8925_power_info *info, int enable) in __set_charger() argument 87 struct max8925_chip *chip = info->chip; in __set_charger() 88 if (enable) { in __set_charger() 89 /* enable charger in platform */ in __set_charger() 90 if (info->set_charger) in __set_charger() 91 info->set_charger(1); in __set_charger() 92 /* enable charger */ in __set_charger() 93 max8925_set_bits(info->gpm, MAX8925_CHG_CNTL1, 1 << 7, 0); in __set_charger() [all …]
|
/linux/drivers/extcon/ |
H A D | extcon-rt8973a.c | 1 // SPDX-License-Identifier: GPL-2.0-or-later 3 * extcon-rt8973a.c - Richtek RT8973A extcon driver to support USB switches 19 #include <linux/extcon-provider.h> 21 #include "extcon-rt8973a.h" 98 /* Define OVP (Over Voltage Protection), OTP (Over Temperature Protection) */ 145 /* |---------|--ADC| */ 152 { RT8973A_INT1_ATTACH, "muic-attach" }, 153 { RT8973A_INT1_DETACH, "muic-detach" }, 154 { RT8973A_INT1_CHGDET, "muic-chgdet" }, 155 { RT8973A_INT1_DCD_T, "muic-dcd-t" }, [all …]
|
H A D | extcon-lc824206xa.c | 1 // SPDX-License-Identifier: GPL-2.0-or-later 8 * (ENA2222-D.PDF), but no full datasheet. So there is no documentation 11 * This driver is based on the register info from the extcon-fsa9285.c driver, 22 #include <linux/extcon-provider.h> 57 /* 5 bits? ADC 0x10 GND, 0x1a-0x1f ACA, 0x1f float */ 82 * auto-reset to 0, so these must be set to 0 manually after clearing. 139 ret = i2c_smbus_read_byte_data(data->client, reg); in lc824206xa_read_reg() 141 dev_err(&data->client->dev, "Error %d reading reg 0x%02x\n", ret, reg); in lc824206xa_read_reg() 150 ret = i2c_smbus_write_byte_data(data->client, reg, val); in lc824206xa_write_reg() 152 dev_err(&data->client->dev, "Error %d writing reg 0x%02x\n", ret, reg); in lc824206xa_write_reg() [all …]
|
/linux/arch/arm64/boot/dts/rockchip/ |
H A D | rk3399-gru.dtsi | 1 // SPDX-License-Identifier: (GPL-2.0+ OR MIT) 5 * Copyright 2016-2017 Google, Inc 8 #include <dt-bindings/input/input.h> 9 #include "rk3399-op1.dtsi" 18 stdout-path = "serial2:115200n8"; 27 * - Rails that only connect to the EC (or devices that the EC talks to) 29 * - Rails _are_ included if the rails go to the AP even if the AP 38 * - The EC controls the enable and the EC always enables a rail as 40 * - The rails are actually connected to each other by a jumper and 45 ppvar_sys: regulator-ppvar-sys { [all …]
|
/linux/arch/arm/boot/dts/qcom/ |
H A D | qcom-apq8074-dragonboard.dts | 1 // SPDX-License-Identifier: GPL-2.0 2 #include <dt-bindings/gpio/gpio.h> 3 #include <dt-bindings/input/input.h> 4 #include <dt-bindings/leds/common.h> 5 #include <dt-bindings/pinctrl/qcom,pmic-gpio.h> 6 #include "qcom-msm8974.dtsi" 10 /delete-node/ &mpss_region; 14 compatible = "qcom,apq8074-dragonboard", "qcom,apq8074"; 23 stdout-path = "serial0:115200n8"; 26 gpio-keys { [all …]
|