Skip to content

Commit b915881

Browse files
committed
Merge tag 'char-misc-6.9-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 char/misc/other driver fixes and new device ids for 6.9-rc7 that resolve some reported problems. Included in here are: - iio driver fixes - mei driver fix and new device ids - dyndbg bugfix - pvpanic-pci driver bugfix - slimbus driver bugfix - fpga new device id All have been in linux-next with no reported problems" * tag 'char-misc-6.9-rc7' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/char-misc: slimbus: qcom-ngd-ctrl: Add timeout for wait operation dyndbg: fix old BUG_ON in >control parser misc/pvpanic-pci: register attributes via pci_driver fpga: dfl-pci: add PCI subdevice ID for Intel D5005 card mei: me: add lunar lake point M DID mei: pxp: match against PCI_CLASS_DISPLAY_OTHER iio:imu: adis16475: Fix sync mode setting iio: accel: mxc4005: Reset chip on probe() and resume() iio: accel: mxc4005: Interrupt handling fixes dt-bindings: iio: health: maxim,max30102: fix compatible check iio: pressure: Fixes SPI support for BMP3xx devices iio: pressure: Fixes BME280 SPI driver data
2 parents 3c15237 + 98241a7 commit b915881

File tree

13 files changed

+118
-25
lines changed

13 files changed

+118
-25
lines changed

Documentation/devicetree/bindings/iio/health/maxim,max30102.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ allOf:
4242
properties:
4343
compatible:
4444
contains:
45-
const: maxim,max30100
45+
const: maxim,max30102
4646
then:
4747
properties:
4848
maxim,green-led-current-microamp: false

