linux-arm-msm.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "Jonathan Neuschäfer" <j.neuschaefer@gmx.net>
To: Marc Gonzalez <marc.w.gonzalez@free.fr>
Cc: Linus Walleij <linus.walleij@linaro.org>,
	Bjorn Andersson <bjorn.andersson@linaro.org>,
	MSM <linux-arm-msm@vger.kernel.org>,
	gpio <linux-gpio@vger.kernel.org>,
	Jeffrey Hugo <jeffrey.l.hugo@gmail.com>
Subject: Re: How to write "modern" pinctrl DT node
Date: Tue, 11 Jun 2019 18:50:23 +0200	[thread overview]
Message-ID: <20190611165023.GA1761@latitude> (raw)
In-Reply-To: <18ab4b1c-e74e-410a-a504-f524e46c42ac@free.fr>

[-- Attachment #1: Type: text/plain, Size: 2688 bytes --]

Hi,

On Tue, Jun 11, 2019 at 06:12:30PM +0200, Marc Gonzalez wrote:
> Hello,
> 
> I'm working with a device (TSIF0) which apparently drives 4 pins:
> (Or maybe 5... it seems gpio40 might be associated with TSIF0 as well.)
> 
> https://source.codeaurora.org/quic/la/kernel/msm-4.4/tree/arch/arm/boot/dts/qcom/msm8998-pinctrl.dtsi?h=LE.UM.1.3.r3.25#n2258
> 
> I'll copy the downstream DT nodes here for discussion:
> 
> 		tsif0_signals_active: tsif0_signals_active {
> 			tsif1_clk {
> 				pins = "gpio89"; /* TSIF0 CLK */
> 				function = "tsif1_clk";
> 			};
> 			tsif1_en {
> 				pins = "gpio90"; /* TSIF0 Enable */
> 				function = "tsif1_en";
> 			};
> 			tsif1_data {
> 				pins = "gpio91"; /* TSIF0 DATA */
> 				function = "tsif1_data";
> 			};
> 			signals_cfg {
> 				pins = "gpio89", "gpio90", "gpio91";
> 				drive_strength = <2>;	/* 2 mA */
> 				bias-pull-down;		/* pull down */
> 			};
> 		};
> 
> 		/* sync signal is only used if configured to mode-2 */
> 		tsif0_sync_active: tsif0_sync_active {
> 			tsif1_sync {
> 				pins = "gpio9";	/* TSIF0 SYNC */
> 				function = "tsif1_sync";
> 				drive_strength = <2>;	/* 2 mA */
> 				bias-pull-down;		/* pull down */
> 			};
> 		};

Looking at the upstream binding[1], I think you can almost use the above
snippet as-is, except for the drive_strength property which is spelled
drive-strength.

> Can I rewrite the first node as:
> 
> 	tsif0_default {
> 		pins = "gpio89", "gpio90", "gpio91"; /* clk, enable, data */
> 		function = "is_this_just_a_label?"; /* Can I just leave it out? */
> 		drive-strength = <2>;
> 		bias-pull-down;
> 	}

The function property is not just an arbitrary label, it needs to be one
of the values defined in the binding. (... which makes because the
driver needs to know *which* hardware function to mux to a given pin.)

> Is this enough information to configure the 3 pins? Probably not...

No, I think you need the separate nodes in order to define the separate
functions of the different pins. There isn't just one function called
"tsif1" that you could apply to all pins.

> Can I merge pin 9 in the above node, since it has the same
> "hardware properties" (drive_strength and bias_direction) ?

Merge what? &tsif0_signals_active/signals_cfg with
&tsif0_sync_active/tsif1_sync?

That depends on how &tsif0_signals_active and &tsif0_sync_active are
used. Are they always used at the same time? Then I think so.
Or are they different states of the TSIF interface that are configured
at different times?


Greetings,
Jonathan Neuschäfer


[1]: Documentation/devicetree/bindings/pinctrl/qcom%2Cmsm8998-pinctrl.txt

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

  reply	other threads:[~2019-06-11 16:50 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-06-11 16:12 How to write "modern" pinctrl DT node Marc Gonzalez
2019-06-11 16:50 ` Jonathan Neuschäfer [this message]
2019-06-11 18:05 ` Bjorn Andersson
2019-06-20 11:02   ` Marc Gonzalez
2019-06-20 18:41     ` Bjorn Andersson
2019-06-26 14:38       ` [PATCH v1] pinctrl: msm8998: Squash TSIF pins together Marc Gonzalez
2019-06-26 14:42         ` Jeffrey Hugo
2019-06-26 14:46           ` Marc Gonzalez
2019-06-26 15:30         ` Jonathan Neuschäfer

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20190611165023.GA1761@latitude \
    --to=j.neuschaefer@gmx.net \
    --cc=bjorn.andersson@linaro.org \
    --cc=jeffrey.l.hugo@gmail.com \
    --cc=linus.walleij@linaro.org \
    --cc=linux-arm-msm@vger.kernel.org \
    --cc=linux-gpio@vger.kernel.org \
    --cc=marc.w.gonzalez@free.fr \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).