All of lore.kernel.org
 help / color / mirror / Atom feed
From: andy.shevchenko@gmail.com
To: Thierry Reding <thierry.reding@gmail.com>
Cc: Linus Walleij <linus.walleij@linaro.org>,
	Rob Herring <robh+dt@kernel.org>,
	Krzysztof Kozlowski <krzysztof.kozlowski+dt@linaro.org>,
	Conor Dooley <conor+dt@kernel.org>,
	Jon Hunter <jonathanh@nvidia.com>,
	Prathamesh Shete <pshete@nvidia.com>,
	linux-gpio@vger.kernel.org, devicetree@vger.kernel.org,
	linux-tegra@vger.kernel.org
Subject: Re: [PATCH v3 2/3] pinctrl: tegra: Add Tegra234 pinmux driver
Date: Fri, 2 Jun 2023 04:30:54 +0300	[thread overview]
Message-ID: <ZHlGTgdsqcGOmVN2@surfacebook> (raw)
In-Reply-To: <20230530133654.1296480-3-thierry.reding@gmail.com>

Tue, May 30, 2023 at 03:36:53PM +0200, Thierry Reding kirjoitti:
> From: Prathamesh Shete <pshete@nvidia.com>
> 
> This change adds support for the two pin controllers found on Tegra234.

...

> +// SPDX-License-Identifier: GPL-2.0+
> +/*
> + * Pinctrl data for the NVIDIA Tegra234 pinmux
> + *
> + * Copyright (c) 2021-2023, NVIDIA CORPORATION.  All rights reserved.

> + * This program is free software; you can redistribute it and/or modify it
> + * under the terms and conditions of the GNU General Public License,
> + * version 2, as published by the Free Software Foundation.
> + *
> + * This program is distributed in the hope it will be useful, but WITHOUT
> + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
> + * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for
> + * more details.

The whole SPDX idea is to avoid including this duplication. Is this a
requirement of your company lawers?

> + */
> +
> +#include <linux/module.h>

Missing mod_devicetable.h

> +#include <linux/of.h>
> +#include <linux/of_device.h>

Do you need both for just of_device_get_match_data() call? Note, you may
replace it with device_get_match_data() and property.h and be completely
OF independent.

> +#include <linux/platform_device.h>
> +#include <linux/pinctrl/pinctrl.h>
> +#include <linux/pinctrl/pinmux.h>
> +#include "pinctrl-tegra.h"

...

> +#define PINGROUP(pg_name, f0, f1, f2, f3, r, bank, pupd, e_io_hv, e_lpbk, e_input, e_lpdr, e_pbias_buf,	\
> +			gpio_sfio_sel, schmitt_b)							\
> +	{								\
> +		.name = #pg_name,					\
> +		.pins = pg_name##_pins,					\
> +		.npins = ARRAY_SIZE(pg_name##_pins),			\

Can we use struct pingroup, please?

> +			.funcs = {					\
> +				TEGRA_MUX_##f0,				\
> +				TEGRA_MUX_##f1,				\
> +				TEGRA_MUX_##f2,				\
> +				TEGRA_MUX_##f3,				\
> +			},						\
> +		PIN_PINGROUP_ENTRY_Y(r, bank, pupd, e_io_hv, e_lpbk,	\
> +					e_input, e_lpdr, e_pbias_buf,	\
> +					gpio_sfio_sel, schmitt_b)	\
> +		drive_##pg_name,					\
> +	}

> +static int tegra234_pinctrl_probe(struct platform_device *pdev)
> +{
> +	const struct tegra_pinctrl_soc_data *soc = of_device_get_match_data(&pdev->dev);
> +
> +	return tegra_pinctrl_probe(pdev, soc);
> +}
> +
> +static const struct of_device_id tegra234_pinctrl_of_match[] = {
> +	{ .compatible = "nvidia,tegra234-pinmux", .data = &tegra234_pinctrl},
> +	{ .compatible = "nvidia,tegra234-pinmux-aon", .data = &tegra234_pinctrl_aon },
> +	{ },

No comma for the terminator entry.

> +};

...

> +static struct platform_driver tegra234_pinctrl_driver = {
> +	.driver = {
> +		.name = "tegra234-pinctrl",

> +		.owner = THIS_MODULE,

Approx. 15 years this is _not_ needed.

> +		.of_match_table = tegra234_pinctrl_of_match,
> +	},
> +	.probe = tegra234_pinctrl_probe,
> +};

-- 
With Best Regards,
Andy Shevchenko



  reply	other threads:[~2023-06-02  1:31 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-05-30 13:36 [PATCH v3 0/3] pinctrl: tegra: Add Tegra234 pinmux driver Thierry Reding
2023-05-30 13:36 ` [PATCH v3 1/3] dt-bindings: pinctrl: Document Tegra234 pin controllers Thierry Reding
2023-05-31  8:45   ` Krzysztof Kozlowski
2023-06-01  9:25     ` Thierry Reding
2023-05-30 13:36 ` [PATCH v3 2/3] pinctrl: tegra: Add Tegra234 pinmux driver Thierry Reding
2023-06-02  1:30   ` andy.shevchenko [this message]
2023-05-30 13:36 ` [PATCH v3 3/3] arm64: tegra: Add Tegra234 pin controllers Thierry Reding

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=ZHlGTgdsqcGOmVN2@surfacebook \
    --to=andy.shevchenko@gmail.com \
    --cc=conor+dt@kernel.org \
    --cc=devicetree@vger.kernel.org \
    --cc=jonathanh@nvidia.com \
    --cc=krzysztof.kozlowski+dt@linaro.org \
    --cc=linus.walleij@linaro.org \
    --cc=linux-gpio@vger.kernel.org \
    --cc=linux-tegra@vger.kernel.org \
    --cc=pshete@nvidia.com \
    --cc=robh+dt@kernel.org \
    --cc=thierry.reding@gmail.com \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.