Skip to content

Commit 3feecb1

Browse files
committed
Merge tag 'char-misc-6.5-rc6' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/char-misc
Pull char / misc driver fixes from Greg KH: "Here are some small char/misc driver fixes for 6.5-rc6 that resolve some reported issues. Included in here are: - bunch of iio driver fixes for reported problems - interconnect driver fixes - counter driver build fix - cardreader driver fixes - binder driver fixes - other tiny driver fixes All of these have been in linux-next for a while with no reported problems" * tag 'char-misc-6.5-rc6' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/char-misc: (21 commits) misc: tps6594-esm: Disable ESM for rev 1 PMIC misc: rtsx: judge ASPM Mode to set PETXCFG Reg binder: fix memory leak in binder_init() iio: cros_ec: Fix the allocation size for cros_ec_command tools/counter: Makefile: Replace rmdir by rm to avoid make,clean failure iio: imu: lsm6dsx: Fix mount matrix retrieval iio: adc: meson: fix core clock enable/disable moment iio: core: Prevent invalid memory access when there is no parent iio: frequency: admv1013: propagate errors from regulator_get_voltage() counter: Fix menuconfig "Counter support" submenu entries disappearance dt-bindings: iio: adi,ad74115: remove ref from -nanoamp iio: adc: ina2xx: avoid NULL pointer dereference on OF device match iio: light: bu27008: Fix intensity data type iio: light: bu27008: Fix scale format iio: light: bu27034: Fix scale format iio: adc: ad7192: Fix ac excitation feature interconnect: qcom: sa8775p: add enable_mask for bcm nodes interconnect: qcom: sm8550: add enable_mask for bcm nodes interconnect: qcom: sm8450: add enable_mask for bcm nodes interconnect: qcom: Add support for mask-based BCMs ...
2 parents 469a2f5 + 51a26bb commit 3feecb1

File tree

27 files changed

+148
-103
lines changed

27 files changed

+148
-103
lines changed

Documentation/devicetree/bindings/iio/addac/adi,ad74115.yaml

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -216,7 +216,6 @@ properties:
216216
description: Whether to enable burnout current for EXT1.
217217

218218
adi,ext1-burnout-current-nanoamp:
219-
$ref: /schemas/types.yaml#/definitions/uint32
220219
description:
221220
Burnout current in nanoamps to be applied to EXT1.
222221
enum: [0, 50, 500, 1000, 10000]
@@ -233,7 +232,6 @@ properties:
233232
description: Whether to enable burnout current for EXT2.
234233

235234
adi,ext2-burnout-current-nanoamp:
236-
$ref: /schemas/types.yaml#/definitions/uint32
237235
description: Burnout current in nanoamps to be applied to EXT2.
238236
enum: [0, 50, 500, 1000, 10000]
239237
default: 0
@@ -249,7 +247,6 @@ properties:
249247
description: Whether to enable burnout current for VIOUT.
250248

251249
adi,viout-burnout-current-nanoamp:
252-
$ref: /schemas/types.yaml#/definitions/uint32
253250
description: Burnout current in nanoamps to be applied to VIOUT.
254251
enum: [0, 1000, 10000]
255252
default: 0

drivers/android/binder.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6617,6 +6617,7 @@ static int __init binder_init(void)
66176617

66186618
err_alloc_device_names_failed:
66196619
debugfs_remove_recursive(binder_debugfs_dir_entry_root);
6620+
binder_alloc_shrinker_exit();
66206621

66216622
return ret;
66226623
}

drivers/android/binder_alloc.c

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1087,6 +1087,12 @@ int binder_alloc_shrinker_init(void)
10871087
return ret;
10881088
}
10891089

