Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
36 commits
Select commit Hold shift + click to select a range
3d68180
regulator: cros-ec: Fix error code in dev_err message
AxelLin May 12, 2021
f8c8871
regulator: fan53555: fix TCS4525 voltage calulation
pgwipeout May 11, 2021
adf1471
Merge series "regulator: fan53555: tcs4525 fix and cleanup" from Pete…
broonie May 12, 2021
0b1e552
regulator: da9121: Return REGULATOR_MODE_INVALID for invalid mode
AxelLin May 17, 2021
34991ee
regulator: fan53880: Fix missing n_voltages setting
AxelLin May 17, 2021
687c9e3
regulator: Check ramp_delay_table for regulator_set_ramp_delay_regmap
AxelLin May 19, 2021
855bfff
regulator: fixed: Ensure enable_counter is correct if reg_domain_disa…
AxelLin May 20, 2021
98e48cd
regulator: core: resolve supply for boot-on/always-on regulators
lumag May 19, 2021
36cb555
regulator: scmi: Fix off-by-one for linear regulators .n_voltages set…
AxelLin May 21, 2021
6f55c5d
regulator: max77620: Use device_set_of_node_from_dev()
digetx May 23, 2021
62499a9
regulator: max77620: Silence deferred probe error
digetx May 23, 2021
0514582
regulator: bd70528: Fix off-by-one for buck123 .n_voltages setting
AxelLin May 23, 2021
4c66863
regulator: bd71828: Fix .n_voltages settings
AxelLin May 23, 2021
8d6ee30
regulator: hisilicon: use the correct HiSilicon copyright
haofang11 May 22, 2021
13817d4
spi: bcm2835: Fix out-of-bounds access with more than 4 slaves
l1k May 22, 2021
a072cbd
Merge series "Fix MAX77620 regulator driver regression" from Dmitry O…
broonie May 24, 2021
86ab21c
regulator: rtmv20: Fix .set_current_limit/.get_current_limit callbacks
AxelLin May 30, 2021
5f01de6
regulator: rtmv20: Add Richtek to Kconfig text
AxelLin May 30, 2021
8908217
regulator: mt6315: Fix function prototype for mt6315_map_mode
AxelLin May 30, 2021
46639a5
regulator: rtmv20: Fix to make regcache value first reading back from HW
Jun 1, 2021
1963fa6
regulator: atc260x: Fix n_voltages and min_sel for pickable linear ra…
AxelLin May 28, 2021
2ec6f20
spi: Cleanup on failure of initial setup
l1k May 27, 2021
bc537e6
regulator: bd718x7: Fix the BUCK7 voltage setting on BD71837
M-Vaittinen Jun 2, 2021
f131767
spi: spi-zynq-qspi: Fix some wrong goto jumps & missing error code
zpershuai May 27, 2021
d94b93a
ARM: cpuidle: Avoid orphan section warning
arndb Dec 30, 2020
d4c6399
vmlinux.lds.h: Avoid orphan section with !SMP
nathanchance May 6, 2021
50bec7f
regulator: hi6421v600: Fix .vsel_mask setting
AxelLin May 29, 2021
d38fa9a
spi: stm32-qspi: Always wait BUSY bit to be cleared in stm32_qspi_wai…
Jun 3, 2021
cb2381c
regulator: rt4801: Fix NULL pointer dereference if priv->enable_gpios…
AxelLin Jun 3, 2021
107866a
xen-netback: take a reference to the RX task thread
royger Jun 7, 2021
dc25573
afs: Fix partial writeback of large files on fsync and close
Jun 6, 2021
9b1111f
Merge tag 'regulator-fix-v5.13-rc4' of git://git.kernel.org/pub/scm/l…
torvalds Jun 8, 2021
4c8684f
Merge tag 'spi-fix-v5.13-rc4' of git://git.kernel.org/pub/scm/linux/k…
torvalds Jun 8, 2021
591a22c
proc: Track /proc/$pid/attr/ opener mm_struct
kees Jun 8, 2021
374aeb9
Merge tag 'orphans-v5.13-rc6' of git://git.kernel.org/pub/scm/linux/k…
torvalds Jun 8, 2021
368094d
Merge tag 'for-linus-5.13b-rc6-tag' of git://git.kernel.org/pub/scm/l…
torvalds Jun 8, 2021
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions arch/arm/include/asm/cpuidle.h
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,11 @@
#ifdef CONFIG_CPU_IDLE
extern int arm_cpuidle_simple_enter(struct cpuidle_device *dev,
struct cpuidle_driver *drv, int index);
#define __cpuidle_method_section __used __section("__cpuidle_method_of_table")
#else
static inline int arm_cpuidle_simple_enter(struct cpuidle_device *dev,
struct cpuidle_driver *drv, int index) { return -ENODEV; }
#define __cpuidle_method_section __maybe_unused /* drop silently */
#endif

