From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754924AbbIBPaZ (ORCPT ); Wed, 2 Sep 2015 11:30:25 -0400 Received: from muru.com ([72.249.23.125]:48222 "EHLO muru.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753060AbbIBPaX (ORCPT ); Wed, 2 Sep 2015 11:30:23 -0400 Date: Wed, 2 Sep 2015 08:30:16 -0700 From: Tony Lindgren To: Kishon Vijay Abraham I Cc: broonie@kernel.org, devicetree@vger.kernel.org, linux-mmc@vger.kernel.org, linux-kernel@vger.kernel.org, nsekhar@ti.com, ulf.hansson@linaro.org, robh+dt@kernel.org, pawel.moll@arm.com, mark.rutland@arm.com, ijc+devicetree@hellion.org.uk, galak@codeaurora.org, bcousson@baylibre.com, linux@arm.linux.org.uk, lgirdwood@gmail.com, linux-omap@vger.kernel.org, linux-arm-kernel@lists.infradead.org Subject: Re: [PATCH 1/6] regulator: pbias: program pbias register offset in pbias driver Message-ID: <20150902153015.GR4215@atomide.com> References: <1441190853-7133-1-git-send-email-kishon@ti.com> <1441190853-7133-2-git-send-email-kishon@ti.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1441190853-7133-2-git-send-email-kishon@ti.com> User-Agent: Mutt/1.5.23 (2014-03-12) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org * Kishon Vijay Abraham I [150902 03:51]: > --- a/drivers/regulator/pbias-regulator.c > +++ b/drivers/regulator/pbias-regulator.c How about add a comment here: /* Offset from SCM general area (and syscon) base */ > +static const struct pbias_of_data pbias_of_data_omap2 = { > + .offset = 0x230, > +}; > + > +static const struct pbias_of_data pbias_of_data_omap3 = { > + .offset = 0x2b0, > +}; > + > +static const struct pbias_of_data pbias_of_data_omap4 = { > + .offset = 0x60, > +}; > + > +static const struct pbias_of_data pbias_of_data_omap5 = { > + .offset = 0x60, > +}; > + > +static const struct pbias_of_data pbias_of_data_dra7 = { > + .offset = 0xe00, > +}; > + > static const struct of_device_id pbias_of_match[] = { > { .compatible = "ti,pbias-omap", }, > + { .compatible = "ti,pbias-omap2", .data = &pbias_of_data_omap2, }, > + { .compatible = "ti,pbias-omap3", .data = &pbias_of_data_omap3, }, > + { .compatible = "ti,pbias-omap4", .data = &pbias_of_data_omap4, }, > + { .compatible = "ti,pbias-omap5", .data = &pbias_of_data_omap5, }, > + { .compatible = "ti,pbias-dra7", .data = &pbias_of_data_dra7, }, > {}, > }; ... > @@ -129,6 +161,18 @@ static int pbias_regulator_probe(struct platform_device *pdev) > if (IS_ERR(syscon)) > return PTR_ERR(syscon); > > + match = of_match_device(of_match_ptr(pbias_of_match), &pdev->dev); > + if (match && match->data) { > + data = match->data; > + offset = data->offset; > + } else { > + res = platform_get_resource(pdev, IORESOURCE_MEM, 0); > + if (!res) > + return -EINVAL; > + > + offset = res->start; > + } > + > cfg.regmap = syscon; > cfg.dev = &pdev->dev; > Maybe add a warning here for parsing the legacy broken IORESOURCE_MEM that's known to be broken from DT point of view? Other than that, looks OK to me and should allow also changing to use a generic solution, Mark may have some other comments. Anyways, something like this is needed for v4.3-rc cycle, probably best that Mark queues all these after review. So feel free to add for the whole series: Acked-by: Tony Lindgren