1090+
void binder_alloc_shrinker_exit(void)
1091+
{
1092+
unregister_shrinker(&binder_shrinker);
1093+
list_lru_destroy(&binder_alloc_lru);
1094+
}
1095+
10901096
/**
10911097
* check_buffer() - verify that buffer/offset is safe to access
10921098
* @alloc: binder_alloc for this proc

drivers/android/binder_alloc.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -129,6 +129,7 @@ extern struct binder_buffer *binder_alloc_new_buf(struct binder_alloc *alloc,
129129
int pid);
130130
extern void binder_alloc_init(struct binder_alloc *alloc);
131131
extern int binder_alloc_shrinker_init(void);
132+
extern void binder_alloc_shrinker_exit(void);
132133
extern void binder_alloc_vma_close(struct binder_alloc *alloc);
133134
extern struct binder_buffer *
134135
binder_alloc_prepare_to_free(struct binder_alloc *alloc,

drivers/counter/Kconfig

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -3,13 +3,6 @@
33
# Counter devices
44
#
55

6-
menuconfig COUNTER
7-
tristate "Counter support"
8-
help
9-
This enables counter device support through the Generic Counter
10-
interface. You only need to enable this, if you also want to enable
11-
one or more of the counter device drivers below.
12-
136
config I8254
147
tristate
158
select COUNTER
@@ -25,6 +18,13 @@ config I8254
2518

2619
If built as a module its name will be i8254.
2720

21+
menuconfig COUNTER
22+
tristate "Counter support"
23+
help
24+
This enables counter device support through the Generic Counter
25+
interface. You only need to enable this, if you also want to enable
26+
one or more of the counter device drivers below.
27+
2828
if COUNTER
2929

3030
config 104_QUAD_8

drivers/iio/adc/ad7192.c

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,6 @@
6262
#define AD7192_MODE_STA_MASK BIT(20) /* Status Register transmission Mask */
6363
#define AD7192_MODE_CLKSRC(x) (((x) & 0x3) << 18) /* Clock Source Select */
6464
#define AD7192_MODE_SINC3 BIT(15) /* SINC3 Filter Select */
65-
#define AD7192_MODE_ACX BIT(14) /* AC excitation enable(AD7195 only)*/
6665
#define AD7192_MODE_ENPAR BIT(13) /* Parity Enable */
6766
#define AD7192_MODE_CLKDIV BIT(12) /* Clock divide by 2 (AD7190/2 only)*/
6867
#define AD7192_MODE_SCYCLE BIT(11) /* Single cycle conversion */
@@ -91,6 +90,7 @@
9190
/* Configuration Register Bit Designations (AD7192_REG_CONF) */
9291

9392
#define AD7192_CONF_CHOP BIT(23) /* CHOP enable */
93+
#define AD7192_CONF_ACX BIT(22) /* AC excitation enable(AD7195 only) */
9494
#define AD7192_CONF_REFSEL BIT(20) /* REFIN1/REFIN2 Reference Select */
9595
#define AD7192_CONF_CHAN(x) ((x) << 8) /* Channel select */
9696
#define AD7192_CONF_CHAN_MASK (0x7FF << 8) /* Channel select mask */
@@ -472,7 +472,7 @@ static ssize_t ad7192_show_ac_excitation(struct device *dev,
472472
struct iio_dev *indio_dev = dev_to_iio_dev(dev);
473473
struct ad7192_state *st = iio_priv(indio_dev);
474474

475-
return sysfs_emit(buf, "%d\n", !!(st->mode & AD7192_MODE_ACX));
475+
return sysfs_emit(buf, "%d\n", !!(st->conf & AD7192_CONF_ACX));
476476
}
477477

