From: Andrew Lunn <andrew@lunn•ch>
To: Evgeny Kolesnikov <evgenyz@gmail•com>
Cc: Mark Rutland <mark.rutland@arm•com>,
devicetree@vger•kernel.org, Jason Cooper <jason@lakedaemon•net>,
linux-pm@vger•kernel.org,
Gregory Clement <gregory.clement@bootlin•com>,
linux-kernel@vger•kernel.org, Sebastian Reichel <sre@kernel•org>,
Rob Herring <robh+dt@kernel•org>,
linux-arm-kernel@lists•infradead.org,
Sebastian Hesselbarth <sebastian.hesselbarth@gmail•com>
Subject: Re: [PATCH 0/5] Add support for WD MyCloud EX2 Ultra (+ versatile UART-based restart/poweroff drivers)
Date: Wed, 24 Jul 2019 00:06:28 +0200 [thread overview]
Message-ID: <20190723220628.GA13517@lunn.ch> (raw)
In-Reply-To: <c2ffe662-6975-351b-87b8-af760984ef4d@gmail.com>
On Tue, Jul 23, 2019 at 07:48:49PM +0200, Evgeny Kolesnikov wrote:
> On 23/07/2019 03:56, Andrew Lunn wrote:
> >On Mon, Jul 22, 2019 at 09:53:00PM +0200, Evgeny Kolesnikov wrote:
> >>
> >>The difference between uart-poweroff and qnap-poweroff is small, but important:
> >>uart-poweroff is able to send to an MCU a command of arbitrary length, and the command
> >>itself is defined in a DTS file for a specific device/board, thus making this driver
> >>applicable to wider range of devices.
> >
> >There is a lot of replicated code here, and in the original
> >qnap-poweroff.c driver. Please consolidate it by extending the current
> >driver. It should be easy to add a new compatible string, and turn
> >power_off_cfg.cmd into an array.
>
> Hi, Andrew.
>
> I've considered extending qnap driver, but I have some doubts about this
> approach.
>
> First of all there is only a poweroff counterpart. As there is no
> qnap-restart driver, what should I do with uart-restart? Is it OK to have
> xxx-restart-poweroff driver (never saw anything like that)?
Hi Evgeny
There are a few options. You can refactor all the code into a library
and small drivers which wrap around the library. Or you can make the
driver handle both, using the compatible string to determine which it
should do.
> While I can add cmd as a parameter to qnap driver (having it converted
> into an array) it should be optional as original qnap relies on two
> hardcoded values for its devices.
That is not what i meant. You can make the current code more generic
by changing the single byte in power_off_cfg to an array. DT should
describe the hardware, not bytes you poke into registers. So it is
perfectly valid to have the bytes hard coded in the driver.
Andrew
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists•infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
next prev parent reply other threads:[~2019-07-23 22:06 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-07-22 19:53 [PATCH 0/5] Add support for WD MyCloud EX2 Ultra (+ versatile UART-based restart/poweroff drivers) Evgeny Kolesnikov
2019-07-22 19:53 ` [PATCH 1/5] power: reset: Add UART-based MCU poweroff DT bindings Evgeny Kolesnikov
2019-08-12 23:50 ` Rob Herring
2019-07-22 19:53 ` [PATCH 2/5] power: reset: Add UART-based MCU restart " Evgeny Kolesnikov
2019-07-22 19:53 ` [PATCH 3/5] power/reset: Add a power off driver for UART-based PM MCUs Evgeny Kolesnikov
2019-07-22 19:53 ` [PATCH 4/5] power/reset: Add a restart " Evgeny Kolesnikov
2019-07-22 19:53 ` [PATCH 5/5] ARM: dts: armada385-wd-mcex2u: Add DTS file for WD My Cloud EX2 Ultra Evgeny Kolesnikov
2019-07-23 13:48 ` Andrew Lunn
2019-07-23 1:56 ` [PATCH 0/5] Add support for WD MyCloud EX2 Ultra (+ versatile UART-based restart/poweroff drivers) Andrew Lunn
2019-07-23 17:48 ` Evgeny Kolesnikov
2019-07-23 22:06 ` Andrew Lunn [this message]
2019-07-28 13:20 ` Pavel Machek
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=20190723220628.GA13517@lunn.ch \
--to=andrew@lunn$(echo .)ch \
--cc=devicetree@vger$(echo .)kernel.org \
--cc=evgenyz@gmail$(echo .)com \
--cc=gregory.clement@bootlin$(echo .)com \
--cc=jason@lakedaemon$(echo .)net \
--cc=linux-arm-kernel@lists$(echo .)infradead.org \
--cc=linux-kernel@vger$(echo .)kernel.org \
--cc=linux-pm@vger$(echo .)kernel.org \
--cc=mark.rutland@arm$(echo .)com \
--cc=robh+dt@kernel$(echo .)org \
--cc=sebastian.hesselbarth@gmail$(echo .)com \
--cc=sre@kernel$(echo .)org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
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