Re: [RFC PATCH] pinctrl-single: parse #pinctrl-cells = 2

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

 



* Drew Fustini <drew@xxxxxxxxxxxxxxx> [200615 23:10]:
> These changes are based on feedback from Tony [1] concerning changing
> pinctrl-single to be able to handle pinctrl-cells = 2 for for the 
> "pinctrl-single,pins" property.

Hey this is great! Thanks for sorting it out.

> --- a/drivers/pinctrl/pinctrl-single.c
> +++ b/drivers/pinctrl/pinctrl-single.c
> @@ -1017,11 +1017,21 @@ static int pcs_parse_one_pinctrl_entry(struct pcs_device *pcs,
>  			break;
>  		}
>  
> -		/* Index plus one value cell */
>  		offset = pinctrl_spec.args[0];
>  		vals[found].reg = pcs->base + offset;
> -		vals[found].val = pinctrl_spec.args[1];
>  
> +		pr_info("%s: args_count=%d offset=0x%x", __func__,
> +				pinctrl_spec.args_count, offset);
> +		pr_info("%s: args[1]=0x%x", __func__, pinctrl_spec.args[1]);
> +
> +		if (pinctrl_spec.args_count == 2) {
> +			vals[found].val = pinctrl_spec.args[1];
> +		} else if (pinctrl_spec.args_count == 3) {
> +			pr_info("%s: args[2]=0x%x", __func__, pinctrl_spec.args[2]);
> +			vals[found].val = (pinctrl_spec.args[1] | pinctrl_spec.args[2]);
> +		}

Maybe do the above with a switch? And leave out the pr_info for the
final version :) Also please do a separate patch for pinctrl-singl.c,
and then another patch for the define and dts change.

Hmm so now the conf and mux values are still register masks in the dts
which is not ideal in all cases. But that's a separate issue and could
be sorted out as needed later on with adding separate conf and mux
shifts and masks. Not sure if we want to do that for the existing use
cases though.

Regards,

Tony



[Index of Archives]     [Linux Arm (vger)]     [ARM Kernel]     [ARM MSM]     [Linux Tegra]     [Linux WPAN Networking]     [Linux Wireless Networking]     [Maemo Users]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite Trails]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux