Skip to content

Commit 2d70a54

Browse files
authored
Merge branch 'rpi-6.12.y' into iommu-202508
2 parents 59a5094 + 670a8ef commit 2d70a54

File tree

10 files changed

+132
-40
lines changed

10 files changed

+132
-40
lines changed

.github/workflows/ci_checkpatch.conf

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,3 +2,4 @@
22
--ignore FILE_PATH_CHANGES
33
--ignore GIT_COMMIT_ID
44
--ignore SPDX_LICENSE_TAG
5+
--ignore UNKNOWN_COMMIT_ID

Documentation/hwmon/ina2xx.rst

Lines changed: 18 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,16 @@ Supported chips:
5353

5454
https://www.ti.com/
5555

56+
* Texas Instruments INA260
57+
58+
Prefix: 'ina260'
59+
60+
Addresses: I2C 0x40 - 0x4f
61+
62+
Datasheet: Publicly available at the Texas Instruments website
63+
64+
https://www.ti.com/
65+
5666
Author: Lothar Felten <[email protected]>
5767

5868
Description
@@ -72,6 +82,9 @@ INA230 and INA231 are high or low side current shunt and power monitors
7282
with an I2C interface. The chips monitor both a shunt voltage drop and
7383
bus supply voltage.
7484

85+
INA260 is a high or low side current and power monitor with integrated shunt
86+
resistor.
87+
7588
The shunt value in micro-ohms can be set via platform data or device tree at
7689
compile-time or via the shunt_resistor attribute in sysfs at run-time. Please
7790
refer to the Documentation/devicetree/bindings/hwmon/ti,ina2xx.yaml for bindings
@@ -87,16 +100,16 @@ The actual programmed interval may vary from the desired value.
87100
General sysfs entries
88101
---------------------
89102

90-
======================= ===============================
103+
======================= ===============================================
91104
in0_input Shunt voltage(mV) channel
92105
in1_input Bus voltage(mV) channel
93106
curr1_input Current(mA) measurement channel
94107
power1_input Power(uW) measurement channel
95-
shunt_resistor Shunt resistance(uOhm) channel
96-
======================= ===============================
108+
shunt_resistor Shunt resistance(uOhm) channel (not for ina260)
109+
======================= ===============================================
97110

98-
Sysfs entries for ina226, ina230 and ina231 only
99-
------------------------------------------------
111+
Additional sysfs entries for ina226, ina230, ina231, and ina260
112+
---------------------------------------------------------------
100113

101114
======================= ====================================================
102115
curr1_lcrit Critical low current

arch/arm/boot/dts/overlays/README

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4543,7 +4543,7 @@ Load: <Deprecated>
45434543

45444544
Name: sc16is752-spi1
45454545
Info: This overlay is now deprecated. Use
4546-
"dtoverlay=sc16is75x-spi,sc16is752,spi1-0,..." instead.
4546+
"dtoverlay=sc16is75x-spi,sc16is752,spi1-1cs,spi1-0,..." instead.
45474547
Load: <Deprecated>
45484548

45494549

@@ -4558,6 +4558,8 @@ Params: sc16is750 Device is a SC16IS750 UART (default on)
45584558
(boolean, required)
45594559
int_pin GPIO used for IRQ (default 24)
45604560
xtal On-board crystal frequency (default 14745600)
4561+
spi1-1cs A special case to support sc16is752-spi1. Not
4562+
intended for general use.
45614563

45624564

45634565
Name: sdhost

arch/arm/boot/dts/overlays/overlay_map.dts

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -292,16 +292,12 @@
292292
renamed = "sc16is75x-spi,sc16is750,spi0-0";
293293
};
294294

295-
sc16is750-spi1 {
296-
renamed = "sc16is75x-spi,sc16is750,spi1-0";
297-
};
298-
299295
sc16is752-spi0 {
300296
renamed = "sc16is75x-spi,sc16is752,spi0-0";
301297
};
302298

303299
sc16is752-spi1 {
304-
renamed = "sc16is75x-spi,sc16is752,spi1-0";
300+
renamed = "sc16is75x-spi,sc16is752,spi1-1cs,spi1-0";
305301
};
306302