drivers/fpga/dfl-pci.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,7 @@ static void cci_pci_free_irq(struct pci_dev *pcidev)
7878
#define PCIE_DEVICE_ID_SILICOM_PAC_N5011 0x1001
7979
#define PCIE_DEVICE_ID_INTEL_DFL 0xbcce
8080
/* PCI Subdevice ID for PCIE_DEVICE_ID_INTEL_DFL */
81+
#define PCIE_SUBDEVICE_ID_INTEL_D5005 0x138d
8182
#define PCIE_SUBDEVICE_ID_INTEL_N6000 0x1770
8283
#define PCIE_SUBDEVICE_ID_INTEL_N6001 0x1771
8384
#define PCIE_SUBDEVICE_ID_INTEL_C6100 0x17d4
@@ -101,6 +102,8 @@ static struct pci_device_id cci_pcie_id_tbl[] = {
101102
{PCI_DEVICE(PCI_VENDOR_ID_INTEL, PCIE_DEVICE_ID_INTEL_PAC_D5005_VF),},
102103
{PCI_DEVICE(PCI_VENDOR_ID_SILICOM_DENMARK, PCIE_DEVICE_ID_SILICOM_PAC_N5010),},
103104
{PCI_DEVICE(PCI_VENDOR_ID_SILICOM_DENMARK, PCIE_DEVICE_ID_SILICOM_PAC_N5011),},
105+
{PCI_DEVICE_SUB(PCI_VENDOR_ID_INTEL, PCIE_DEVICE_ID_INTEL_DFL,
106+
PCI_VENDOR_ID_INTEL, PCIE_SUBDEVICE_ID_INTEL_D5005),},
104107
{PCI_DEVICE_SUB(PCI_VENDOR_ID_INTEL, PCIE_DEVICE_ID_INTEL_DFL,
105108
PCI_VENDOR_ID_INTEL, PCIE_SUBDEVICE_ID_INTEL_N6000),},
106109
{PCI_DEVICE_SUB(PCI_VENDOR_ID_INTEL, PCIE_DEVICE_ID_INTEL_DFL_VF,

drivers/iio/accel/mxc4005.c

Lines changed: 85 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
* Copyright (c) 2014, Intel Corporation.
66
*/
77

8+
#include <linux/delay.h>
89
#include <linux/module.h>
910
#include <linux/i2c.h>
1011
#include <linux/iio/iio.h>
@@ -27,18 +28,26 @@
2728
#define MXC4005_REG_ZOUT_UPPER 0x07
2829
#define MXC4005_REG_ZOUT_LOWER 0x08
2930

31+
#define MXC4005_REG_INT_MASK0 0x0A
32+
3033
#define MXC4005_REG_INT_MASK1 0x0B
3134
#define MXC4005_REG_INT_MASK1_BIT_DRDYE 0x01
3235

36+
#define MXC4005_REG_INT_CLR0 0x00
37+
3338
#define MXC4005_REG_INT_CLR1 0x01
3439
#define MXC4005_REG_INT_CLR1_BIT_DRDYC 0x01
40+
#define MXC4005_REG_INT_CLR1_SW_RST 0x10
3541

3642
#define MXC4005_REG_CONTROL 0x0D
3743
#define MXC4005_REG_CONTROL_MASK_FSR GENMASK(6, 5)
3844
#define MXC4005_CONTROL_FSR_SHIFT 5
3945

4046
#define MXC4005_REG_DEVICE_ID 0x0E
4147

48+
/* Datasheet does not specify a reset time, this is a conservative guess */
49+
#define MXC4005_RESET_TIME_US 2000
50+
4251
enum mxc4005_axis {
4352
AXIS_X,
4453
AXIS_Y,
@@ -62,6 +71,8 @@ struct mxc4005_data {
6271
s64 timestamp __aligned(8);
6372
} scan;
6473
bool trigger_enabled;
74+
unsigned int control;
75+
unsigned int int_mask1;
6576
};
6677

6778
/*
@@ -113,7 +124,9 @@ static bool mxc4005_is_readable_reg(struct device *dev, unsigned int reg)
113124
static bool mxc4005_is_writeable_reg(struct device *dev, unsigned int reg)
114125
{
115126
switch (reg) {
127+
case MXC4005_REG_INT_CLR0:
116128
case MXC4005_REG_INT_CLR1:
129+
case MXC4005_REG_INT_MASK0:
117130
case MXC4005_REG_INT_MASK1:
118131
case MXC4005_REG_CONTROL:
119132
return true;
@@ -330,23 +343,20 @@ static int mxc4005_set_trigger_state(struct iio_trigger *trig,
330343
{
331344
struct iio_dev *indio_dev = iio_trigger_get_drvdata(trig);
332345
struct mxc4005_data *data = iio_priv(indio_dev);
346+
unsigned int val;
333347
int ret;
334348

335349
mutex_lock(&data->mutex);
336-
if (state) {
337-
ret = regmap_write(data->regmap, MXC4005_REG_INT_MASK1,
338-
MXC4005_REG_INT_MASK1_BIT_DRDYE);
339-
} else {
340-
ret = regmap_write(data->regmap, MXC4005_REG_INT_MASK1,
341-
~MXC4005_REG_INT_MASK1_BIT_DRDYE);
342-
}
343350

351+
val = state ? MXC4005_REG_INT_MASK1_BIT_DRDYE : 0;
352+
ret = regmap_write(data->regmap, MXC4005_REG_INT_MASK1, val);
344353
if (ret < 0) {
345354
mutex_unlock(&data->mutex);
346355
dev_err(data->dev, "failed to update reg_int_mask1");
347356
return ret;
348357
}
349358

359+
data->int_mask1 = val;
350360
data->trigger_enabled = state;
351361
mutex_unlock(&data->mutex);
352362

@@ -382,6 +392,21 @@ static int mxc4005_chip_init(struct mxc4005_data *data)
382392

383393
dev_dbg(data->dev, "MXC4005 chip id %02x\n", reg);
384394

395+
ret = regmap_write(data->regmap, MXC4005_REG_INT_CLR1,
396+
MXC4005_REG_INT_CLR1_SW_RST);
397+
if (ret < 0)
398+
return dev_err_probe(data->dev, ret, "resetting chip\n");
399+
400+
fsleep(MXC4005_RESET_TIME_US);
401+
402+
ret = regmap_write(data->regmap, MXC4005_REG_INT_MASK0, 0);
403+
if (ret < 0)
404+
return dev_err_probe(data->dev, ret, "writing INT_MASK0\n");
405+
406+
ret = regmap_write(data->regmap, MXC4005_REG_INT_MASK1, 0);
407+
if (ret < 0)
408+
return dev_err_probe(data->dev, ret, "writing INT_MASK1\n");
409+
385410
return 0;
386411
}
387412

@@ -469,6 +494,58 @@ static int mxc4005_probe(struct i2c_client *client)
469494
return devm_iio_device_register(&client->dev, indio_dev);
470495
}
471496

497+
static int mxc4005_suspend(struct device *dev)
498+
{
499+
struct iio_dev *indio_dev = dev_get_drvdata(dev);
500+
struct mxc4005_data *data = iio_priv(indio_dev);
501+
int ret;
502+
503+
/* Save control to restore it on resume */
504+
ret = regmap_read(data->regmap, MXC4005_REG_CONTROL, &data->control);
505+
if (ret < 0)
506+
dev_err(data->dev, "failed to read reg_control\n");
507+
508+
return ret;
509+
}
510+
511+
static int mxc4005_resume(struct device *dev)
512+
{
513+
struct iio_dev *indio_dev = dev_get_drvdata(dev);
514+
struct mxc4005_data *data = iio_priv(indio_dev);
515+
int ret;
516+
517+
ret = regmap_write(data->regmap, MXC4005_REG_INT_CLR1,
518+
MXC4005_REG_INT_CLR1_SW_RST);
519+
if (ret) {
520+
dev_err(data->dev, "failed to reset chip: %d\n", ret);
521+
return ret;
522+
}
523+
524+
fsleep(MXC4005_RESET_TIME_US);
525+
526+
ret = regmap_write(data->regmap, MXC4005_REG_CONTROL, data->control);
527+
if (ret) {
528+
dev_err(data->dev, "failed to restore control register\n");
529+
return ret;
530+
}
531+
532+
ret = regmap_write(data->regmap, MXC4005_REG_INT_MASK0, 0);
533+
if (ret) {
534+
dev_err(data->dev, "failed to restore interrupt 0 mask\n");
535+
return ret;
536+
}
537+
538+
ret = regmap_write(data->regmap, MXC4005_REG_INT_MASK1, data->int_mask1);
539+
if (ret) {
540+
dev_err(data->dev, "failed to restore interrupt 1 mask\n");
541+
return ret;
542+
}
543+
544+
return 0;
545+
}
546+
547+
static DEFINE_SIMPLE_DEV_PM_OPS(mxc4005_pm_ops, mxc4005_suspend, mxc4005_resume);
548+
472549
static const struct acpi_device_id mxc4005_acpi_match[] = {
473550
{"MXC4005", 0},
474551
{"MXC6655", 0},
@@ -496,6 +573,7 @@ static struct i2c_driver mxc4005_driver = {
496573
.name = MXC4005_DRV_NAME,
497574
.acpi_match_table = mxc4005_acpi_match,
498575
.of_match_table = mxc4005_of_match,
576+
.pm = pm_sleep_ptr(&mxc4005_pm_ops),
499577
},
500578
.probe = mxc4005_probe,
501579
.id_table = mxc4005_id,

drivers/iio/imu/adis16475.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1289,6 +1289,7 @@ static int adis16475_config_sync_mode(struct adis16475 *st)
12891289
struct device *dev = &st->adis.spi->dev;
12901290
const struct adis16475_sync *sync;
12911291
u32 sync_mode;
1292+
u16 val;
12921293

12931294
/* default to internal clk */
12941295
st->clk_freq = st->info->int_clk * 1000;
@@ -1350,8 +1351,9 @@ static int adis16475_config_sync_mode(struct adis16475 *st)
13501351
* I'm keeping this for simplicity and avoiding extra variables
13511352
* in chip_info.
13521353
*/
1354+
val = ADIS16475_SYNC_MODE(sync->sync_mode);
13531355
ret = __adis_update_bits(&st->adis, ADIS16475_REG_MSG_CTRL,
1354-
ADIS16475_SYNC_MODE_MASK, sync->sync_mode);
1356+
ADIS16475_SYNC_MODE_MASK, val);
13551357
if (ret)
13561358
return ret;
13571359

drivers/iio/pressure/bmp280-core.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1233,6 +1233,7 @@ const struct bmp280_chip_info bmp380_chip_info = {
12331233
.chip_id = bmp380_chip_ids,
12341234
.num_chip_id = ARRAY_SIZE(bmp380_chip_ids),
12351235
.regmap_config = &bmp380_regmap_config,
1236+
.spi_read_extra_byte = true,
12361237
.start_up_time = 2000,
12371238
.channels = bmp380_channels,
12381239
.num_channels = 2,

drivers/iio/pressure/bmp280-spi.c

Lines changed: 4 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -96,15 +96,10 @@ static int bmp280_spi_probe(struct spi_device *spi)
9696

9797
chip_info = spi_get_device_match_data(spi);
9898

99-
switch (chip_info->chip_id[0]) {
100-
case BMP380_CHIP_ID:
101-
case BMP390_CHIP_ID:
99+
if (chip_info->spi_read_extra_byte)
102100
bmp_regmap_bus = &bmp380_regmap_bus;
103-
break;
104-
default:
101+
else
105102
bmp_regmap_bus = &bmp280_regmap_bus;
106-
break;
107-
}
108103

109104
regmap = devm_regmap_init(&spi->dev,
110105
bmp_regmap_bus,
@@ -127,7 +122,7 @@ static const struct of_device_id bmp280_of_spi_match[] = {
127122
{ .compatible = "bosch,bmp180", .data = &bmp180_chip_info },
128123
{ .compatible = "bosch,bmp181", .data = &bmp180_chip_info },
129124
{ .compatible = "bosch,bmp280", .data = &bmp280_chip_info },
130-
{ .compatible = "bosch,bme280", .data = &bmp280_chip_info },
125+
{ .compatible = "bosch,bme280", .data = &bme280_chip_info },
131126
{ .compatible = "bosch,bmp380", .data = &bmp380_chip_info },
132127
{ .compatible = "bosch,bmp580", .data = &bmp580_chip_info },
133128
{ },
@@ -139,7 +134,7 @@ static const struct spi_device_id bmp280_spi_id[] = {
139134
{ "bmp180", (kernel_ulong_t)&bmp180_chip_info },
140135
{ "bmp181", (kernel_ulong_t)&bmp180_chip_info },
141136
{ "bmp280", (kernel_ulong_t)&bmp280_chip_info },
142-
{ "bme280", (kernel_ulong_t)&bmp280_chip_info },
137+
{ "bme280", (kernel_ulong_t)&bme280_chip_info },
143138
{ "bmp380", (kernel_ulong_t)&bmp380_chip_info },
144139
{ "bmp580", (kernel_ulong_t)&bmp580_chip_info },
145140
{ }

drivers/iio/pressure/bmp280.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -423,6 +423,7 @@ struct bmp280_chip_info {
423423
int num_chip_id;
424424

425425
const struct regmap_config *regmap_config;
426+
bool spi_read_extra_byte;
426427

427428
const struct iio_chan_spec *channels;
428429
int num_channels;

drivers/misc/mei/hw-me-regs.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -115,6 +115,8 @@
115115
#define MEI_DEV_ID_ARL_S 0x7F68 /* Arrow Lake Point S */
116116
#define MEI_DEV_ID_ARL_H 0x7770 /* Arrow Lake Point H */
117117

118+
#define MEI_DEV_ID_LNL_M 0xA870 /* Lunar Lake Point M */
119+
118120
/*
119121
* MEI HW Section
120122
*/

drivers/misc/mei/pci-me.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -122,6 +122,8 @@ static const struct pci_device_id mei_me_pci_tbl[] = {
122122
{MEI_PCI_DEVICE(MEI_DEV_ID_ARL_S, MEI_ME_PCH15_CFG)},
123123
{MEI_PCI_DEVICE(MEI_DEV_ID_ARL_H, MEI_ME_PCH15_CFG)},
124124

125+
{MEI_PCI_DEVICE(MEI_DEV_ID_LNL_M, MEI_ME_PCH15_CFG)},
126+
125127
/* required last entry */
126128
{0, }
127129
};

drivers/misc/mei/pxp/mei_pxp.c

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -236,8 +236,11 @@ static int mei_pxp_component_match(struct device *dev, int subcomponent,
236236

237237
pdev = to_pci_dev(dev);
238238

239-
if (pdev->class != (PCI_CLASS_DISPLAY_VGA << 8) ||
240-
pdev->vendor != PCI_VENDOR_ID_INTEL)
239+
if (pdev->vendor != PCI_VENDOR_ID_INTEL)
240+
return 0;
241+
242+
if (pdev->class != (PCI_CLASS_DISPLAY_VGA << 8) &&
243+
pdev->class != (PCI_CLASS_DISPLAY_OTHER << 8))
241244
return 0;
242245

243246
if (subcomponent != I915_COMPONENT_PXP)

0 commit comments

Comments
 (0)