Re: [PATCHv6][ 3/5] video: mx3fb: Introduce regulator support.

Alexander Shiyan shc_work at mail.ru
Wed Feb 26 05:20:30 EST 2014


Среда, 26 февраля 2014, 10:59 +01:00 от Denis Carikli <denis at eukrea.com>:
> This commit is based on the following commit by Fabio Estevam:
>   4344429 video: mxsfb: Introduce regulator support
...
> +++ b/drivers/video/mx3fb.c
...
> @@ -1409,6 +1435,9 @@ static int init_fb_chan(struct mx3fb_data *mx3fb, struct idmac_channel *ichan)
>  			return -EINVAL;
>  		}
>  
> +		of_property_read_string(display_np, "regulator-name",
> +					&regulator_name);
> +
>  		of_property_read_string(display_np, "interface-pix-fmt",
>  					&ipu_disp_format);
>  		if (!ipu_disp_format) {
> @@ -1526,6 +1555,21 @@ static int init_fb_chan(struct mx3fb_data *mx3fb, struct idmac_channel *ichan)
>  	if (ret < 0)
>  		goto esetpar;
>  
> +	/* In dt mode,
> +	 * using devm_regulator_get would require that the proprety referencing
> +	 * the regulator phandle has to be inside the mx3fb node.

What???

> +	 */
> +	if (np) {
> +		if (regulator_name)
> +			mx3fbi->reg_lcd = regulator_get(NULL, regulator_name);
> +
> +		if (IS_ERR(mx3fbi->reg_lcd))
> +			return PTR_ERR(mx3fbi->reg_lcd);
> +	} else {
> +		/* Permit that driver without a regulator in non-dt mode */
> +		mx3fbi->reg_lcd = regulator_get(dev, "lcd");
> +	}

Why you want to use an excess "regulator-name" property?
Just use devm_regulator_get(dev, "lcd") for both dt/non-dt case.


More information about the linux-arm-kernel mailing list