307303
sdhost {

arch/arm/boot/dts/overlays/sc16is75x-spi-overlay.dts

Lines changed: 36 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,14 +53,48 @@
5353
fragment@3 {
5454
target = <&gpio>;
5555
__overlay__ {
56-
sc16is75x_pins: sc16is75x_pins@24 {
56+
sc16is75x_pins: sc16is75x_pins@18 {
5757
brcm,pins = <24>;
5858
brcm,function = <BCM2835_FSEL_GPIO_IN>;
5959
brcm,pull = <BCM2835_PUD_OFF>;
6060
};
6161
};
6262
};
6363

64+
fragment@4 {
65+
target = <&gpio>;
66+
__dormant__ {
67+
spi1_pins: spi1_pins {
68+
brcm,pins = <19 20 21>;
69+
brcm,function = <3>; /* alt4 */
70+
};
71+
72+
spi1_cs_pins: spi1_cs_pins {
73+
brcm,pins = <18>;
74+
brcm,function = <1>; /* output */
75+
};
76+
};
77+
};
78+
79+
fragment@5 {
80+
target = <&spi1>;
81+
__dormant__ {
82+
#address-cells = <1>;
83+
#size-cells = <0>;
84+
pinctrl-names = "default";
85+
pinctrl-0 = <&spi1_pins &spi1_cs_pins>;
86+
cs-gpios = <&gpio 18 1>;
87+
status = "okay";
88+
};
89+
};
90+
91+
fragment@6 {
92+
target = <&aux>;
93+
__dormant__ {
94+
status = "okay";
95+
};
96+
};
97+
6498
__overrides__ {
6599
sc16is750 = <&sc16is75x>,"compatible=nxp,sc16is750",
66100
<&sc16is75x>, "name=sc16is750@0";
@@ -80,6 +114,7 @@
80114
spi1-0 = <0>, "-0",
81115
<&sc16is75x_frag>, "target:0=", <&spi1>,
82116
<&sc16is75x_pins>, "name=sc16is75x_spi1_0_pins";
117+
spi1-1cs = <0>,"+4+5+6";
83118
spi1-1 = <0>, "-0",
84119
<&sc16is75x_frag>, "target:0=", <&spi1>,
85120
<&sc16is75x>, "reg:0=1",

arch/arm64/mm/dma-mapping.c

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,22 @@ void arch_sync_dma_for_device(phys_addr_t paddr, size_t size,
1616
enum dma_data_direction dir)
1717
{
1818
unsigned long start = (unsigned long)phys_to_virt(paddr);
19+
unsigned long end = start + size;
1920

20-
dcache_clean_poc(start, start + size);
21+
switch (dir) {
22+
case DMA_BIDIRECTIONAL:
23+
dcache_clean_inval_poc(start, end);
24+
break;
25+
case DMA_TO_DEVICE:
26+
dcache_clean_poc(start, end);
27+
break;
28+
case DMA_FROM_DEVICE:
29+
dcache_inval_poc(start, end);
30+
break;
31+
case DMA_NONE:
32+
default:
33+
break;
34+
}
2135
}
2236

2337
void arch_sync_dma_for_cpu(phys_addr_t paddr, size_t size,

drivers/gpu/drm/panel/panel-ilitek-ili9881c.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2512,6 +2512,7 @@ static const struct ili9881c_desc nwe080_desc = {
25122512
.init_length = ARRAY_SIZE(nwe080_init),
25132513
.mode = &nwe080_default_mode,
25142514
.mode_flags = MIPI_DSI_MODE_VIDEO_SYNC_PULSE | MIPI_DSI_MODE_VIDEO,
2515+
.lanes = 4,
25152516
};
25162517

25172518
static const struct ili9881c_desc cfaf7201280a0_050tx_desc = {

drivers/hwmon/Kconfig

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2167,11 +2167,12 @@ config SENSORS_INA2XX
21672167
select REGMAP_I2C
21682168
help
21692169
If you say yes here you get support for INA219, INA220, INA226,
2170-
INA230, and INA231 power monitor chips.
2170+
INA230, INA231, and INA260 power monitor chips.
21712171

21722172
The INA2xx driver is configured for the default configuration of
21732173
the part as described in the datasheet.
2174-
Default value for Rshunt is 10 mOhms.
2174+
Default value for Rshunt is 10 mOhms except for INA260 which has an
2175+
internal 2 mOhm shunt resistor.
21752176
This driver can also be built as a module. If so, the module
21762177
will be called ina2xx.
21772178

drivers/hwmon/ina2xx.c

Lines changed: 41 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -56,12 +56,14 @@
5656
/* settings - depend on use case */
5757
#define INA219_CONFIG_DEFAULT 0x399F /* PGA=8 */
5858
#define INA226_CONFIG_DEFAULT 0x4527 /* averages=16 */
59+
#define INA260_CONFIG_DEFAULT 0x6527 /* averages=16 */
5960

6061
/* worst case is 68.10 ms (~14.6Hz, ina219) */
6162
#define INA2XX_CONVERSION_RATE 15
6263
#define INA2XX_MAX_DELAY 69 /* worst case delay in ms */
6364

6465
#define INA2XX_RSHUNT_DEFAULT 10000
66+
#define INA260_RSHUNT 2000
6567

6668
/* bit mask for reading the averaging setting in the configuration register */
6769
#define INA226_AVG_RD_MASK GENMASK(11, 9)
@@ -125,10 +127,12 @@ static const struct regmap_config ina2xx_regmap_config = {
125127
.writeable_reg = ina2xx_writeable_reg,
126128
};
127129

128-
enum ina2xx_ids { ina219, ina226 };
130+
enum ina2xx_ids { ina219, ina226, ina260 };
129131

130132
struct ina2xx_config {
131133
u16 config_default;
134+
bool has_alerts; /* chip supports alerts and limits */
135+
bool has_ishunt; /* chip has internal shunt resistor */
132136
int calibration_value;
133137
int shunt_div;
134138
int bus_voltage_shift;
@@ -155,6 +159,8 @@ static const struct ina2xx_config ina2xx_config[] = {
155159
.bus_voltage_shift = 3,
156160
.bus_voltage_lsb = 4000,
157161
.power_lsb_factor = 20,
162+
.has_alerts = false,
163+
.has_ishunt = false,
158164
},
159165
[ina226] = {
160166
.config_default = INA226_CONFIG_DEFAULT,
@@ -163,6 +169,17 @@ static const struct ina2xx_config ina2xx_config[] = {
163169
.bus_voltage_shift = 0,
164170
.bus_voltage_lsb = 1250,
165171
.power_lsb_factor = 25,
172+
.has_alerts = true,
173+
.has_ishunt = false,
174+
},
175+
[ina260] = {
176+
.config_default = INA260_CONFIG_DEFAULT,
177+
.shunt_div = 400,
178+
.bus_voltage_shift = 0,
179+
.bus_voltage_lsb = 1250,
180+
.power_lsb_factor = 8,
181+
.has_alerts = true,
182+
.has_ishunt = true,
166183
},
167184
};
168185

@@ -254,6 +271,15 @@ static int ina2xx_read_init(struct device *dev, int reg, long *val)
254271
unsigned int regval;
255272
int ret, retry;
256273

274+
if (data->config->has_ishunt) {
275+
/* No calibration needed */
276+
ret = regmap_read(regmap, reg, &regval);
277+
if (ret < 0)
278+
return ret;
279+
*val = ina2xx_get_value(data, reg, regval);
280+
return 0;
281+
}
282+
257283
for (retry = 5; retry; retry--) {
258284
ret = regmap_read(regmap, reg, &regval);
259285
if (ret < 0)
@@ -682,7 +708,7 @@ static umode_t ina2xx_is_visible(const void *_data, enum hwmon_sensor_types type
682708
case hwmon_chip:
683709
switch (attr) {
684710
case hwmon_chip_update_interval:
685-
if (chip == ina226)
711+
if (chip == ina226 || chip == ina260)
686712
return 0644;
687713
break;
688714
default:
@@ -791,7 +817,9 @@ static int ina2xx_init(struct device *dev, struct ina2xx_data *data)
791817
u32 shunt;
792818
int ret;
793819

794-
if (device_property_read_u32(dev, "shunt-resistor", &shunt) < 0)
820+
if (data->config->has_ishunt)
821+
shunt = INA260_RSHUNT;
822+
else if (device_property_read_u32(dev, "shunt-resistor", &shunt) < 0)
795823
shunt = INA2XX_RSHUNT_DEFAULT;
796824

797825
ret = ina2xx_set_shunt(data, shunt);
@@ -811,6 +839,9 @@ static int ina2xx_init(struct device *dev, struct ina2xx_data *data)
811839
FIELD_PREP(INA226_ALERT_POLARITY, active_high));
812840
}
813841

842+
if (data->config->has_ishunt)
843+
return 0;
844+
814845
/*
815846
* Calibration register is set to the best value, which eliminates
816847
* truncation errors on calculating current register in hardware.
@@ -856,7 +887,8 @@ static int ina2xx_probe(struct i2c_client *client)
856887

857888
hwmon_dev = devm_hwmon_device_register_with_info(dev, client->name,
858889
data, &ina2xx_chip_info,
859-
ina2xx_groups);
890+
data->config->has_ishunt ?
891+
NULL : ina2xx_groups);
860892
if (IS_ERR(hwmon_dev))
861893
return PTR_ERR(hwmon_dev);
862894

@@ -872,6 +904,7 @@ static const struct i2c_device_id ina2xx_id[] = {
872904
{ "ina226", ina226 },
873905
{ "ina230", ina226 },
874906
{ "ina231", ina226 },
907+
{ "ina260", ina260 },
875908
{ }
876909
};
877910
MODULE_DEVICE_TABLE(i2c, ina2xx_id);
@@ -897,6 +930,10 @@ static const struct of_device_id __maybe_unused ina2xx_of_match[] = {
897930
.compatible = "ti,ina231",
898931
.data = (void *)ina226
899932
},
933+
{
934+
.compatible = "ti,ina260",
935+
.data = (void *)ina260
936+
},
900937
{ },
901938
};
902939
MODULE_DEVICE_TABLE(of, ina2xx_of_match);

0 commit comments

Comments
 (0)