Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 22b74960 authored by qctecmdr's avatar qctecmdr Committed by Gerrit - the friendly Code Review server
Browse files

Merge "RTC6226: Configure Vdd with supplied load in NPM"

parents 8c9d32da 9067213b
Loading
Loading
Loading
Loading
+20 −0
Original line number Diff line number Diff line
@@ -461,6 +461,14 @@ static int rtc6226_fm_vdd_reg_cfg(struct rtc6226_device *radio, bool on)
			FMDERR("set_vol(%s) fail %d\n", vreg->name, rc);
			return rc;
		}
		if (vreg->vdd_load) {
			rc = regulator_set_load(vreg->reg, vreg->vdd_load);
			if (rc < 0) {
				FMDERR("%s Unable to set the load %d ,err=%d\n",
				__func__, vreg->vdd_load, rc);
				return rc;
			}
		}

		rc = regulator_enable(vreg->reg);
		if (rc < 0) {
@@ -487,6 +495,14 @@ static int rtc6226_fm_vdd_reg_cfg(struct rtc6226_device *radio, bool on)
			FMDERR("set_vol(%s) fail %d\n", vreg->name, rc);
			return rc;
		}
		if (vreg->vdd_load) {
			rc = regulator_set_load(vreg->reg, 0);
			if (rc < 0) {
				FMDERR("%s Unable to set the load 0 ,err=%d\n",
					__func__, rc);
				return rc;
			}
		}
	}
	return rc;
}
@@ -767,6 +783,10 @@ static int rtc6226_i2c_probe(struct i2c_client *client,
	radio->vddreg->reg = vddvreg;
	radio->vddreg->name = "vdd";
	radio->vddreg->is_enabled = false;
	of_property_read_u32(client->dev.of_node,
			"rtc6226,vdd-load", &radio->vddreg->vdd_load);
	FMDERR("%s: rtc6226,vdd-load val %d\n",
		__func__, radio->vddreg->vdd_load);
	retval = rtc6226_dt_parse_vreg_info(&client->dev,
			radio->vddreg, "rtc6226,vdd-supply-voltage");
	if (retval < 0) {
+1 −0
Original line number Diff line number Diff line
@@ -459,6 +459,7 @@ struct fm_power_vreg_data {
	/* voltage levels to be set */
	unsigned int low_vol_level;
	unsigned int high_vol_level;
	int vdd_load;
	/* is this regulator enabled? */
	bool is_enabled;
};