linux-gpio.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Bjorn Andersson <andersson@kernel.org>
To: Rohit Agarwal <quic_rohiagar@quicinc.com>
Cc: agross@kernel.org, konrad.dybcio@linaro.org,
	linus.walleij@linaro.org, robh+dt@kernel.org,
	krzysztof.kozlowski+dt@linaro.org, richardcochran@gmail.com,
	manivannan.sadhasivam@linaro.org, andy.shevchenko@gmail.com,
	linux-arm-msm@vger.kernel.org, linux-gpio@vger.kernel.org,
	devicetree@vger.kernel.org, linux-kernel@vger.kernel.org,
	netdev@vger.kernel.org
Subject: Re: [PATCH v7 4/4] pinctrl: qcom: Add SDX75 pincontrol driver
Date: Thu, 11 May 2023 09:46:23 -0700	[thread overview]
Message-ID: <20230511164623.iaziwwwfyroextce@ripper> (raw)
In-Reply-To: <1683730825-15668-5-git-send-email-quic_rohiagar@quicinc.com>

On Wed, May 10, 2023 at 08:30:25PM +0530, Rohit Agarwal wrote:
> Add initial Qualcomm SDX75 pinctrl driver to support pin configuration
> with pinctrl framework for SDX75 SoC.
> While at it, reordering the SDX65 entry.
> 

Nice, some comment below.

> Signed-off-by: Rohit Agarwal <quic_rohiagar@quicinc.com>
> ---
[..]
> diff --git a/drivers/pinctrl/qcom/pinctrl-sdx75.c b/drivers/pinctrl/qcom/pinctrl-sdx75.c
> new file mode 100644
> index 0000000..6f95c0a
> --- /dev/null
> +++ b/drivers/pinctrl/qcom/pinctrl-sdx75.c
> @@ -0,0 +1,1595 @@
> +// SPDX-License-Identifier: GPL-2.0-only
> +/*
> + * Copyright (c) 2023 Qualcomm Innovation Center, Inc. All rights reserved.
> + */
> +
> +#include <linux/module.h>
> +#include <linux/of.h>
> +#include <linux/of_device.h>
> +#include <linux/platform_device.h>
> +#include "pinctrl-msm.h"
> +
> +#define REG_BASE 0x100000

We typically reference the inner TLMM block and omit this offset... But
I don't have a strong opinion.

[..]

> +enum sdx75_functions {
> +	msm_mux_gpio,

Please sort these alphabetically.

> +	msm_mux_eth0_mdc,
[..]
> +	msm_mux__,
> +};
> +
[..]
> +static const struct pinfunction sdx75_functions[] = {
> +	MSM_PIN_FUNCTION(gpio),
> +	MSM_PIN_FUNCTION(eth0_mdc),

Please sort these alphabetically, and please squash individual pins into
their functional group.

[..]
> +	MSM_PIN_FUNCTION(qup_se0_l0),
> +	MSM_PIN_FUNCTION(qup_se0_l1),
> +	MSM_PIN_FUNCTION(qup_se0_l2),
> +	MSM_PIN_FUNCTION(qup_se0_l3),

E.g. this forces the DT writer to write individual -pins for each
signal. Better keep it "qup_se0" and the author is free to group the
pins in their states as they need (and as you know you don't need to
specify all pins for a given function).

[..]
> +};
> +
> +/* Every pin is maintained as a single group, and missing or non-existing pin
> + * would be maintained as dummy group to synchronize pin group index with
> + * pin descriptor registered with pinctrl core.
> + * Clients would not be able to request these dummy pin groups.
> + */

Please omit this comment.

> +static const struct msm_pingroup sdx75_groups[] = {
[..]
> +	[16] = PINGROUP(16, pri_mi2s_ws, qup_se2_l2, qup_se1_l2_mirb, qdss_cti,
> +			qdss_cti, _, _, _, _, _),

Please break the rules and leave these lines unwrapped.

> +	[17] = PINGROUP(17, pri_mi2s_data0, qup_se2_l3, qup_se1_l3_mirb,
> +			qdss_cti, qdss_cti, _, _, _, _, _),
[..]
> +	[131] = PINGROUP(131, _, _, _, _, _, _, _, _, _, _),
> +	[132] =	PINGROUP(132, _, _, _, _, _, _, _, _, _, _),
> +	[133] = SDC_QDSD_PINGROUP(sdc1_rclk, 0x19A000, 16, 0),

Lowercase hex digits please.

> +	[134] = SDC_QDSD_PINGROUP(sdc1_clk, 0x19A000, 14, 6),
> +	[135] = SDC_QDSD_PINGROUP(sdc1_cmd, 0x19A000, 11, 3),
> +	[136] = SDC_QDSD_PINGROUP(sdc1_data, 0x19A000, 9, 0),
> +	[137] = SDC_QDSD_PINGROUP(sdc2_clk, 0x19B000, 14, 6),
> +	[138] = SDC_QDSD_PINGROUP(sdc2_cmd, 0x19B000, 11, 3),
> +	[139] = SDC_QDSD_PINGROUP(sdc2_data, 0x19B000, 9, 0),
> +};
[..]
> +static const struct of_device_id sdx75_pinctrl_of_match[] = {
> +	{ .compatible = "qcom,sdx75-tlmm", .data = &sdx75_pinctrl },
> +	{ }
> +};
> +
[..]
> +
> +MODULE_DESCRIPTION("QTI sdx75 pinctrl driver");
> +MODULE_LICENSE("GPL");
> +MODULE_DEVICE_TABLE(of, sdx75_pinctrl_of_match);

Keep the MODULE_DEVICE_TABLE() just below the sdx75_pinctrl_of_match
please, so future readers doesn't need to search for it.

Regards,
Bjorn

  reply	other threads:[~2023-05-11 16:42 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-05-10 15:00 [PATCH v7 0/4] Add pinctrl support for SDX75 Rohit Agarwal
2023-05-10 15:00 ` [PATCH v7 1/4] dt-bindings: pinctrl: qcom: Add SDX75 pinctrl devicetree compatible Rohit Agarwal
2023-05-10 15:00 ` [PATCH v7 2/4] pinctrl: qcom: Remove the msm_function struct Rohit Agarwal
2023-05-11 16:33   ` Bjorn Andersson
2023-05-12  8:56     ` Rohit Agarwal
2023-05-10 15:00 ` [PATCH v7 3/4] pinctrl: qcom: Refactor generic qcom pinctrl driver Rohit Agarwal
2023-05-11 16:34   ` Bjorn Andersson
2023-05-10 15:00 ` [PATCH v7 4/4] pinctrl: qcom: Add SDX75 pincontrol driver Rohit Agarwal
2023-05-11 16:46   ` Bjorn Andersson [this message]
2023-05-12  8:57     ` Rohit Agarwal
2023-05-11 13:36 ` [PATCH v7 0/4] Add pinctrl support for SDX75 Linus Walleij

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=20230511164623.iaziwwwfyroextce@ripper \
    --to=andersson@kernel.org \
    --cc=agross@kernel.org \
    --cc=andy.shevchenko@gmail.com \
    --cc=devicetree@vger.kernel.org \
    --cc=konrad.dybcio@linaro.org \
    --cc=krzysztof.kozlowski+dt@linaro.org \
    --cc=linus.walleij@linaro.org \
    --cc=linux-arm-msm@vger.kernel.org \
    --cc=linux-gpio@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=manivannan.sadhasivam@linaro.org \
    --cc=netdev@vger.kernel.org \
    --cc=quic_rohiagar@quicinc.com \
    --cc=richardcochran@gmail.com \
    --cc=robh+dt@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).