Re: [PATCH v2] regulator: qcom-saw2: Add support for SAW2 regulators

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Thu, Jan 28, 2016 at 04:59:02PM +0200, Georgi Djakov wrote:

> +static int saw2_regulator_get_voltage(struct regulator_dev *rdev)
> +{
> +	struct saw2_vreg *vreg = rdev_get_drvdata(rdev);
> +
> +	return regulator_list_voltage_linear_range(rdev, vreg->selector);
> +}

Implement regulator_get_voltage_sel() instead.

> +	do {
> +		regmap_read(vreg->regmap, SPM_REG_STS_1, &new_val);
> +		new_val &= 0xff;
> +		if (new_val == val)
> +			break;
> +		udelay(1);
> +	} while (--timeout_us);

A cpu_relax() in here might be friendly.

> +	if (sel > vreg->selector) {
> +		/* PMIC internal slew rate is 1250 uV/us */
> +		udelay((sel - vreg->selector) * 10);
> +	}

The core already does this for you.

> +	vreg->rdesc.name = of_get_property(np, "regulator-name", NULL);

Don't open code standard properties and don't add new use of legacy
properties like regulator-name.  Just assign a sensible name.

Attachment: signature.asc
Description: PGP signature


[Index of Archives]     [Linux ARM Kernel]     [Linux ARM]     [Linux Omap]     [Fedora ARM]     [Linux for Sparc]     [IETF Annouce]     [Security]     [Bugtraq]     [Linux MIPS]     [ECOS]     [Asterisk Internet PBX]     [Linux API]

  Powered by Linux