linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Gyungoh Yoo <gyungoh@gmail.com>
To: Mark Brown <broonie@kernel.org>
Cc: sameo@linux.intel.com, lee.jones@linaro.org, jg1.han@samsung.com,
	cooloney@gmail.com, lgirdwood@gmail.com,
	jack.yoo@skyworksinc.com, linux-kernel@vger.kernel.org,
	devicetree@vger.kernel.org, grant.likely@linaro.org,
	robh+dt@kernel.org, mark.rutland@arm.com,
	ijc+devicetree@hellion.org.uk, galak@codeaurora.org,
	pawel.moll@arm.com, heiko@sntech.de, jason@lakedaemon.net,
	shawn.guo@freescale.com, treding@nvidia.com,
	florian.vaussard@epfl.ch, trivial@kernel.org, linux@roeck-us.net,
	andrew@lunn.ch, jic23@kernel.org
Subject: Re: [RESUBMIT PATCH v7 7/9] regulator: sky81452: Modify Device Tree structure
Date: Wed, 19 Nov 2014 16:39:54 +0900	[thread overview]
Message-ID: <20141119073954.GA3665@jack-ThinkPad-T520> (raw)
In-Reply-To: <20141118112056.GA14734@sirena.org.uk>

On Tue, Nov 18, 2014 at 11:20:56AM +0000, Mark Brown wrote:
> On Tue, Nov 18, 2014 at 05:04:51PM +0900, Gyungoh Yoo wrote:
> > On Mon, Nov 17, 2014 at 02:18:36PM +0000, Mark Brown wrote:
> 
> > > Don't open code this, use regulators_node and of_match as previously
> > > advised.
> 
> > I think I had a misunderstanding.
> > But I have no idea about regulators_node and of_match.
> > Could you let me know more about them?
> 
> They are fields in regulator_desc, there are documentation and examples
> in current mainline - take a look at that and ask questions if it is
> unclear.

Okay. Thank you.
If of_match and regulators_node are assigned, don't I need to
call of_regulator_match()? Does regulator_register() call it internally?
So can I write code like below?

static const struct regulator_desc sky81452_reg = {
	.name = "LOUT",
	.of_match = of_match_ptr("lout"),
	.regulators_node = of_match_ptr("regulator"),
	.ops = &sky81452_reg_ops,
	...
};

static int sky81452_reg_probe(struct platform_device *pdev)
{
	struct device *dev = &pdev->dev;
	const struct regulator_init_data *init_data = dev_get_platdata(dev);
	struct regulator_config config = { };
	struct regulator_dev *rdev;

	config.dev = dev->parent;
	config.init_data = init_data;
	config.of_node = dev->of_node;
	config.regmap = dev_get_drvdata(dev->parent);

	rdev = devm_regulator_register(dev, &sky81452_reg, &config);
	if (IS_ERR(rdev)) {
		dev_err(dev, "failed to register. err=%ld\n", PTR_ERR(rdev));
		return PTR_ERR(rdev);
	}

	platform_set_drvdata(pdev, rdev);

	return 0;
}

  reply	other threads:[~2014-11-19  7:40 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-11-17  8:33 [RESUBMIT PATCH v7 0/9] Add Skyworks SKY81452 device drivers gyungoh
2014-11-17  8:33 ` [RESUBMIT PATCH v7 1/9] mfd: Add support for Skyworks SKY81452 driver gyungoh
2014-11-17  8:33 ` [RESUBMIT PATCH v7 2/9] backlight: Add support Skyworks SKY81452 backlight driver gyungoh
2014-11-17  8:33 ` [RESUBMIT PATCH v7 3/9] devicetree: mfd: Add new SKY81452 mfd binding gyungoh
2014-11-17  8:33 ` [RESUBMIT PATCH v7 4/9] devicetree: backlight: Add new SKY81452 backlight binding gyungoh
2014-11-17 12:23   ` Lee Jones
2014-11-25  1:47     ` Gyungoh Yoo
2014-11-17  8:33 ` [RESUBMIT PATCH v7 5/9] devicetree: Add vendor prefix for Skyworks Solutions, Inc gyungoh
2014-11-17  8:33 ` [RESUBMIT PATCH v7 6/9] devicetree: i2c: Add SKY81452 to the Trivial Devices list gyungoh
2014-11-17  8:33 ` [RESUBMIT PATCH v7 7/9] regulator: sky81452: Modify Device Tree structure gyungoh
2014-11-17 14:18   ` Mark Brown
2014-11-18  8:04     ` Gyungoh Yoo
2014-11-18 11:20       ` Mark Brown
2014-11-19  7:39         ` Gyungoh Yoo [this message]
2014-11-19 10:14           ` Mark Brown
2014-11-17  8:33 ` [RESUBMIT PATCH v7 8/9] devicetree: " gyungoh
2014-11-17  8:33 ` [RESUBMIT PATCH v7 9/9] regulator: sky81452: Modify dependent Kconfig symbol gyungoh
2014-11-17 14:19   ` Mark Brown
2014-11-17 13:37 ` [RESUBMIT PATCH v7 0/9] Add Skyworks SKY81452 device drivers Mark Brown

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=20141119073954.GA3665@jack-ThinkPad-T520 \
    --to=gyungoh@gmail.com \
    --cc=andrew@lunn.ch \
    --cc=broonie@kernel.org \
    --cc=cooloney@gmail.com \
    --cc=devicetree@vger.kernel.org \
    --cc=florian.vaussard@epfl.ch \
    --cc=galak@codeaurora.org \
    --cc=grant.likely@linaro.org \
    --cc=heiko@sntech.de \
    --cc=ijc+devicetree@hellion.org.uk \
    --cc=jack.yoo@skyworksinc.com \
    --cc=jason@lakedaemon.net \
    --cc=jg1.han@samsung.com \
    --cc=jic23@kernel.org \
    --cc=lee.jones@linaro.org \
    --cc=lgirdwood@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux@roeck-us.net \
    --cc=mark.rutland@arm.com \
    --cc=pawel.moll@arm.com \
    --cc=robh+dt@kernel.org \
    --cc=sameo@linux.intel.com \
    --cc=shawn.guo@freescale.com \
    --cc=treding@nvidia.com \
    --cc=trivial@kernel.org \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).