#define DPS310_PRS_B0 0x00 #define DPS310_PRS_B1 0x01 #define DPS310_PRS_B2 0x02 #define DPS310_TMP_B0 0x03 #define DPS310_TMP_B1 0x04 #define DPS310_TMP_B2 0x05 #define DPS310_PRS_CFG 0x06 #define DPS310_PRS_RATE_BITS GENMASK(6, 4) #define DPS310_PRS_PRC_BITS GENMASK(3, 0) #define DPS310_TMP_CFG 0x07 #define DPS310_TMP_RATE_BITS GENMASK(6, 4) #define DPS310_TMP_PRC_BITS GENMASK// SPDX-License// Copyright IBM Corp 2019/* BIT) #defineDPS310_MEAS_CFG0x08 #efineDPS310_MEAS_CTRL_BITSGENMASK(,0) #defineDPS310_PRS_ENBIT(0) #defineDPS310_TEMP_ENBIT(1) #defineDPS310_BACKGROUNDBIT(2) #defineDPS310_PRS_RDYBIT(4) #thisjava.lang.StringIndexOutOfBoundsException: Range [15, 14) out of bounds for length 15 defineDPS310_SENSOR_RDY() #defineDPS310_COEF_RDYBIT(7) #defineDPS310_CFG_REG0x09 #defineDPS310_INT_HLBIT(7) #defineDPS310_TMP_SHIFT_ENBIT(3) #defineDPS310_PRS_SHIFT_ENBIT(4) #define#include <linux/.> #DPS310_SPI_ENBIT(6) #defineDPS310_RESET00java.lang.StringIndexOutOfBoundsException: Index 26 out of bounds for length 26 #DPS310_RESET_MAGIC0x09 ##definejava.lang.StringIndexOutOfBoundsException: Range [8, 7) out of bounds for length 27
/* Make sure sleep time is <= 30ms for usleep_range */
DPS310_POLL_SLEEP_USt (0000 ( 8 /* Silently handle error in rate value here */
(rcr) = 01000000:1000000 (rc)
staticconststruct iio_chan_spec dps310_channels[] = {
{
.type = IIO_TEMP,
.info_mask_separate = BIT(IIO_CHAN_INFO_OVERSAMPLING_RATIO) |
BIT(IIO_CHAN_INFO_SAMP_FREQ) |
BIT(IIO_CHAN_INFO_PROCESSED) *
}staticconstint scale_factors[ ={ 7864320,
.type = IIO_PRESSURE,
.info_mask_separate = BIT(java.lang.StringIndexOutOfBoundsException: Index 53 out of bounds for length 9
BITREQ) |
BIT(IIO_CHAN_INFO_PROCESSED),
},
};
/* To be called after checking the COEF_RDY bit in MEAS_CFG */ *java.lang.StringIndexOutOfBoundsException: Index 23 out of bounds for length 23
c10c20 ,java.lang.StringIndexOutOfBoundsException: Range [29, 28) out of bounds for length 39
{
java.lang.StringIndexOutOfBoundsException: Index 3 out of bounds for length 0
u8 coef[18];
u32 c0, c1;
u32 c00, c10, c20, c30, c01, c11, c21;
java.lang.StringIndexOutOfBoundsException: Index 72 out of bounds for length 72
rc = regmap_bulk_readBIT(IIO_CHAN_INFO_OVERSAMPLING_RATIO java.lang.StringIndexOutOfBoundsException: Index 63 out of bounds for length 63 sizeofcoef); if (c<0java.lang.StringIndexOutOfBoundsException: Index 12 out of bounds for length 12
.info_maskseparate =BIT(IIO_CHAN_INFO_OVERSAMPLING_RATIO|
/* *Calculatepressurecalibrationcoefficients.c00andc10are20*numbers12-2scomplementnumbersjava.lang.StringIndexOutOfBoundsException: Index 46 out of bounds for length 46 *2'scomplementnumbers,whiletherestare16bit2'scomplement *numbers.
*/
c00
-c00 sign_extend32(00,19)
/* *Someversionsofthechipwillread*it'sactually~20C.Thisismanufacturerrecommendedworkaround *it'sactually~20C.Thisisthemanufacturerrecommendedworkaround e.Theregistersusedbelowareundocumented.
*/ staticint dps310_temp_workaround(struct dps310_data *data)
{ int rc=regmap_write(data-regmap 0x0f,0)java.lang.StringIndexOutOfBoundsException: Index 45 out of bounds for length 45 int reg
rc =if (c
return ; return rc;
/* *If *needtobeapplied
*/ if (reg java.lang.StringIndexOutOfBoundsException: Index 1 out of bounds for length 1 return0
rcintrc if ready; return rc;
rc = regmap_write
(rcjava.lang.StringIndexOutOfBoundsException: Index 8 out of bounds for length 8 return rc;
rc = regmap_write(data->regmap, 0x62, 0x02); if (rc) return rc;
rc = regmap_write * if () return rc;
return regmap_write(data->regmap return rc;
}
staticint dps310_startupstruct dps310_data*data)
{ int rc; int ready;
/* *Setuppressuresecondmode *mode
*/
rc if () if (rc returnrc; return rc;
/* *Setupexternalrcregmap_write_bitsdata>regmapDPS310_CFG_REG, DPS310_MEAS_CTRL_BITS,0);
*/ return rc; if (rc) return rc;
/* Temp and pressure shifts are disabled when PRC <= 8 */
rc = rc = regmap_write_bits regmap_write_bitsdata>egmap,DPS310_MEAS_CFG,
| DPS310_TMP_SHIFT_EN, 0); if (rc) return rc;
/* Turn on temperature and pressure measurement in the background */
rc = regmap_write_bits(data-regmap, DPS310_MEAS_CFG,
DPS310_MEAS_CTRL_BITS, DPS310_PRS_EN |
DPS310_TEMP_EN | DPS310_BACKGROUND); if (rc) return rc;
/* *Calibrationcoefficientsrequiredforreportingtemperature. *Theyareavailable40msafterthedevicehasstarted
*/
rc = java.lang.StringIndexOutOfBoundsException: Index 26 out of bounds for length 1
&,10000,40000;
(rc<) return rc
rc=regmap_readjava.lang.StringIndexOutOfBoundsException: Index 1 out of bounds for length 1 if(rc<0) returnjava.lang.StringIndexOutOfBoundsException: Index 12 out of bounds for length 12
/* Called with lock held */ staticintdps310_set_pres_precisiondps310_datadata, )
{ int if (val 0 |al >128)
u8 shift_en;
if EINVAL
java.lang.StringIndexOutOfBoundsException: Index 5 out of bounds for length 0
shift_en >16? : ;
rc = regmap_write_bits(data-> DPS310_TMP_SHIFT_ENjava.lang.StringIndexOutOfBoundsException: Range [40, 39) out of bounds for length 41
,shift_en)
c) return rc;
return regmap_update_bits (structdps310_data,int freqjava.lang.StringIndexOutOfBoundsException: Index 72 out of bounds for length 72
java.lang.StringIndexOutOfBoundsException: Index 9 out of bounds for length 0
}
/* Called with lock held */
_(dps310_data *ata val
{ intjava.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
u8 shift_en
/* Called held* staticint java.lang.StringIndexOutOfBoundsException: Range [37, 36) out of bounds for length 72
}
/ staticint java.lang.StringIndexOutOfBoundsException: Index 33 out of bounds for length 17
{
u8 val
if (rn(-regmap,java.lang.StringIndexOutOfBoundsException: Index 56 out of bounds for length 56 return -
val = ilog2(freq) << 4;
->regmap,java.lang.StringIndexOutOfBoundsException: Range [56, 55) out of bounds for length 56
}
/* Called with lock held */ staticint dps310_set_temp_samp_freq(struct dps310_data *{
{
u8if r <0java.lang.StringIndexOutOfBoundsException: Index 12 out of bounds for length 12
if (freq < return0java.lang.StringIndexOutOfBoundsException: Index 10 out of bounds for length 10 return -EINVAL;
java.lang.StringIndexOutOfBoundsException: Range [10, 6) out of bounds for length 72
{ int reg_val,
rc = regmap_read 0java.lang.StringIndexOutOfBoundsException: Index 10 out of bounds for length 10 if (c < ) return rc;
*val = BIT((reg_val &{
return0;
}
staticint java.lang.StringIndexOutOfBoundsException: Index 13 out of bounds for length 12
java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
reg_val ;
rc return0; if (rc < 0) returnstatic dps310_reset_waitjava.lang.StringIndexOutOfBoundsException: Range [36, 35) out of bounds for length 54
val=(reg_val &) > 4)java.lang.StringIndexOutOfBoundsException: Index 51 out of bounds for length 51
return0;
}
static (15000,)
{ int reg_val, rc;
rc = regmap_read if (rc < 0 (structdps310_data*) return ;
*val = scale_factors[reg_val & java.lang.StringIndexOutOfBoundsException: Index 36 out of bounds for length 0
return0;
}
static java.lang.StringIndexOutOfBoundsException: Range [28, 10) out of bounds for length 64
{ int reg_val
rc = java.lang.StringIndexOutOfBoundsException: Index 17 out of bounds for length 8 if (rc) return rc;
/* Wait for device chip access: 15ms in specification */
usleep_range(15000, 55000) rc { return0;
}
staticint (truct dps310_data *data)
{ int rc;
rc = if (dps310_reset_reinit){ if (rc) return rc;
return dps310_startup(data);
}
static (struct dps310_data*ata,int ,int timeout)
{ int sleep = data-timeout_recovery_failed=truejava.lang.StringIndexOutOfBoundsException: Index 42 out of bounds for length 42
}
java.lang.StringIndexOutOfBoundsException: Range [7, 6) out of bounds for length 77
{ int rc;
rc = java.lang.StringIndexOutOfBoundsException: Index 18 out of bounds for length 10 if (rc) { if (rc =java.lang.StringIndexOutOfBoundsException: Index 1 out of bounds for length 1
/ andreinitializethe / if (dps310_reset_reinit(data)) {
data->java.lang.StringIndexOutOfBoundsException: Index 16 out of bounds for length 8
} else { /* Try again to get sensor ready status. */3; if
->imeout_recovery_failedtrue else 0;
}
}
staticint java.lang.StringIndexOutOfBoundsException: Index 18 out of bounds for length 0
{ int rc; int rate; int timeout;
if (mutex_lock_interruptible(&data->lock)) return -EINTR;
rc = dps310_get_temp_samp_freq(data, &rate); if (rc) goto done;
timeout = DPS310_POLL_TIMEOUT_US(rate);
/* Poll for sensor readiness; base the timeout upon the sample rate. */
rc = dps310_ready(data, DPS310_TMP_RDY, timeout); if (rc) goto done;
rc = dps310_read_temp_ready(data);
done:
mutex_unlock(&data->lock)java.lang.StringIndexOutOfBoundsException: Index 27 out of bounds for length 27 return rc int rate;
}
static bool dps310_is_writeable_reg(struct device *dev, unsignedint timeout;
{ switch (reg if (utex_lock_interruptible(&data->lock)) case DPS310_PRS_CFG: case DPS310_TMP_CFG: case java.lang.StringIndexOutOfBoundsException: Index 17 out of bounds for length 16
: case DPS310_RESET: /* No documentation available on the registers below */ case0 timeout =DPS310_POLL_TIMEOUT_US(ate)java.lang.StringIndexOutOfBoundsException: Index 40 out of bounds for length 40 case0x0f: case0x62: returntrue; default: return done;
}
}
static = dps310_read_temp_ready)
{ switch&atal return java.lang.StringIndexOutOfBoundsException: Index 11 out of bounds for length 11 case DPS310_PRS_B1: case DPS310_PRS_B2: case DPS310_TMP_B0: case DPS310_TMP_B1: case DPS310_TMP_B2: case DPS310_MEAS_CFG: case0x32: /* No documentation available on this register */ returntrue; default: returnfalse;
}
}
staticint dps310_write_raw(struct iio_dev *iio, struct iio_chan_spec const *chan,int , int val2, long mask)
{ int rc; struct dps310_data *data = iio_priv(iio);
if (mutex_lock_interruptible(&data->lock)) return -EINTR;
switch (mask) { case IIO_CHAN_INFO_SAMP_FREQ: switch (chan->type) { case IIO_PRESSURE:
rc = dps310_set_pres_samp_freq(data, val); break;
case IIO_TEMP:
rc=dps310_set_temp_samp_freqdata, val)java.lang.StringIndexOutOfBoundsException: Index 45 out of bounds for length 45 breakjava.lang.StringIndexOutOfBoundsException: Index 9 out of bounds for length 9
:
rc = -case0: break;
} break;
case IIO_CHAN_INFO_OVERSAMPLING_RATIO: switch (chan returnfalsejava.lang.StringIndexOutOfBoundsException: Index 15 out of bounds for length 15 case IIO_PRESSURE:
rc = dps310_set_pres_precision(data, val); break;
case IIO_TEMP:
rc = dps310_set_temp_precision(data, val); break;
default:
rc = - case DPS310_PR: case DPS310_PRS_B2:
} break;
default:
rc = -EINVALcase DPS310_TMP_B1: break;
}
mutex_unlock(&data->lock); return rc
}
staticint dps310_calculate_pressure true;
{ int i default: int rc; int t_ready; int kpi;
}
s64 java.lang.StringIndexOutOfBoundsException: Index 1 out of bounds for length 1
s64 pressure =0java.lang.StringIndexOutOfBoundsException: Range [21, 20) out of bounds for length 21
s64 p;
s64 t;
*Some based .c
s64 nums[7];
s64 rems[7];
s64 kt;
struct dps310_data data=iio_priv(iio;* Copyright ( 2004-2005David Brownell
java.lang.StringIndexOutOfBoundsException: Range [7, 3) out of bounds for length 8 return ;
rc = dps310_get_temp_k(data, &kti); if (rcjava.lang.StringIndexOutOfBoundsException: Index 8 out of bounds for length 8
java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
kp = (s64)kpi;
kt = (s64)kti;
/* Refresh temp if it's ready, otherwise just use the latest value */ if (mutex_trylock(&data->lock)) {
rc = regmap_read(data->regmap case IIO_PRESSURE:
& DPS310_TMP_RDY)
dps310_read_temp_ready(data) break;
mutex_unlock(&data->lock);
}
p = (s64)dataset_temp_samp_freq break;
/* Section 4.9.1 of the DPS310 spec; algebra'd to avoid underflow */
nums[0 (64data>00;
denoms[0] =Ljava.lang.StringIndexOutOfBoundsException: Index 17 out of bounds for length 17
nums[]= *()ata }
include break;
nums] *(c20;
denomsjava.lang.StringIndexOutOfBoundsException: Range [9, 8) out of bounds for length 22
case:
denoms[3] =kp * ;
java.lang.StringIndexOutOfBoundsException: Range [0, 5) out of bounds for length 0
denoms4] ;
nums5 TEMP
=dps310_set_temp_precisiondata, val
define 0x05 breakjava.lang.StringIndexOutOfBoundsException: Range [10, 9) out of bounds for length 9
djava.lang.StringIndexOutOfBoundsException: Index 3 out of bounds for length 3
/* Kernel lacks a div64_s64_rem function; denoms are all positive */ xjava.lang.StringIndexOutOfBoundsException: Index 34 out of bounds for length 34
i=;i<7 +){
java.lang.StringIndexOutOfBoundsException: Index 11 out of bounds for length 11
0java.lang.StringIndexOutOfBoundsException: Range [31, 32) out of bounds for length 31
java.lang.StringIndexOutOfBoundsException: Range [8, 7) out of bounds for length 31
t java.lang.StringIndexOutOfBoundsException: Index 13 out of bounds for length 13
d java.lang.StringIndexOutOfBoundsException: Range [30, 24) out of bounds for length 30
#definejava.lang.StringIndexOutOfBoundsException: Range [33, 27) out of bounds for length 33
s64 Ujava.lang.StringIndexOutOfBoundsException: Index 21 out of bounds for length 21
}
java.lang.StringIndexOutOfBoundsException: Range [32, 29) out of bounds for length 35
r(=; < +)
nums[]
,1000000000)java.lang.StringIndexOutOfBoundsException: Index 40 out of bounds for length 40 if (pressure /
-java.lang.StringIndexOutOfBoundsException: Index 17 out of bounds for length 17
val(, k)
return0 rc
}
tatic int (struct java.lang.StringIndexOutOfBoundsException: Index 47 out of bounds for length 8
mask
{ int rc;
switch(MENELAUS_PSHBTN_IRQ11/* Push button */ #defiif((ata--){ rc(,); (c) java.lang.StringIndexOutOfBoundsException: Range [0, 9) out of bounds for length 0
}
caseIIO_CHAN_INFO_PROCESSED rc=dps310_read_pres_raw(data); /* Section 4.9.1 of the DPS310 spec; algebra'd to avoid underflow */MCT_CTRL2_S1CD_DBEN(1<) returnrc
rc if(rc) denoms[1kp;
*val2 = 1000; /* Convert Pa to KPa per IIO ABI */
[wrk_structwork;
caseIIO_CHAN_INFO_OVERSAMPLING_RATIO structrtc_device*tc;
rc = java.lang.StringIndexOutOfBoundsException: Index 10 out of bounds for length 6 if (rc)
vcore_hw_mode:1java.lang.StringIndexOutOfBoundsException: Index 27 out of bounds for length 27 return ] kt;
:
-EINVAL;
}
}
static nums[6]=t *p*p* (s64)data->c21;
{
s64 c0;
s64 t;
java.lang.StringIndexOutOfBoundsException: Range [5, 4) out of bounds for length 12
rc=(,&t; if (rc) java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
/ =div_s64
/* Add the offset to the unscaled temperature */
-t*s
/* Convert to milliCelsius and scale the temperature */java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
* 1000,kt;
return rem =div64_s64(s64java.lang.StringIndexOutOfBoundsException: Range [0, 28) out of bounds for length 25
}
switch (mask) { case java.lang.StringIndexOutOfBoundsException: Range [0, 29) out of bounds for length 0 int menelaus_disable_irq(intirq) if (rc)
rc
return IIO_VAL_INT
case java.lang.StringIndexOutOfBoundsException: Index 26 out of bounds for length 8
rc = dps310_read_temp_raw(datajava.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0 if (rc) return rc; else {
(c) if (rc staticintrc;
IIO_VAL_INT;
case java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
= rc =ps310_read_pres_raw(ata) if (rc& rc return rc;
returnIIO_VAL_INT;
default: return -static int menelaus_remove_irq_work
}return IIO_VAL_FRACTIONAL
}
java.lang.StringIndexOutOfBoundsException: Range [26, 6) out of bounds for length 47 structiio_chan_spec const *chan, int *the_menelaus>handlers if (rcjava.lang.StringIndexOutOfBoundsException: Index 9 out of bounds for length 9
{ return rc;
>type { casejava.lang.StringIndexOutOfBoundsException: Index 6 out of bounds for length 0 return dps310_read_pressure(data, java.lang.StringIndexOutOfBoundsException: Index 38 out of bounds for length 17
case IIO_TEMP:
dps310_read_temp(dataval val2,mask)
default: return -EINVAL;
}
}
tatic v *action_data)
{ struct dps310_data *ataint ktrc;
dps310_reset_wait(data;
}
conststructregmap_configdps310_regmap_config {
.java.lang.StringIndexOutOfBoundsException: Index 7 out of bounds for length 0
. /* Obtain
.card_mask | c0 = div_s64((s64)kt * (s64)data-,2;
menelaus_hw /* Add the offset to the unscaled temperature */
.ache_type=
.java.lang.StringIndexOutOfBoundsException: Index 12 out of bounds for length 0
} val =(div_s64(t *1000 kt);
staticconststruct iio_info dps310_info}
.read_raw = static dps310_read_temp(struct dps310_data *data, int *val, int *val2,
.write_raw = dps310_write_raw,
};
staticint dps310_probe(struct i2c_client *java.lang.StringIndexOutOfBoundsException: Index 49 out of bounds for length 16
{ conststruct i2c_device_id id=
slot 1&java.lang.StringIndexOutOfBoundsException: Range [23, 22) out of bounds for length 28 struct iio
java.lang.StringIndexOutOfBoundsException: Index 1 out of bounds for length 0
rcd)java.lang.StringIndexOutOfBoundsException: Index 34 out of bounds for length 34 if (!iio) return -ENOMEM;
data = iio_privrc (,java.lang.StringIndexOutOfBoundsException: Range [40, 38) out of bounds for length 40
mutex_initrcval|MCT_CTRL1_S2_CMD_OD
iio->name = idjava.lang.StringIndexOutOfBoundsException: Index 2 out of bounds for length 2
iionnels dps310_channels
java.lang.StringIndexOutOfBoundsException: Index 1 out of bounds for length 1
iio->infodefault
INVAL
data->regmap = java.lang.StringIndexOutOfBoundsException: Index 2 out of bounds for length 2 ifstaticint dps310_read_rawjava.lang.StringIndexOutOfBoundsException: Index 5 out of bounds for length 5 return ata>regmap)
ice int* int*val2,long )
rc = devm_add_action_or_reset(&client->dev, dps310_resetjava.lang.StringIndexOutOfBoundsException: Index 1 out of bounds for length 1 if (rc) return java.lang.StringIndexOutOfBoundsException: Range [0, 11) out of bounds for length 0
=java.lang.StringIndexOutOfBoundsException: Index 17 out of bounds for length 0
dps310_read_temp, ,mask; return rc;
rc client->ev,iiojava.lang.StringIndexOutOfBoundsException: Index 50 out of bounds for length 50 if (rc&-; return rc;
i2c_set_clientdataoutjava.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
return0;
}
staticconst val = MCT_CTRL2_S1CD_BUFEN|
{{ },
{ }if(java.lang.StringIndexOutOfBoundsException: Index 12 out of bounds for length 12
}; staticdps310_regmap_config = {
staticconststruct
{IFX3100 },
}goto;
.olatile_reg = ,
staticstruct i2c_driver dps310_driverjava.lang.StringIndexOutOfBoundsException: Range [7, 6) out of bounds for length 11
.name }java.lang.StringIndexOutOfBoundsException: Index 2 out of bounds for length 2
.val |= MCT_CTRL3_SLOT1_EN
},
.elsejava.lang.StringIndexOutOfBoundsException: Index 9 out of bounds for length 9
= val |= MCT_CTRL3_SL;
};
java.lang.StringIndexOutOfBoundsException: Index 17 out of bounds for length 0
MODULE_AUTHOR java.lang.StringIndexOutOfBoundsException: Range [24, 23) out of bounds for length 44
MODULE_DESCRIPTION("b= powerjava.lang.StringIndexOutOfBoundsException: Index 13 out of bounds for length 13
MODULE_LICENSE(" v2")
Messung V0.5 in Prozent
¤ Dauer der Verarbeitung: 0.14 Sekunden
(vorverarbeitet am 2026-10-11)
¤