Merge commit '7566b06bc28508ec9c88917e4422b7633c860459'

* commit '7566b06bc28508ec9c88917e4422b7633c860459':
  iio: imu: inv_icm42670: add drive-open-drain setting
  spi: rockchip-slave: Get rid of the sram driver dependency
  iio: imu: inv_icm42670: use low pass filter bypassed
  pinctrl: rockchip: rk3328: Fix pinmux for GPIO2-B

Change-Id: Ie4872af2463e81fcbbdabf6ee1df4d336e482141
This commit is contained in:
Tao Huang
2025-01-13 19:58:49 +08:00
4 changed files with 65 additions and 47 deletions

View File

@@ -166,6 +166,28 @@
#define BIT_ACCEL_UI_FS_SEL_MASK GENMASK(6, 5)
#define BIT_ACCEL_ODR_MASK GENMASK(3, 0)
/*
* GYRO_CONFIG1
* Register Name : GYRO_CONFIG1
*/
/*
* gyro_ui_filt_bw
* Selects GYRO UI low pass filter bandwidth
*
* 000: Low pass filter bypassed
* 001: 180 Hz
* 010: 121 Hz
* 011: 73 Hz
* 100: 53 Hz
* 101: 34 Hz
* 110: 25 Hz
* 111: 16 Hz
*
* This field can be changed on-the-fly even if gyro sensor is on
*/
#define GYRO_CONFIG1_GYRO_UI_FILT_BW_MASK 0x07
/* Bank0 REG_GYRO_CONFIG1 */
#define BIT_GYR_UI_FLT_BW_BYPASS 0x00
#define BIT_GYR_UI_FLT_BW_180HZ 0x01
@@ -182,6 +204,23 @@
#define BIT_GYR_UI_AVG_IND_32X 0x40
#define BIT_GYR_UI_AVG_IND_64X 0x50
/*
* accel_ui_filt_bw
* Selects ACCEL UI low pass filter bandwidth
*
* 000: Low pass filter bypassed
* 001: 180 Hz
* 010: 121 Hz
* 011: 73 Hz
* 100: 53 Hz
* 101: 34 Hz
* 110: 25 Hz
* 111: 16 Hz
*
* This field can be changed on-the-fly even if accel sensor is on
*/
#define ACCEL_CONFIG1_ACCEL_UI_FILT_BW_MASK 0x07
/* Bank0 REG_ACCEL_CONFIG1 */
#define BIT_ACC_FILT_BW_IND_BYPASS 0x00
#define BIT_ACC_FILT_BW_IND_180HZ 0x01
@@ -204,12 +243,12 @@
#define SHIFT_INT1_POLARITY 0x00
#define BIT_ONLY_INT1_ACTIVE_HIGH \
((1 << SHIFT_INT1_POLARITY) | \
(1 << SHIFT_INT1_DRIVE_CIRCUIT) | \
(0 << SHIFT_INT1_MODE))
#define BIT_ONLY_INT1_ACTIVE_LOW \
((0 << SHIFT_INT1_POLARITY) | \
(1 << SHIFT_INT1_DRIVE_CIRCUIT) | \
(0 << SHIFT_INT1_MODE))
#define BIT_ONLY_INT1_OPEN_DRAIN (0 << SHIFT_INT1_DRIVE_CIRCUIT)
#define BIT_ONLY_INT1_PUSH_PULL (1 << SHIFT_INT1_DRIVE_CIRCUIT)
/* Bank0 REG_PWR_MGMT_0 */
#define BIT_PWR_MGMTO_ACCEL_LP_CLK_SEL BIT(7)

View File

@@ -988,6 +988,22 @@ static int icm42670_chip_init(struct icm42670_data *data, icm42670_bus_setup bus
return ret;
}
ret = regmap_update_bits(data->regmap, REG_GYRO_CONFIG1,
GYRO_CONFIG1_GYRO_UI_FILT_BW_MASK,
BIT_GYR_UI_FLT_BW_BYPASS);
if (ret < 0) {
dev_err(dev, "icm42670 set gyro ln bw failed!\r\n");
return ret;
}
ret = regmap_update_bits(data->regmap, REG_ACCEL_CONFIG1,
ACCEL_CONFIG1_ACCEL_UI_FILT_BW_MASK,
BIT_ACC_FILT_BW_IND_BYPASS);
if (ret < 0) {
dev_err(dev, "icm42670 set accel ln bw failed!\r\n");
return ret;
}
ret = regmap_write(data->regmap, REG_INT_CONFIG_REG, data->irq_mask);
if (ret < 0)
return ret;
@@ -1055,6 +1071,11 @@ int icm42670_core_probe(struct regmap *regmap,
return -EINVAL;
}
if (device_property_read_bool(dev, "drive-open-drain"))
data->irq_mask |= BIT_ONLY_INT1_OPEN_DRAIN;
else
data->irq_mask |= BIT_ONLY_INT1_PUSH_PULL;
data->vdd_supply = devm_regulator_get(dev, "vcc_3v3_s0");
if (IS_ERR(data->vdd_supply)) {
dev_err(dev, "Could not find vdd_avdd!\n");

View File

@@ -719,49 +719,7 @@ static struct rockchip_mux_recalced_data rk3308_mux_recalced_data[] = {
static struct rockchip_mux_recalced_data rk3328_mux_recalced_data[] = {
{
.num = 2,
.pin = 8,
.reg = 0x24,
.bit = 0,
.mask = 0x3
}, {
.num = 2,
.pin = 9,
.reg = 0x24,
.bit = 2,
.mask = 0x3
}, {
.num = 2,
.pin = 10,
.reg = 0x24,
.bit = 4,
.mask = 0x3
}, {
.num = 2,
.pin = 11,
.reg = 0x24,
.bit = 6,
.mask = 0x3
}, {
.num = 2,
.pin = 12,
.reg = 0x24,
.bit = 8,
.mask = 0x3
}, {
/* gpio2_b7_sel */
.num = 2,
.pin = 13,
.reg = 0x24,
.bit = 10,
.mask = 0x3
}, {
.num = 2,
.pin = 14,
.reg = 0x24,
.bit = 12,
.mask = 0x3
}, {
.num = 2,
.pin = 15,
.reg = 0x28,

View File

@@ -813,9 +813,9 @@ static int rockchip_spi_slave_probe(struct platform_device *pdev)
rs->max_transfer_size = resource_size(&sram_res);
rs->dma_phys = sram_res.start;
rs->dma_buf = devm_ioremap_resource(&pdev->dev, &sram_res);
if (IS_ERR(rs->dma_buf)) {
ret = PTR_ERR(rs->dma_buf);
rs->dma_buf = devm_ioremap(&pdev->dev, sram_res.start, resource_size(&sram_res));
if (!rs->dma_buf) {
ret = -ENOMEM;
goto err_put_ctlr;
}
dev_err(&pdev->dev, "set sram_buf\n");