/* Common ARM WFI state */
Expand Down Expand Up @@ -42,8 +44,7 @@ struct of_cpuidle_method {

#define CPUIDLE_METHOD_OF_DECLARE(name, _method, _ops) \
static const struct of_cpuidle_method __cpuidle_method_of_table_##name \
__used __section("__cpuidle_method_of_table") \
= { .method = _method, .ops = _ops }
__cpuidle_method_section = { .method = _method, .ops = _ops }

extern int arm_cpuidle_suspend(int index);

Expand Down
6 changes: 6 additions & 0 deletions drivers/net/xen-netback/interface.c
Original file line number Diff line number Diff line change
Expand Up @@ -684,6 +684,7 @@ static void xenvif_disconnect_queue(struct xenvif_queue *queue)
{
if (queue->task) {
kthread_stop(queue->task);
put_task_struct(queue->task);
queue->task = NULL;
}

Expand Down Expand Up @@ -745,6 +746,11 @@ int xenvif_connect_data(struct xenvif_queue *queue,
if (IS_ERR(task))
goto kthread_err;
queue->task = task;
/*
* Take a reference to the task in order to prevent it from being freed
* if the thread function returns before kthread_stop is called.
*/
get_task_struct(task);

task = kthread_run(xenvif_dealloc_kthread, queue,
"%s-dealloc", queue->name);
Expand Down
2 changes: 1 addition & 1 deletion drivers/regulator/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -1031,7 +1031,7 @@ config REGULATOR_RT5033
current source, LDO and Buck.

config REGULATOR_RTMV20
tristate "RTMV20 Laser Diode Regulator"
tristate "Richtek RTMV20 Laser Diode Regulator"
depends on I2C
select REGMAP_I2C
help
Expand Down
19 changes: 10 additions & 9 deletions drivers/regulator/atc260x-regulator.c
Original file line number Diff line number Diff line change
Expand Up @@ -28,16 +28,16 @@ static const struct linear_range atc2609a_dcdc_voltage_ranges[] = {

static const struct linear_range atc2609a_ldo_voltage_ranges0[] = {
REGULATOR_LINEAR_RANGE(700000, 0, 15, 100000),
REGULATOR_LINEAR_RANGE(2100000, 16, 28, 100000),
REGULATOR_LINEAR_RANGE(2100000, 0, 12, 100000),
};

static const struct linear_range atc2609a_ldo_voltage_ranges1[] = {
REGULATOR_LINEAR_RANGE(850000, 0, 15, 100000),
REGULATOR_LINEAR_RANGE(2100000, 16, 27, 100000),
REGULATOR_LINEAR_RANGE(2100000, 0, 11, 100000),
};

static const unsigned int atc260x_ldo_voltage_range_sel[] = {
0x0, 0x1,
0x0, 0x20,
};

static int atc260x_dcdc_set_voltage_time_sel(struct regulator_dev *rdev,
Expand Down Expand Up @@ -411,7 +411,7 @@ enum atc2609a_reg_ids {
.owner = THIS_MODULE, \
}

#define atc2609a_reg_desc_ldo_range_pick(num, n_range) { \
#define atc2609a_reg_desc_ldo_range_pick(num, n_range, n_volt) { \
.name = "LDO"#num, \
.supply_name = "ldo"#num, \
.of_match = of_match_ptr("ldo"#num), \
Expand All @@ -421,6 +421,7 @@ enum atc2609a_reg_ids {
.type = REGULATOR_VOLTAGE, \
.linear_ranges = atc2609a_ldo_voltage_ranges##n_range, \
.n_linear_ranges = ARRAY_SIZE(atc2609a_ldo_voltage_ranges##n_range), \
.n_voltages = n_volt, \
.vsel_reg = ATC2609A_PMU_LDO##num##_CTL0, \
.vsel_mask = GENMASK(4, 1), \
.vsel_range_reg = ATC2609A_PMU_LDO##num##_CTL0, \
Expand Down Expand Up @@ -458,12 +459,12 @@ static const struct regulator_desc atc2609a_reg[] = {
atc2609a_reg_desc_ldo_bypass(0),
atc2609a_reg_desc_ldo_bypass(1),
atc2609a_reg_desc_ldo_bypass(2),
atc2609a_reg_desc_ldo_range_pick(3, 0),
atc2609a_reg_desc_ldo_range_pick(4, 0),
atc2609a_reg_desc_ldo_range_pick(3, 0, 29),
atc2609a_reg_desc_ldo_range_pick(4, 0, 29),
atc2609a_reg_desc_ldo(5),
atc2609a_reg_desc_ldo_range_pick(6, 1),
atc2609a_reg_desc_ldo_range_pick(7, 0),
atc2609a_reg_desc_ldo_range_pick(8, 0),
atc2609a_reg_desc_ldo_range_pick(6, 1, 28),
atc2609a_reg_desc_ldo_range_pick(7, 0, 29),
atc2609a_reg_desc_ldo_range_pick(8, 0, 29),
atc2609a_reg_desc_ldo_fixed(9),
};

Expand Down
2 changes: 1 addition & 1 deletion drivers/regulator/bd718x7-regulator.c
Original file line number Diff line number Diff line change
Expand Up @@ -334,7 +334,7 @@ BD718XX_OPS(bd71837_buck_regulator_ops, regulator_list_voltage_linear_range,
NULL);

BD718XX_OPS(bd71837_buck_regulator_nolinear_ops, regulator_list_voltage_table,
regulator_map_voltage_ascend, bd718xx_set_voltage_sel_restricted,
regulator_map_voltage_ascend, bd71837_set_voltage_sel_restricted,
regulator_get_voltage_sel_regmap, regulator_set_voltage_time_sel,
NULL);
/*
Expand Down
6 changes: 6 additions & 0 deletions drivers/regulator/core.c
Original file line number Diff line number Diff line change
Expand Up @@ -1425,6 +1425,12 @@ static int set_machine_constraints(struct regulator_dev *rdev)
* and we have control then make sure it is enabled.
*/
if (rdev->constraints->always_on || rdev->constraints->boot_on) {
/* If we want to enable this regulator, make sure that we know
* the supplying regulator.
*/
if (rdev->supply_name && !rdev->supply)
return -EPROBE_DEFER;

if (rdev->supply) {
ret = regulator_enable(rdev->supply);
if (ret < 0) {
Expand Down
3 changes: 2 additions & 1 deletion drivers/regulator/cros-ec-regulator.c
Original file line number Diff line number Diff line change
Expand Up @@ -225,8 +225,9 @@ static int cros_ec_regulator_probe(struct platform_device *pdev)

drvdata->dev = devm_regulator_register(dev, &drvdata->desc, &cfg);
if (IS_ERR(drvdata->dev)) {
ret = PTR_ERR(drvdata->dev);
dev_err(&pdev->dev, "Failed to register regulator: %d\n", ret);
return PTR_ERR(drvdata->dev);
return ret;
}

platform_set_drvdata(pdev, drvdata);
Expand Down
10 changes: 7 additions & 3 deletions drivers/regulator/da9121-regulator.c
Original file line number Diff line number Diff line change
Expand Up @@ -280,7 +280,7 @@ static unsigned int da9121_map_mode(unsigned int mode)
case DA9121_BUCK_MODE_FORCE_PFM:
return REGULATOR_MODE_STANDBY;
default:
return -EINVAL;
return REGULATOR_MODE_INVALID;
}
}

Expand Down Expand Up @@ -317,7 +317,7 @@ static unsigned int da9121_buck_get_mode(struct regulator_dev *rdev)
{
struct da9121 *chip = rdev_get_drvdata(rdev);
int id = rdev_get_id(rdev);
unsigned int val;
unsigned int val, mode;
int ret = 0;

ret = regmap_read(chip->regmap, da9121_mode_field[id].reg, &val);
Expand All @@ -326,7 +326,11 @@ static unsigned int da9121_buck_get_mode(struct regulator_dev *rdev)
return -EINVAL;
}

return da9121_map_mode(val & da9121_mode_field[id].msk);
mode = da9121_map_mode(val & da9121_mode_field[id].msk);
if (mode == REGULATOR_MODE_INVALID)
return -EINVAL;

return mode;
}

static const struct regulator_ops da9121_buck_ops = {
Expand Down
3 changes: 1 addition & 2 deletions drivers/regulator/fan53555.c
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,6 @@

#define FAN53555_NVOLTAGES 64 /* Numbers of voltages */
#define FAN53526_NVOLTAGES 128
#define TCS4525_NVOLTAGES 127 /* Numbers of voltages */

#define TCS_VSEL_NSEL_MASK 0x7f
#define TCS_VSEL0_MODE (1 << 7)
Expand Down Expand Up @@ -376,7 +375,7 @@ static int fan53555_voltages_setup_tcs(struct fan53555_device_info *di)
/* Init voltage range and step */
di->vsel_min = 600000;
di->vsel_step = 6250;
di->vsel_count = TCS4525_NVOLTAGES;
di->vsel_count = FAN53526_NVOLTAGES;

return 0;
}
Expand Down
3 changes: 3 additions & 0 deletions drivers/regulator/fan53880.c
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@ static const struct regulator_ops fan53880_ops = {
REGULATOR_LINEAR_RANGE(800000, 0xf, 0x73, 25000), \
}, \
.n_linear_ranges = 2, \
.n_voltages = 0x74, \
.vsel_reg = FAN53880_LDO ## _num ## VOUT, \
.vsel_mask = 0x7f, \
.enable_reg = FAN53880_ENABLE, \
Expand All @@ -76,6 +77,7 @@ static const struct regulator_desc fan53880_regulators[] = {
REGULATOR_LINEAR_RANGE(600000, 0x1f, 0xf7, 12500),
},
.n_linear_ranges = 2,
.n_voltages = 0xf8,
.vsel_reg = FAN53880_BUCKVOUT,
.vsel_mask = 0x7f,
.enable_reg = FAN53880_ENABLE,
Expand All @@ -95,6 +97,7 @@ static const struct regulator_desc fan53880_regulators[] = {
REGULATOR_LINEAR_RANGE(3000000, 0x4, 0x70, 25000),
},
.n_linear_ranges = 2,
.n_voltages = 0x71,
.vsel_reg = FAN53880_BOOSTVOUT,
.vsel_mask = 0x7f,
.enable_reg = FAN53880_ENABLE_BOOST,
Expand Down
7 changes: 6 additions & 1 deletion drivers/regulator/fixed.c
Original file line number Diff line number Diff line change
Expand Up @@ -88,10 +88,15 @@ static int reg_domain_disable(struct regulator_dev *rdev)
{
struct fixed_voltage_data *priv = rdev_get_drvdata(rdev);
struct device *dev = rdev->dev.parent;
int ret;

ret = dev_pm_genpd_set_performance_state(dev, 0);
if (ret)
return ret;

priv->enable_counter--;

return dev_pm_genpd_set_performance_state(dev, 0);
return 0;
}

static int reg_is_enabled(struct regulator_dev *rdev)
Expand Down
2 changes: 1 addition & 1 deletion drivers/regulator/helpers.c
Original file line number Diff line number Diff line change
Expand Up @@ -948,7 +948,7 @@ int regulator_set_ramp_delay_regmap(struct regulator_dev *rdev, int ramp_delay)
int ret;
unsigned int sel;

if (!rdev->desc->n_ramp_values)
if (WARN_ON(!rdev->desc->n_ramp_values || !rdev->desc->ramp_delay_table))
return -EINVAL;

ret = find_closest_bigger(ramp_delay, rdev->desc->ramp_delay_table,
Expand Down
4 changes: 2 additions & 2 deletions drivers/regulator/hi6421v600-regulator.c
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
// Device driver for regulators in Hisi IC
//
// Copyright (c) 2013 Linaro Ltd.
// Copyright (c) 2011 Hisilicon.
// Copyright (c) 2011 HiSilicon Ltd.
// Copyright (c) 2020-2021 Huawei Technologies Co., Ltd
//
// Guodong Xu <guodong.xu@linaro.org>
Expand Down Expand Up @@ -83,7 +83,7 @@ static const unsigned int ldo34_voltages[] = {
.owner = THIS_MODULE, \
.volt_table = vtable, \
.n_voltages = ARRAY_SIZE(vtable), \
.vsel_mask = (1 << (ARRAY_SIZE(vtable) - 1)) - 1, \
.vsel_mask = ARRAY_SIZE(vtable) - 1, \
.vsel_reg = vreg, \
.enable_reg = ereg, \
.enable_mask = emask, \
Expand Down
2 changes: 1 addition & 1 deletion drivers/regulator/hi655x-regulator.c
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
//
// Device driver for regulators in Hi655x IC
//
// Copyright (c) 2016 Hisilicon.
// Copyright (c) 2016 HiSilicon Ltd.
//
// Authors:
// Chen Feng <puck.chen@hisilicon.com>
Expand Down
17 changes: 11 additions & 6 deletions drivers/regulator/max77620-regulator.c
Original file line number Diff line number Diff line change
Expand Up @@ -814,6 +814,13 @@ static int max77620_regulator_probe(struct platform_device *pdev)
config.dev = dev;
config.driver_data = pmic;

/*
* Set of_node_reuse flag to prevent driver core from attempting to
* claim any pinmux resources already claimed by the parent device.
* Otherwise PMIC driver will fail to re-probe.
*/
device_set_of_node_from_dev(&pdev->dev, pdev->dev.parent);

for (id = 0; id < MAX77620_NUM_REGS; id++) {
struct regulator_dev *rdev;
struct regulator_desc *rdesc;
Expand All @@ -839,12 +846,10 @@ static int max77620_regulator_probe(struct platform_device *pdev)
return ret;

rdev = devm_regulator_register(dev, rdesc, &config);
if (IS_ERR(rdev)) {
ret = PTR_ERR(rdev);
dev_err(dev, "Regulator registration %s failed: %d\n",
rdesc->name, ret);
return ret;
}
if (IS_ERR(rdev))
return dev_err_probe(dev, PTR_ERR(rdev),
"Regulator registration %s failed\n",
rdesc->name);
}

return 0;
Expand Down
2 changes: 1 addition & 1 deletion drivers/regulator/mt6315-regulator.c
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ static const struct linear_range mt_volt_range1[] = {
REGULATOR_LINEAR_RANGE(0, 0, 0xbf, 6250),
};

static unsigned int mt6315_map_mode(u32 mode)
static unsigned int mt6315_map_mode(unsigned int mode)
{
switch (mode) {
case MT6315_BUCK_MODE_AUTO:
Expand Down
4 changes: 2 additions & 2 deletions drivers/regulator/rt4801-regulator.c
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ static int rt4801_enable(struct regulator_dev *rdev)
struct gpio_descs *gpios = priv->enable_gpios;
int id = rdev_get_id(rdev), ret;

if (gpios->ndescs <= id) {
if (!gpios || gpios->ndescs <= id) {
dev_warn(&rdev->dev, "no dedicated gpio can control\n");
goto bypass_gpio;
}
Expand All @@ -88,7 +88,7 @@ static int rt4801_disable(struct regulator_dev *rdev)
struct gpio_descs *gpios = priv->enable_gpios;
int id = rdev_get_id(rdev);

if (gpios->ndescs <= id) {
if (!gpios || gpios->ndescs <= id) {
dev_warn(&rdev->dev, "no dedicated gpio can control\n");
goto bypass_gpio;
}
Expand Down
44 changes: 42 additions & 2 deletions drivers/regulator/rtmv20-regulator.c
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@
#define RTMV20_REG_LDIRQ 0x30
#define RTMV20_REG_LDSTAT 0x40
#define RTMV20_REG_LDMASK 0x50
#define RTMV20_MAX_REGS (RTMV20_REG_LDMASK + 1)

#define RTMV20_VID_MASK GENMASK(7, 4)
#define RICHTEK_VID 0x80
Expand Down Expand Up @@ -103,9 +104,47 @@ static int rtmv20_lsw_disable(struct regulator_dev *rdev)
return 0;
}

static int rtmv20_lsw_set_current_limit(struct regulator_dev *rdev, int min_uA,
int max_uA)
{
int sel;

if (min_uA > RTMV20_LSW_MAXUA || max_uA < RTMV20_LSW_MINUA)
return -EINVAL;

if (max_uA > RTMV20_LSW_MAXUA)
max_uA = RTMV20_LSW_MAXUA;

sel = (max_uA - RTMV20_LSW_MINUA) / RTMV20_LSW_STEPUA;

/* Ensure the selected setting is still in range */
if ((sel * RTMV20_LSW_STEPUA + RTMV20_LSW_MINUA) < min_uA)
return -EINVAL;

sel <<= ffs(rdev->desc->csel_mask) - 1;

return regmap_update_bits(rdev->regmap, rdev->desc->csel_reg,
rdev->desc->csel_mask, sel);
}

static int rtmv20_lsw_get_current_limit(struct regulator_dev *rdev)
{
unsigned int val;
int ret;

ret = regmap_read(rdev->regmap, rdev->desc->csel_reg, &val);
if (ret)
return ret;

val &= rdev->desc->csel_mask;
val >>= ffs(rdev->desc->csel_mask) - 1;

return val * RTMV20_LSW_STEPUA + RTMV20_LSW_MINUA;
}

static const struct regulator_ops rtmv20_regulator_ops = {
.set_current_limit = regulator_set_current_limit_regmap,
.get_current_limit = regulator_get_current_limit_regmap,
.set_current_limit = rtmv20_lsw_set_current_limit,
.get_current_limit = rtmv20_lsw_get_current_limit,
.enable = rtmv20_lsw_enable,
.disable = rtmv20_lsw_disable,
.is_enabled = regulator_is_enabled_regmap,
Expand Down Expand Up @@ -275,6 +314,7 @@ static const struct regmap_config rtmv20_regmap_config = {
.val_bits = 8,
.cache_type = REGCACHE_RBTREE,
.max_register = RTMV20_REG_LDMASK,
.num_reg_defaults_raw = RTMV20_MAX_REGS,

.writeable_reg = rtmv20_is_accessible_reg,
.readable_reg = rtmv20_is_accessible_reg,
Expand Down
2 changes: 1 addition & 1 deletion drivers/regulator/scmi-regulator.c
Original file line number Diff line number Diff line change
Expand Up @@ -173,7 +173,7 @@ scmi_config_linear_regulator_mappings(struct scmi_regulator *sreg,
sreg->desc.uV_step =
vinfo->levels_uv[SCMI_VOLTAGE_SEGMENT_STEP];
sreg->desc.linear_min_sel = 0;
sreg->desc.n_voltages = delta_uV / sreg->desc.uV_step;
sreg->desc.n_voltages = (delta_uV / sreg->desc.uV_step) + 1;
sreg->desc.ops = &scmi_reg_linear_ops;
}

Expand Down
Loading