Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752224AbdHPPLk (ORCPT ); Wed, 16 Aug 2017 11:11:40 -0400 Received: from metis.ext.4.pengutronix.de ([92.198.50.35]:40699 "EHLO metis.ext.4.pengutronix.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751577AbdHPPLj (ORCPT ); Wed, 16 Aug 2017 11:11:39 -0400 Message-ID: <1502896293.7596.7.camel@pengutronix.de> Subject: Re: [PATCH v3 1/5] reset: add reset-simple to unify socfpga, stm32, sunxi, and zx2967 From: Philipp Zabel To: Andreas =?ISO-8859-1?Q?F=E4rber?= , Andre Przywara , linux-kernel@vger.kernel.org Cc: Alexandru Gagniuc , Maxime Coquelin , Alexandre Torgue , Maxime Ripard , Chen-Yu Tsai , Baoyou Xie , Eugeniy Paltsev , Steffen Trumtrar , Dinh Nguyen , linux-arm-kernel@lists.infradead.org, kernel@pengutronix.de Date: Wed, 16 Aug 2017 17:11:33 +0200 In-Reply-To: References: <20170816094701.30678-1-p.zabel@pengutronix.de> <20170816094701.30678-2-p.zabel@pengutronix.de> <51db563d-d6e1-18f1-01c1-3fdcf8269773@arm.com> Content-Type: text/plain; charset="UTF-8" X-Mailer: Evolution 3.22.6-1 Mime-Version: 1.0 Content-Transfer-Encoding: 8bit X-SA-Exim-Connect-IP: 2001:67c:670:100:3ad5:47ff:feaf:1a17 X-SA-Exim-Mail-From: p.zabel@pengutronix.de X-SA-Exim-Scanned: No (on metis.ext.pengutronix.de); SAEximRunCond expanded to false X-PTX-Original-Recipient: linux-kernel@vger.kernel.org Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1763 Lines: 44 On Wed, 2017-08-16 at 14:12 +0200, Andreas Färber wrote: > Hi Andre, > > Am 16.08.2017 um 13:30 schrieb Andre Przywara: > > On 16/08/17 10:46, Philipp Zabel wrote: > > > +/** > > > + * struct reset_simple_devdata - simple reset controller properties > > > + * @active_low: if true, bits are cleared to assert the reset. Otherwise, bits > > > + *              are set to assert the reset. > > > + */ > > > +struct reset_simple_devdata { > > > > > > + bool active_low; > > > +}; > > > + > > > +static const struct reset_simple_devdata reset_simple_active_low = { > > > > > > + .active_low = true, > > > +}; > > > + > > > +static const struct of_device_id reset_simple_dt_ids[] = { > > > > > > + { .compatible = "allwinner,sun6i-a31-clock-reset", > > > + .data = &reset_simple_active_low }, > > > > Can we have a additional generic compatible string here? New users of > > this driver then wouldn't need to explicitly enter their name into the > > driver, but could just use the generic name as a fallback. This would > > enable the driver without any Linux code change just by adding a DT node. > > > > compatible = "nexell,s5p6818-reset", "simple-reset"; > > > > Whenever we need a quirk (now or in the future), we can add the specific > > name into this structure along with the required workarounds. > > Same question about binding here. However the way it is done today, we > would also need some optional active-low property then or two different > compatible strings, as this is currently controlled via the DT matches. I'd like to decouple this from the issue at hand, which is de- duplicating simple reset code without device tree changes. I'll make a separate suggestion for a simple binding on top of this series. regards Philipp