All of lore.kernel.org
 help / color / mirror / Atom feed
From: Russell King - ARM Linux admin <linux@armlinux.org.uk>
To: Baruch Siach <baruch@tkos.co.il>
Cc: "Thierry Reding" <thierry.reding@gmail.com>,
	"Uwe Kleine-König" <u.kleine-koenig@pengutronix.de>,
	"Lee Jones" <lee.jones@linaro.org>,
	"Linus Walleij" <linus.walleij@linaro.org>,
	"Bartosz Golaszewski" <bgolaszewski@baylibre.com>,
	"Rob Herring" <robh+dt@kernel.org>,
	"Andrew Lunn" <andrew@lunn.ch>,
	linux-pwm@vger.kernel.org,
	"Gregory Clement" <gregory.clement@bootlin.com>,
	linux-gpio@vger.kernel.org, devicetree@vger.kernel.org,
	"Chris Packham" <chris.packham@alliedtelesis.co.nz>,
	"Thomas Petazzoni" <thomas.petazzoni@bootlin.com>,
	"Ralph Sennhauser" <ralph.sennhauser@gmail.com>,
	"Sascha Hauer" <s.hauer@pengutronix.de>,
	linux-arm-kernel@lists.infradead.org,
	"Sebastian Hesselbarth" <sebastian.hesselbarth@gmail.com>
Subject: Re: [PATCH v4 1/3] gpio: mvebu: add pwm support for Armada 8K/7K
Date: Mon, 4 Jan 2021 10:06:53 +0000	[thread overview]
Message-ID: <20210104100653.GB1551@shell.armlinux.org.uk> (raw)
In-Reply-To: <61a022834dce86eefa3144e696078946f332bdfe.1607601615.git.baruch@tkos.co.il>

