Skip to content

Commit

Permalink
thermal/drivers/tsens: Drop single-cell code for mdm9607
Browse files Browse the repository at this point in the history
There is no dtsi file for mdm9607 in the kernel sources. Drop the
compatibility with unofficial dtsi and remove support for handling the
single-cell calibration data on mdm9607.

Cc: Konrad Dybcio <konrad.dybcio@linaro.org>
Reviewed-by: Konrad Dybcio <konrad.dybcio@linaro.org>
Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>
Link: https://lore.kernel.org/r/20230101194034.831222-13-dmitry.baryshkov@linaro.org
Signed-off-by: Daniel Lezcano <daniel.lezcano@linaro.org>
  • Loading branch information
Dmitry Baryshkov authored and Daniel Lezcano committed Jan 16, 2023
1 parent 913d32e commit 51d78b8
Showing 1 changed file with 7 additions and 31 deletions.
38 changes: 7 additions & 31 deletions drivers/thermal/qcom/tsens-v0_1.c
Original file line number Diff line number Diff line change
Expand Up @@ -267,30 +267,6 @@ static int calibrate_8974(struct tsens_priv *priv)
return 0;
}

static int calibrate_9607(struct tsens_priv *priv)
{
u32 p1[5], p2[5];
u32 *qfprom_cdata;
int mode, ret;

ret = tsens_calibrate_common(priv);
if (!ret)
return 0;

qfprom_cdata = (u32 *)qfprom_read(priv->dev, "calib");
if (IS_ERR(qfprom_cdata))
return PTR_ERR(qfprom_cdata);

mode = tsens_read_calibration_legacy(priv, &tsens_9607_nvmem,
p1, p2,
qfprom_cdata, NULL);

compute_intercept_slope(priv, p1, p2, mode);
kfree(qfprom_cdata);

return 0;
}

static int __init init_8939(struct tsens_priv *priv) {
priv->sensor[0].slope = 2911;
priv->sensor[1].slope = 2789;
Expand Down Expand Up @@ -355,6 +331,12 @@ static const struct reg_field tsens_v0_1_regfields[MAX_REGFIELDS] = {
[TRDY] = REG_FIELD(TM_TRDY_OFF, 0, 0),
};

static const struct tsens_ops ops_v0_1 = {
.init = init_common,
.calibrate = tsens_calibrate_common,
.get_temp = get_temp_common,
};

static const struct tsens_ops ops_8916 = {
.init = init_common,
.calibrate = calibrate_8916,
Expand Down Expand Up @@ -398,15 +380,9 @@ struct tsens_plat_data data_8974 = {
.fields = tsens_v0_1_regfields,
};

static const struct tsens_ops ops_9607 = {
.init = init_common,
.calibrate = calibrate_9607,
.get_temp = get_temp_common,
};

struct tsens_plat_data data_9607 = {
.num_sensors = 5,
.ops = &ops_9607,
.ops = &ops_v0_1,
.feat = &tsens_v0_1_feat,
.fields = tsens_v0_1_regfields,
};

0 comments on commit 51d78b8

Please sign in to comment.