提交 db318248 编写于 作者: L Linus Torvalds

Merge tag 'char-misc-6.1-rc7' 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 driver fixes for 6.1-rc7, they include:

   - build warning fix for the vdso when using new versions of grep

   - iio driver fixes for reported issues

   - small nvmem driver fixes

   - fpga Kconfig fix

   - interconnect dt binding fix

  All of these have been in linux-next with no reported issues"

* tag 'char-misc-6.1-rc7' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/char-misc:
  lib/vdso: use "grep -E" instead of "egrep"
  nvmem: lan9662-otp: Change return type of lan9662_otp_wait_flag_clear()
  nvmem: rmem: Fix return value check in rmem_read()
  fpga: m10bmc-sec: Fix kconfig dependencies
  dt-bindings: iio: adc: Remove the property "aspeed,trim-data-valid"
  iio: adc: aspeed: Remove the trim valid dts property.
  iio: core: Fix entry not deleted when iio_register_sw_trigger_type() fails
  iio: accel: bma400: Fix memory leak in bma400_get_steps_reg()
  iio: light: rpr0521: add missing Kconfig dependencies
  iio: health: afe4404: Fix oob read in afe4404_[read|write]_raw
  iio: health: afe4403: Fix oob read in afe4403_read_raw
  iio: light: apds9960: fix wrong register for gesture gain
  dt-bindings: interconnect: qcom,msm8998-bwmon: Correct SC7280 CPU compatible