On Thu, Dec 10, 2020 at 02:15:58PM +0200, Baruch Siach wrote:
> @@ -781,51 +787,80 @@ static int mvebu_pwm_probe(struct platform_device *pdev,
>  	struct device *dev = &pdev->dev;
>  	struct mvebu_pwm *mvpwm;
>  	void __iomem *base;
> +	u32 offset;
>  	u32 set;
>  
> -	if (!of_device_is_compatible(mvchip->chip.of_node,
> -				     "marvell,armada-370-gpio"))
> -		return 0;
> -
> -	/*
> -	 * There are only two sets of PWM configuration registers for
> -	 * all the GPIO lines on those SoCs which this driver reserves
> -	 * for the first two GPIO chips. So if the resource is missing
> -	 * we can't treat it as an error.
> -	 */
> -	if (!platform_get_resource_byname(pdev, IORESOURCE_MEM, "pwm"))
> +	if (of_device_is_compatible(mvchip->chip.of_node,
> +				    "marvell,armada-370-gpio")) {
> +		/*
> +		 * There are only two sets of PWM configuration registers for
> +		 * all the GPIO lines on those SoCs which this driver reserves
> +		 * for the first two GPIO chips. So if the resource is missing
> +		 * we can't treat it as an error.
> +		 */
> +		if (!platform_get_resource_byname(pdev, IORESOURCE_MEM, "pwm"))
> +			return 0;
> +		offset = 0;
> +	} else if (mvchip->soc_variant == MVEBU_GPIO_SOC_VARIANT_A8K) {
> +		int ret = of_property_read_u32(dev->of_node,
> +					       "marvell,pwm-offset", &offset);
> +		if (ret < 0)
> +			return 0;

The reason my patches were rejected was because I was trying to keep
compatibility with the existing DTs w.r.t the clock - and Uwe didn't
like that.

I notice that you keep compatibility by detecting the presence or
absence of the marvell,pwm-offset property which achieves the same
goal.

Also, you are missing fixing a bug in the PWM register calculations
for get_state().

-- 
RMK's Patch system: https://www.armlinux.org.uk/developer/patches/
FTTP is here! 40Mbps down 10Mbps up. Decent connectivity at last!

WARNING: multiple messages have this Message-ID (diff)
From: Russell King - ARM Linux admin <linux@armlinux.org.uk>
To: Baruch Siach <baruch@tkos.co.il>
Cc: "Andrew Lunn" <andrew@lunn.ch>,
	"Sascha Hauer" <s.hauer@pengutronix.de>,
	"Thomas Petazzoni" <thomas.petazzoni@bootlin.com>,
	linux-pwm@vger.kernel.org,
	"Linus Walleij" <linus.walleij@linaro.org>,
	"Chris Packham" <chris.packham@alliedtelesis.co.nz>,
	"Rob Herring" <robh+dt@kernel.org>,
	"Bartosz Golaszewski" <bgolaszewski@baylibre.com>,
	devicetree@vger.kernel.org,
	"Thierry Reding" <thierry.reding@gmail.com>,
	linux-gpio@vger.kernel.org,
	"Uwe Kleine-König" <u.kleine-koenig@pengutronix.de>,
	"Ralph Sennhauser" <ralph.sennhauser@gmail.com>,
	"Lee Jones" <lee.jones@linaro.org>,
	"Gregory Clement" <gregory.clement@bootlin.com>,
	linux-arm-kernel@lists.infradead.org,
	"Sebastian Hesselbarth" <sebastian.hesselbarth@gmail.com>
Subject: Re: [PATCH v4 1/3] gpio: mvebu: add pwm support for Armada 8K/7K
Date: Mon, 4 Jan 2021 10:06:53 +0000	[thread overview]
Message-ID: <20210104100653.GB1551@shell.armlinux.org.uk> (raw)
In-Reply-To: <61a022834dce86eefa3144e696078946f332bdfe.1607601615.git.baruch@tkos.co.il>

On Thu, Dec 10, 2020 at 02:15:58PM +0200, Baruch Siach wrote:
> @@ -781,51 +787,80 @@ static int mvebu_pwm_probe(struct platform_device *pdev,
>  	struct device *dev = &pdev->dev;
>  	struct mvebu_pwm *mvpwm;
>  	void __iomem *base;
> +	u32 offset;
>  	u32 set;
>  
> -	if (!of_device_is_compatible(mvchip->chip.of_node,
> -				     "marvell,armada-370-gpio"))
> -		return 0;
> -
> -	/*
> -	 * There are only two sets of PWM configuration registers for
> -	 * all the GPIO lines on those SoCs which this driver reserves
> -	 * for the first two GPIO chips. So if the resource is missing
> -	 * we can't treat it as an error.
> -	 */
> -	if (!platform_get_resource_byname(pdev, IORESOURCE_MEM, "pwm"))
> +	if (of_device_is_compatible(mvchip->chip.of_node,
> +				    "marvell,armada-370-gpio")) {
> +		/*
> +		 * There are only two sets of PWM configuration registers for
> +		 * all the GPIO lines on those SoCs which this driver reserves
> +		 * for the first two GPIO chips. So if the resource is missing
> +		 * we can't treat it as an error.
> +		 */
> +		if (!platform_get_resource_byname(pdev, IORESOURCE_MEM, "pwm"))
> +			return 0;
> +		offset = 0;
> +	} else if (mvchip->soc_variant == MVEBU_GPIO_SOC_VARIANT_A8K) {
> +		int ret = of_property_read_u32(dev->of_node,
> +					       "marvell,pwm-offset", &offset);
> +		if (ret < 0)
> +			return 0;

The reason my patches were rejected was because I was trying to keep
compatibility with the existing DTs w.r.t the clock - and Uwe didn't
like that.

I notice that you keep compatibility by detecting the presence or
absence of the marvell,pwm-offset property which achieves the same
goal.

Also, you are missing fixing a bug in the PWM register calculations
for get_state().

-- 
RMK's Patch system: https://www.armlinux.org.uk/developer/patches/
FTTP is here! 40Mbps down 10Mbps up. Decent connectivity at last!

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

  reply	other threads:[~2021-01-04 10:08 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-12-10 12:15 [PATCH v4 0/3] gpio: mvebu: Armada 8K/7K PWM support Baruch Siach
2020-12-10 12:15 ` Baruch Siach
2020-12-10 12:15 ` [PATCH v4 1/3] gpio: mvebu: add pwm support for Armada 8K/7K Baruch Siach
2020-12-10 12:15   ` Baruch Siach
2021-01-04 10:06   ` Russell King - ARM Linux admin [this message]
2021-01-04 10:06     ` Russell King - ARM Linux admin
2020-12-10 12:15 ` [PATCH v4 2/3] arm64: dts: armada: add pwm offsets for ap/cp gpios Baruch Siach
2020-12-10 12:15   ` Baruch Siach
2020-12-10 12:16 ` [PATCH v4 3/3] dt-bindings: ap806: document marvell,gpio pwm-offset property Baruch Siach
2020-12-10 12:16   ` [PATCH v4 3/3] dt-bindings: ap806: document marvell, gpio " Baruch Siach
2020-12-11  3:47   ` Rob Herring
2020-12-11  3:47     ` Rob Herring
2021-01-04  8:59 ` [PATCH v4 0/3] gpio: mvebu: Armada 8K/7K PWM support Linus Walleij
2021-01-04  8:59   ` Linus Walleij
2021-01-04  9:43   ` Baruch Siach
2021-01-04  9:43     ` Baruch Siach
2021-01-04  9:52     ` Bartosz Golaszewski
2021-01-04  9:52       ` Bartosz Golaszewski
2021-01-04  9:24 ` Russell King - ARM Linux admin
2021-01-04  9:24   ` Russell King - ARM Linux admin
2021-01-04 10:12   ` Baruch Siach
2021-01-04 10:12     ` Baruch Siach

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=20210104100653.GB1551@shell.armlinux.org.uk \
    --to=linux@armlinux.org.uk \
    --cc=andrew@lunn.ch \
    --cc=baruch@tkos.co.il \
    --cc=bgolaszewski@baylibre.com \
    --cc=chris.packham@alliedtelesis.co.nz \
    --cc=devicetree@vger.kernel.org \
    --cc=gregory.clement@bootlin.com \
    --cc=lee.jones@linaro.org \
    --cc=linus.walleij@linaro.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-gpio@vger.kernel.org \
    --cc=linux-pwm@vger.kernel.org \
    --cc=ralph.sennhauser@gmail.com \
    --cc=robh+dt@kernel.org \
    --cc=s.hauer@pengutronix.de \
    --cc=sebastian.hesselbarth@gmail.com \
    --cc=thierry.reding@gmail.com \
    --cc=thomas.petazzoni@bootlin.com \
    --cc=u.kleine-koenig@pengutronix.de \
    /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.