Re: [PATCH v3 2/3] pinctrl: tegra: Add Tegra234 pinmux driver

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

 



Tue, May 30, 2023 at 03:36:53PM +0200, Thierry Reding kirjoitti:
> From: Prathamesh Shete <pshete@xxxxxxxxxx>
> 
> 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





[Index of Archives]     [Linux SPI]     [Linux Kernel]     [Linux ARM (vger)]     [Linux ARM MSM]     [Linux Omap]     [Linux Arm]     [Linux Tegra]     [Fedora ARM]     [Linux for Samsung SOC]     [eCos]     [Linux Fastboot]     [Gcc Help]     [Git]     [DCCP]     [IETF Announce]     [Security]     [Linux MIPS]     [Yosemite Campsites]

  Powered by Linux