...@@ -62,13 +62,6 @@ properties: ...@@ -62,13 +62,6 @@ properties:
description: description:
Inform the driver that last channel will be used to sensor battery. Inform the driver that last channel will be used to sensor battery.
aspeed,trim-data-valid:
type: boolean
description: |
The ADC reference voltage can be calibrated to obtain the trimming
data which will be stored in otp. This property informs the driver that
the data store in the otp is valid.
required: required:
- compatible - compatible
- reg - reg
......
...@@ -24,7 +24,7 @@ properties: ...@@ -24,7 +24,7 @@ properties:
oneOf: oneOf:
- items: - items:
- enum: - enum:
- qcom,sc7280-bwmon - qcom,sc7280-cpu-bwmon
- qcom,sdm845-bwmon - qcom,sdm845-bwmon
- const: qcom,msm8998-bwmon - const: qcom,msm8998-bwmon
- const: qcom,msm8998-bwmon # BWMON v4 - const: qcom,msm8998-bwmon # BWMON v4
......
...@@ -246,7 +246,9 @@ config FPGA_MGR_VERSAL_FPGA ...@@ -246,7 +246,9 @@ config FPGA_MGR_VERSAL_FPGA
config FPGA_M10_BMC_SEC_UPDATE config FPGA_M10_BMC_SEC_UPDATE
tristate "Intel MAX10 BMC Secure Update driver" tristate "Intel MAX10 BMC Secure Update driver"
depends on MFD_INTEL_M10_BMC && FW_UPLOAD depends on MFD_INTEL_M10_BMC
select FW_LOADER
select FW_UPLOAD
help help
Secure update support for the Intel MAX10 board management Secure update support for the Intel MAX10 board management
controller. controller.
......
...@@ -805,8 +805,10 @@ static int bma400_get_steps_reg(struct bma400_data *data, int *val) ...@@ -805,8 +805,10 @@ static int bma400_get_steps_reg(struct bma400_data *data, int *val)
ret = regmap_bulk_read(data->regmap, BMA400_STEP_CNT0_REG, ret = regmap_bulk_read(data->regmap, BMA400_STEP_CNT0_REG,
steps_raw, BMA400_STEP_RAW_LEN); steps_raw, BMA400_STEP_RAW_LEN);
if (ret) if (ret) {
kfree(steps_raw);
return ret; return ret;
}
*val = get_unaligned_le24(steps_raw); *val = get_unaligned_le24(steps_raw);
kfree(steps_raw); kfree(steps_raw);
return IIO_VAL_INT; return IIO_VAL_INT;
......
...@@ -202,6 +202,8 @@ static int aspeed_adc_set_trim_data(struct iio_dev *indio_dev) ...@@ -202,6 +202,8 @@ static int aspeed_adc_set_trim_data(struct iio_dev *indio_dev)
((scu_otp) & ((scu_otp) &
(data->model_data->trim_locate->field)) >> (data->model_data->trim_locate->field)) >>
__ffs(data->model_data->trim_locate->field); __ffs(data->model_data->trim_locate->field);
if (!trimming_val)
trimming_val = 0x8;
} }
dev_dbg(data->dev, dev_dbg(data->dev,
"trimming val = %d, offset = %08x, fields = %08x\n", "trimming val = %d, offset = %08x, fields = %08x\n",
...@@ -563,12 +565,9 @@ static int aspeed_adc_probe(struct platform_device *pdev) ...@@ -563,12 +565,9 @@ static int aspeed_adc_probe(struct platform_device *pdev)
if (ret) if (ret)
return ret; return ret;
if (of_find_property(data->dev->of_node, "aspeed,trim-data-valid",
NULL)) {
ret = aspeed_adc_set_trim_data(indio_dev); ret = aspeed_adc_set_trim_data(indio_dev);
if (ret) if (ret)
return ret; return ret;
}
if (of_find_property(data->dev->of_node, "aspeed,battery-sensing", if (of_find_property(data->dev->of_node, "aspeed,battery-sensing",
NULL)) { NULL)) {
......
...@@ -245,14 +245,14 @@ static int afe4403_read_raw(struct iio_dev *indio_dev, ...@@ -245,14 +245,14 @@ static int afe4403_read_raw(struct iio_dev *indio_dev,
int *val, int *val2, long mask) int *val, int *val2, long mask)
{ {
struct afe4403_data *afe = iio_priv(indio_dev); struct afe4403_data *afe = iio_priv(indio_dev);
unsigned int reg = afe4403_channel_values[chan->address]; unsigned int reg, field;
unsigned int field = afe4403_channel_leds[chan->address];
int ret; int ret;
switch (chan->type) { switch (chan->type) {
case IIO_INTENSITY: case IIO_INTENSITY:
switch (mask) { switch (mask) {
case IIO_CHAN_INFO_RAW: case IIO_CHAN_INFO_RAW:
reg = afe4403_channel_values[chan->address];
ret = afe4403_read(afe, reg, val); ret = afe4403_read(afe, reg, val);
if (ret) if (ret)
return ret; return ret;
...@@ -262,6 +262,7 @@ static int afe4403_read_raw(struct iio_dev *indio_dev, ...@@ -262,6 +262,7 @@ static int afe4403_read_raw(struct iio_dev *indio_dev,
case IIO_CURRENT: case IIO_CURRENT:
switch (mask) { switch (mask) {
case IIO_CHAN_INFO_RAW: case IIO_CHAN_INFO_RAW:
field = afe4403_channel_leds[chan->address];
ret = regmap_field_read(afe->fields[field], val); ret = regmap_field_read(afe->fields[field], val);
if (ret) if (ret)
return ret; return ret;
......
...@@ -250,20 +250,20 @@ static int afe4404_read_raw(struct iio_dev *indio_dev, ...@@ -250,20 +250,20 @@ static int afe4404_read_raw(struct iio_dev *indio_dev,
int *val, int *val2, long mask) int *val, int *val2, long mask)
{ {
struct afe4404_data *afe = iio_priv(indio_dev); struct afe4404_data *afe = iio_priv(indio_dev);
unsigned int value_reg = afe4404_channel_values[chan->address]; unsigned int value_reg, led_field, offdac_field;
unsigned int led_field = afe4404_channel_leds[chan->address];
unsigned int offdac_field = afe4404_channel_offdacs[chan->address];
int ret; int ret;
switch (chan->type) { switch (chan->type) {
case IIO_INTENSITY: case IIO_INTENSITY:
switch (mask) { switch (mask) {
case IIO_CHAN_INFO_RAW: case IIO_CHAN_INFO_RAW:
value_reg = afe4404_channel_values[chan->address];
ret = regmap_read(afe->regmap, value_reg, val); ret = regmap_read(afe->regmap, value_reg, val);
if (ret) if (ret)
return ret; return ret;
return IIO_VAL_INT; return IIO_VAL_INT;
case IIO_CHAN_INFO_OFFSET: case IIO_CHAN_INFO_OFFSET:
offdac_field = afe4404_channel_offdacs[chan->address];
ret = regmap_field_read(afe->fields[offdac_field], val); ret = regmap_field_read(afe->fields[offdac_field], val);
if (ret) if (ret)
return ret; return ret;
...@@ -273,6 +273,7 @@ static int afe4404_read_raw(struct iio_dev *indio_dev, ...@@ -273,6 +273,7 @@ static int afe4404_read_raw(struct iio_dev *indio_dev,
case IIO_CURRENT: case IIO_CURRENT:
switch (mask) { switch (mask) {
case IIO_CHAN_INFO_RAW: case IIO_CHAN_INFO_RAW:
led_field = afe4404_channel_leds[chan->address];
ret = regmap_field_read(afe->fields[led_field], val); ret = regmap_field_read(afe->fields[led_field], val);
if (ret) if (ret)
return ret; return ret;
...@@ -295,19 +296,20 @@ static int afe4404_write_raw(struct iio_dev *indio_dev, ...@@ -295,19 +296,20 @@ static int afe4404_write_raw(struct iio_dev *indio_dev,
int val, int val2, long mask) int val, int val2, long mask)
{ {
struct afe4404_data *afe = iio_priv(indio_dev); struct afe4404_data *afe = iio_priv(indio_dev);
unsigned int led_field = afe4404_channel_leds[chan->address]; unsigned int led_field, offdac_field;
unsigned int offdac_field = afe4404_channel_offdacs[chan->address];
switch (chan->type) { switch (chan->type) {
case IIO_INTENSITY: case IIO_INTENSITY:
switch (mask) { switch (mask) {
case IIO_CHAN_INFO_OFFSET: case IIO_CHAN_INFO_OFFSET:
offdac_field = afe4404_channel_offdacs[chan->address];
return regmap_field_write(afe->fields[offdac_field], val); return regmap_field_write(afe->fields[offdac_field], val);
} }
break; break;
case IIO_CURRENT: case IIO_CURRENT:
switch (mask) { switch (mask) {
case IIO_CHAN_INFO_RAW: case IIO_CHAN_INFO_RAW:
led_field = afe4404_channel_leds[chan->address];
return regmap_field_write(afe->fields[led_field], val); return regmap_field_write(afe->fields[led_field], val);
} }
break; break;
......
...@@ -58,8 +58,12 @@ int iio_register_sw_trigger_type(struct iio_sw_trigger_type *t) ...@@ -58,8 +58,12 @@ int iio_register_sw_trigger_type(struct iio_sw_trigger_type *t)
t->group = configfs_register_default_group(iio_triggers_group, t->name, t->group = configfs_register_default_group(iio_triggers_group, t->name,
&iio_trigger_type_group_type); &iio_trigger_type_group_type);
if (IS_ERR(t->group)) if (IS_ERR(t->group)) {
mutex_lock(&iio_trigger_types_lock);
list_del(&t->list);
mutex_unlock(&iio_trigger_types_lock);
ret = PTR_ERR(t->group); ret = PTR_ERR(t->group);
}
return ret; return ret;
} }
......
...@@ -293,6 +293,8 @@ config RPR0521 ...@@ -293,6 +293,8 @@ config RPR0521
tristate "ROHM RPR0521 ALS and proximity sensor driver" tristate "ROHM RPR0521 ALS and proximity sensor driver"
depends on I2C depends on I2C
select REGMAP_I2C select REGMAP_I2C
select IIO_BUFFER
select IIO_TRIGGERED_BUFFER
help help
Say Y here if you want to build support for ROHM's RPR0521 Say Y here if you want to build support for ROHM's RPR0521
ambient light and proximity sensor device. ambient light and proximity sensor device.
......
...@@ -54,9 +54,6 @@ ...@@ -54,9 +54,6 @@
#define APDS9960_REG_CONTROL_PGAIN_MASK_SHIFT 2 #define APDS9960_REG_CONTROL_PGAIN_MASK_SHIFT 2
#define APDS9960_REG_CONFIG_2 0x90 #define APDS9960_REG_CONFIG_2 0x90
#define APDS9960_REG_CONFIG_2_GGAIN_MASK 0x60
#define APDS9960_REG_CONFIG_2_GGAIN_MASK_SHIFT 5
#define APDS9960_REG_ID 0x92 #define APDS9960_REG_ID 0x92
#define APDS9960_REG_STATUS 0x93 #define APDS9960_REG_STATUS 0x93
...@@ -77,6 +74,9 @@ ...@@ -77,6 +74,9 @@
#define APDS9960_REG_GCONF_1_GFIFO_THRES_MASK_SHIFT 6 #define APDS9960_REG_GCONF_1_GFIFO_THRES_MASK_SHIFT 6
#define APDS9960_REG_GCONF_2 0xa3 #define APDS9960_REG_GCONF_2 0xa3
#define APDS9960_REG_GCONF_2_GGAIN_MASK 0x60
#define APDS9960_REG_GCONF_2_GGAIN_MASK_SHIFT 5
#define APDS9960_REG_GOFFSET_U 0xa4 #define APDS9960_REG_GOFFSET_U 0xa4
#define APDS9960_REG_GOFFSET_D 0xa5 #define APDS9960_REG_GOFFSET_D 0xa5
#define APDS9960_REG_GPULSE 0xa6 #define APDS9960_REG_GPULSE 0xa6
...@@ -396,9 +396,9 @@ static int apds9960_set_pxs_gain(struct apds9960_data *data, int val) ...@@ -396,9 +396,9 @@ static int apds9960_set_pxs_gain(struct apds9960_data *data, int val)
} }
ret = regmap_update_bits(data->regmap, ret = regmap_update_bits(data->regmap,
APDS9960_REG_CONFIG_2, APDS9960_REG_GCONF_2,
APDS9960_REG_CONFIG_2_GGAIN_MASK, APDS9960_REG_GCONF_2_GGAIN_MASK,
idx << APDS9960_REG_CONFIG_2_GGAIN_MASK_SHIFT); idx << APDS9960_REG_GCONF_2_GGAIN_MASK_SHIFT);
if (!ret) if (!ret)
data->pxs_gain = idx; data->pxs_gain = idx;
mutex_unlock(&data->lock); mutex_unlock(&data->lock);
......
...@@ -36,7 +36,7 @@ struct lan9662_otp { ...@@ -36,7 +36,7 @@ struct lan9662_otp {
void __iomem *base; void __iomem *base;
}; };
static bool lan9662_otp_wait_flag_clear(void __iomem *reg, u32 flag) static int lan9662_otp_wait_flag_clear(void __iomem *reg, u32 flag)
{ {
u32 val; u32 val;
......
...@@ -37,9 +37,9 @@ static int rmem_read(void *context, unsigned int offset, ...@@ -37,9 +37,9 @@ static int rmem_read(void *context, unsigned int offset,
* but as of Dec 2020 this isn't possible on arm64. * but as of Dec 2020 this isn't possible on arm64.
*/ */
addr = memremap(priv->mem->base, available, MEMREMAP_WB); addr = memremap(priv->mem->base, available, MEMREMAP_WB);
if (IS_ERR(addr)) { if (!addr) {
dev_err(priv->dev, "Failed to remap memory region\n"); dev_err(priv->dev, "Failed to remap memory region\n");
return PTR_ERR(addr); return -ENOMEM;
} }
count = memory_read_from_buffer(val, bytes, &off, addr, available); count = memory_read_from_buffer(val, bytes, &off, addr, available);
......
...@@ -17,6 +17,6 @@ $(error ARCH_REL_TYPE_ABS is not set) ...@@ -17,6 +17,6 @@ $(error ARCH_REL_TYPE_ABS is not set)
endif endif
quiet_cmd_vdso_check = VDSOCHK $@ quiet_cmd_vdso_check = VDSOCHK $@
cmd_vdso_check = if $(OBJDUMP) -R $@ | egrep -h "$(ARCH_REL_TYPE_ABS)"; \ cmd_vdso_check = if $(OBJDUMP) -R $@ | grep -E -h "$(ARCH_REL_TYPE_ABS)"; \
then (echo >&2 "$@: dynamic relocations are not supported"; \ then (echo >&2 "$@: dynamic relocations are not supported"; \
rm -f $@; /bin/false); fi rm -f $@; /bin/false); fi
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册