[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CACRpkdam7zxSSj3Lirha8tWdeM_WhZpD4xO7MbTK4hVumU0a8w@mail.gmail.com>
Date: Tue, 15 Aug 2023 10:59:50 +0200
From: Linus Walleij <linus.walleij@...aro.org>
To: Yinbo Zhu <zhuyinbo@...ngson.cn>
Cc: Bartosz Golaszewski <brgl@...ev.pl>,
Conor Dooley <conor@...nel.org>,
Rob Herring <robh+dt@...nel.org>,
Krzysztof Kozlowski <krzysztof.kozlowski+dt@...aro.org>,
Conor Dooley <conor+dt@...nel.org>, linux-gpio@...r.kernel.org,
devicetree@...r.kernel.org, linux-kernel@...r.kernel.org,
Jianmin Lv <lvjianmin@...ngson.cn>, wanghongliang@...ngson.cn,
loongson-kernel@...ts.loongnix.cn
Subject: Re: [PATCH v3 1/2] gpio: dt-bindings: add parsing of loongson gpio offset
On Mon, Aug 14, 2023 at 5:39 AM Yinbo Zhu <zhuyinbo@...ngson.cn> wrote:
> > Why do you want to put it into device-tree so badly? This is not the
> > first driver that would have of_match_data for different variants
> > where you can have a structure that would keep offsets for different
> > models. It's not like you will have hundreds of "compatible" chips
> > anyway, most likely just a few?
>
> Using this ways that put offset property into device-tree that can be
> compatible with future GPIO chips without the need to modify drivers,
> such as more 2K chips in the future, but use of_match_data and data
> field of_device_id, which every time a new SoC is released, the GPIO
> driver needs to be modified once, which is not friendly to us.
The purpose of device tree is to describe the hardware and
to configure it for a target system.
The purpose of device tree is not to make driver writing easy
or convenient. It often does, but that is not the purpose.
These offsets are not relevant to the people that need to
author and maintain device trees to support and tailor their
system. They are only relevant to driver authors and SoC
manufacturers.
What about just writing these offsets into the driver and use
the compatible match to look them up.
Yours,
Linus Walleij
Powered by blists - more mailing lists