478478
static ssize_t ad7192_show_bridge_switch(struct device *dev,
@@ -513,13 +513,13 @@ static ssize_t ad7192_set(struct device *dev,
513513

514514
ad_sd_write_reg(&st->sd, AD7192_REG_GPOCON, 1, st->gpocon);
515515
break;
516-
case AD7192_REG_MODE:
516+
case AD7192_REG_CONF:
517517
if (val)
518-
st->mode |= AD7192_MODE_ACX;
518+
st->conf |= AD7192_CONF_ACX;
519519
else
520-
st->mode &= ~AD7192_MODE_ACX;
520+
st->conf &= ~AD7192_CONF_ACX;
521521

522-
ad_sd_write_reg(&st->sd, AD7192_REG_MODE, 3, st->mode);
522+
ad_sd_write_reg(&st->sd, AD7192_REG_CONF, 3, st->conf);
523523
break;
524524
default:
525525
ret = -EINVAL;
@@ -579,12 +579,11 @@ static IIO_DEVICE_ATTR(bridge_switch_en, 0644,
579579

580580
static IIO_DEVICE_ATTR(ac_excitation_en, 0644,
581581
ad7192_show_ac_excitation, ad7192_set,
582-
AD7192_REG_MODE);
582+
AD7192_REG_CONF);
583583

584584
static struct attribute *ad7192_attributes[] = {
585585
&iio_dev_attr_filter_low_pass_3db_frequency_available.dev_attr.attr,
586586
&iio_dev_attr_bridge_switch_en.dev_attr.attr,
587-
&iio_dev_attr_ac_excitation_en.dev_attr.attr,
588587
NULL
589588
};
590589

@@ -595,6 +594,7 @@ static const struct attribute_group ad7192_attribute_group = {
595594
static struct attribute *ad7195_attributes[] = {
596595
&iio_dev_attr_filter_low_pass_3db_frequency_available.dev_attr.attr,
597596
&iio_dev_attr_bridge_switch_en.dev_attr.attr,
597+
&iio_dev_attr_ac_excitation_en.dev_attr.attr,
598598
NULL
599599
};
600600

drivers/iio/adc/ina2xx-adc.c

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -124,6 +124,7 @@ static const struct regmap_config ina2xx_regmap_config = {
124124
enum ina2xx_ids { ina219, ina226 };
125125

126126
struct ina2xx_config {
127+
const char *name;
127128
u16 config_default;
128129
int calibration_value;
129130
int shunt_voltage_lsb; /* nV */
@@ -155,6 +156,7 @@ struct ina2xx_chip_info {
155156

156157
static const struct ina2xx_config ina2xx_config[] = {
157158
[ina219] = {
159+
.name = "ina219",
158160
.config_default = INA219_CONFIG_DEFAULT,
159161
.calibration_value = 4096,
160162
.shunt_voltage_lsb = 10000,
@@ -164,6 +166,7 @@ static const struct ina2xx_config ina2xx_config[] = {
164166
.chip_id = ina219,
165167
},
166168
[ina226] = {
169+
.name = "ina226",
167170
.config_default = INA226_CONFIG_DEFAULT,
168171
.calibration_value = 2048,
169172
.shunt_voltage_lsb = 2500,
@@ -996,7 +999,7 @@ static int ina2xx_probe(struct i2c_client *client)
996999
/* Patch the current config register with default. */
9971000
val = chip->config->config_default;
9981001

999-
if (id->driver_data == ina226) {
1002+
if (type == ina226) {
10001003
ina226_set_average(chip, INA226_DEFAULT_AVG, &val);
10011004
ina226_set_int_time_vbus(chip, INA226_DEFAULT_IT, &val);
10021005
ina226_set_int_time_vshunt(chip, INA226_DEFAULT_IT, &val);
@@ -1015,7 +1018,7 @@ static int ina2xx_probe(struct i2c_client *client)
10151018
}
10161019

10171020
indio_dev->modes = INDIO_DIRECT_MODE;
1018-
if (id->driver_data == ina226) {
1021+
if (type == ina226) {
10191022
indio_dev->channels = ina226_channels;
10201023
indio_dev->num_channels = ARRAY_SIZE(ina226_channels);
10211024
indio_dev->info = &ina226_info;
@@ -1024,7 +1027,7 @@ static int ina2xx_probe(struct i2c_client *client)
10241027
indio_dev->num_channels = ARRAY_SIZE(ina219_channels);
10251028
indio_dev->info = &ina219_info;
10261029
}
1027-
indio_dev->name = id->name;
1030+
indio_dev->name = id ? id->name : chip->config->name;
10281031

10291032
ret = devm_iio_kfifo_buffer_setup(&client->dev, indio_dev,
10301033
&ina2xx_setup_ops);

drivers/iio/adc/meson_saradc.c

Lines changed: 12 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -916,12 +916,6 @@ static int meson_sar_adc_hw_enable(struct iio_dev *indio_dev)
916916
goto err_vref;
917917
}
918918

919-
ret = clk_prepare_enable(priv->core_clk);
920-
if (ret) {
921-
dev_err(dev, "failed to enable core clk\n");
922-
goto err_core_clk;
923-
}
924-
925919
regval = FIELD_PREP(MESON_SAR_ADC_REG0_FIFO_CNT_IRQ_MASK, 1);
926920
regmap_update_bits(priv->regmap, MESON_SAR_ADC_REG0,
927921
MESON_SAR_ADC_REG0_FIFO_CNT_IRQ_MASK, regval);
@@ -948,8 +942,6 @@ static int meson_sar_adc_hw_enable(struct iio_dev *indio_dev)
948942
regmap_update_bits(priv->regmap, MESON_SAR_ADC_REG3,
949943
MESON_SAR_ADC_REG3_ADC_EN, 0);
950944
meson_sar_adc_set_bandgap(indio_dev, false);
951-
clk_disable_unprepare(priv->core_clk);
952-
err_core_clk:
953945
regulator_disable(priv->vref);
954946
err_vref:
955947
meson_sar_adc_unlock(indio_dev);
@@ -977,8 +969,6 @@ static void meson_sar_adc_hw_disable(struct iio_dev *indio_dev)
977969

978970
meson_sar_adc_set_bandgap(indio_dev, false);
979971

980-
clk_disable_unprepare(priv->core_clk);
981-
982972
regulator_disable(priv->vref);
983973

984974
if (!ret)
@@ -1211,7 +1201,7 @@ static int meson_sar_adc_probe(struct platform_device *pdev)
12111201
if (IS_ERR(priv->clkin))
12121202
return dev_err_probe(dev, PTR_ERR(priv->clkin), "failed to get clkin\n");
12131203

1214-
priv->core_clk = devm_clk_get(dev, "core");
1204+
priv->core_clk = devm_clk_get_enabled(dev, "core");
12151205
if (IS_ERR(priv->core_clk))
12161206
return dev_err_probe(dev, PTR_ERR(priv->core_clk), "failed to get core clk\n");
12171207

@@ -1294,15 +1284,26 @@ static int meson_sar_adc_remove(struct platform_device *pdev)
12941284
static int meson_sar_adc_suspend(struct device *dev)
12951285
{
12961286
struct iio_dev *indio_dev = dev_get_drvdata(dev);
1287+
struct meson_sar_adc_priv *priv = iio_priv(indio_dev);
12971288

12981289
meson_sar_adc_hw_disable(indio_dev);
12991290

1291+
clk_disable_unprepare(priv->core_clk);
1292+
13001293
return 0;
13011294
}
13021295

13031296
static int meson_sar_adc_resume(struct device *dev)
13041297
{
13051298
struct iio_dev *indio_dev = dev_get_drvdata(dev);
1299+
struct meson_sar_adc_priv *priv = iio_priv(indio_dev);
1300+
int ret;
1301+
1302+
ret = clk_prepare_enable(priv->core_clk);
1303+
if (ret) {
1304+
dev_err(dev, "failed to enable core clk\n");
1305+
return ret;
1306+
}
13061307

13071308
return meson_sar_adc_hw_enable(indio_dev);
13081309
}

drivers/iio/common/cros_ec_sensors/cros_ec_sensors_core.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -253,7 +253,7 @@ int cros_ec_sensors_core_init(struct platform_device *pdev,
253253
platform_set_drvdata(pdev, indio_dev);
254254

255255
state->ec = ec->ec_dev;
256-
state->msg = devm_kzalloc(&pdev->dev,
256+
state->msg = devm_kzalloc(&pdev->dev, sizeof(*state->msg) +
257257
max((u16)sizeof(struct ec_params_motion_sense),
258258
state->ec->max_response), GFP_KERNEL);
259259
if (!state->msg)

drivers/iio/frequency/admv1013.c

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -344,9 +344,12 @@ static int admv1013_update_quad_filters(struct admv1013_state *st)
344344

345345
static int admv1013_update_mixer_vgate(struct admv1013_state *st)
346346
{
347-
unsigned int vcm, mixer_vgate;
347+
unsigned int mixer_vgate;
348+
int vcm;
348349

349350
vcm = regulator_get_voltage(st->reg);
351+
if (vcm < 0)
352+
return vcm;
350353

351354
if (vcm < 1800000)
352355
mixer_vgate = (2389 * vcm / 1000000 + 8100) / 100;

0 commit comments

Comments
 (0)