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

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 */
			};
		};


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;
	}

Is this enough information to configure the 3 pins? Probably not...
There must be some information hard-coded in drivers/pinctrl/qcom/pinctrl-msm8998.c

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


Looking at relevant parts of drivers/pinctrl/qcom/pinctrl-msm8998.c

	PINCTRL_PIN(89, "GPIO_89"),
	PINCTRL_PIN(90, "GPIO_90"),
	PINCTRL_PIN(91, "GPIO_91"),

DECLARE_MSM_GPIO_PINS(89);
DECLARE_MSM_GPIO_PINS(90);
DECLARE_MSM_GPIO_PINS(91);

static const char * const tsif1_clk_groups[] = {
	"gpio89",
};
static const char * const phase_flag10_groups[] = {
	"gpio89",
};
static const char * const tsif1_en_groups[] = {
	"gpio90",
};
static const char * const mdp_vsync0_groups[] = {
	"gpio90",
};
static const char * const mdp_vsync1_groups[] = {
	"gpio90",
};
static const char * const mdp_vsync2_groups[] = {
	"gpio90",
};
static const char * const mdp_vsync3_groups[] = {
	"gpio90",
};
static const char * const blsp1_spi_groups[] = {
	"gpio90",
};
static const char * const tgu_ch0_groups[] = {
	"gpio90",
};
static const char * const qdss_cti1_b_groups[] = {
	"gpio90", "gpio91",
};
static const char * const tsif1_data_groups[] = {
	"gpio91",
};
static const char * const sdc4_cmd_groups[] = {
	"gpio91",
};
static const char * const tgu_ch1_groups[] = {
	"gpio91",
};
static const char * const phase_flag1_groups[] = {
	"gpio91",
};

	PINGROUP(89, EAST, tsif1_clk, phase_flag10, NA, NA, NA, NA, NA, NA, NA),
	PINGROUP(90, EAST, tsif1_en, mdp_vsync0, mdp_vsync1, mdp_vsync2, mdp_vsync3, blsp1_spi, tgu_ch0, qdss_cti1_b, NA),
	PINGROUP(91, EAST, tsif1_data, sdc4_cmd, tgu_ch1, phase_flag1, qdss_cti1_b, NA, NA, NA, NA),

(It seems to me there is some redundancy in this driver?)

These last 3 lines seem to summarize how each pin is muxed?
I.e. it's used as one function, exclusively?
So a proper driver should be unloadable, to let other drivers
claim the shared pins?

Regards.

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

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-06-11 16:12 Marc Gonzalez [this message]
2019-06-11 16:50 ` How to write "modern" pinctrl DT node Jonathan Neuschäfer
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=18ab4b1c-e74e-410a-a504-f524e46c42ac@free.fr \
    --to=marc.w.gonzalez@free.fr \
    --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 \
    /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).