diff mbox

[10/22] mfd/ti_am335x_tscadc: Add DT support

Message ID 1370950268-7224-11-git-send-email-bigeasy@linutronix.de (mailing list archive)
State New, archived
Headers show

Commit Message

Sebastian Andrzej Siewior June 11, 2013, 11:30 a.m. UTC
From: "Patil, Rachna" <rachna@ti.com>

Make changes to add DT support in the MFD core driver.

[ panto@antoniou-consulting.com : use of_get_child_by_name
	instead of of_find_node_by_name ]

Signed-off-by: Pantelis Antoniou <panto@antoniou-consulting.com>
Signed-off-by: Patil, Rachna <rachna@ti.com>
Signed-off-by: Felipe Balbi <balbi@ti.com>
[bigeasy: module alias, rename to ti,am3359-tscadc as it was tested on
          AM3359]
Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
---
 drivers/mfd/ti_am335x_tscadc.c |   32 ++++++++++++++++++++++++++------
 1 file changed, 26 insertions(+), 6 deletions(-)

Comments

Samuel Ortiz June 11, 2013, 2:23 p.m. UTC | #1
Hi Sebastian,

On Tue, Jun 11, 2013 at 01:30:56PM +0200, Sebastian Andrzej Siewior wrote:
> From: "Patil, Rachna" <rachna@ti.com>
> 
> Make changes to add DT support in the MFD core driver.
Which changes ?


> [ panto@antoniou-consulting.com : use of_get_child_by_name
> 	instead of of_find_node_by_name ]
I have no idea where that is coming from. Please remove this kind of
stuff and build a proper commit log instead.


> Signed-off-by: Pantelis Antoniou <panto@antoniou-consulting.com>
> Signed-off-by: Patil, Rachna <rachna@ti.com>
> Signed-off-by: Felipe Balbi <balbi@ti.com>
> [bigeasy: module alias, rename to ti,am3359-tscadc as it was tested on
>           AM3359]
I honestly can't tell if this is a change from the last version of your
patchset or a description of this patch changes in general.
This is cluttering your commit logs, please remove this as well.

Cheers,
Samuel.
Sebastian Andrzej Siewior June 11, 2013, 2:42 p.m. UTC | #2
On 06/11/2013 04:23 PM, Samuel Ortiz wrote:
> Hi Sebastian,

Hi Samuel,

> On Tue, Jun 11, 2013 at 01:30:56PM +0200, Sebastian Andrzej Siewior wrote:
>> From: "Patil, Rachna" <rachna@ti.com>
>>
>> Make changes to add DT support in the MFD core driver.
> Which changes ?

So rewrite the commit log…

>> [ panto@antoniou-consulting.com : use of_get_child_by_name
>> 	instead of of_find_node_by_name ]
> I have no idea where that is coming from. Please remove this kind of
> stuff and build a proper commit log instead.
> 
> 
>> Signed-off-by: Pantelis Antoniou <panto@antoniou-consulting.com>
>> Signed-off-by: Patil, Rachna <rachna@ti.com>
>> Signed-off-by: Felipe Balbi <balbi@ti.com>
>> [bigeasy: module alias, rename to ti,am3359-tscadc as it was tested on
>>           AM3359]
> I honestly can't tell if this is a change from the last version of your
> patchset or a description of this patch changes in general.
> This is cluttering your commit logs, please remove this as well.

I took the original patch. Every change I made to it because people
asked to merge changes into the patch where the problem occurred I
added it here before my sign-off.

In the end I would like not to post a patch with "From: != me" and
don't make change which the original author did not do. Also dropping
their authorship isn't nice. What could we agree on?

> Cheers,
> Samuel.

Sebastian
--
To unsubscribe from this list: send the line "unsubscribe linux-omap" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Samuel Ortiz June 11, 2013, 3:05 p.m. UTC | #3
Hi Sebastian,

On Tue, Jun 11, 2013 at 04:42:30PM +0200, Sebastian Andrzej Siewior wrote:
> In the end I would like not to post a patch with "From: != me" and
> don't make change which the original author did not do. Also dropping
> their authorship isn't nice. What could we agree on?
You probably don't want to change authorship unless the final patch is
really far from the original one. In which case you can change it and
mention the original author name in the commit log.
If you have only made a few changes on top of the original patch, please
say so explicitely in the commit log. Don't bother if we're talking
about small changes or cosmetic ones. But your commit log has to be
readable and clear.

Cheers,
Samuel.
Sebastian Andrzej Siewior June 11, 2013, 3:41 p.m. UTC | #4
On 06/11/2013 05:05 PM, Samuel Ortiz wrote:
> Hi Sebastian,

Hi Samuel,

> On Tue, Jun 11, 2013 at 04:42:30PM +0200, Sebastian Andrzej Siewior wrote:
>> In the end I would like not to post a patch with "From: != me" and
>> don't make change which the original author did not do. Also dropping
>> their authorship isn't nice. What could we agree on?
> You probably don't want to change authorship unless the final patch is
> really far from the original one. In which case you can change it and
> mention the original author name in the commit log.
> If you have only made a few changes on top of the original patch, please
> say so explicitely in the commit log. Don't bother if we're talking
> about small changes or cosmetic ones. But your commit log has to be
> readable and clear.

Commit 06c9494 on of many examples where cosmetic are recorded. But to
make some progress I rewrite the commit log to resolve this and don't
add anything to the sign-off area.

> Cheers,
> Samuel.

Sebastian
--
To unsubscribe from this list: send the line "unsubscribe linux-omap" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Lee Jones June 11, 2013, 5:10 p.m. UTC | #5
> >> Signed-off-by: Pantelis Antoniou <panto@antoniou-consulting.com>
> >> Signed-off-by: Patil, Rachna <rachna@ti.com>
> >> Signed-off-by: Felipe Balbi <balbi@ti.com>
> >> [bigeasy: module alias, rename to ti,am3359-tscadc as it was tested on
> >>           AM3359]
> > I honestly can't tell if this is a change from the last version of your
> > patchset or a description of this patch changes in general.
> > This is cluttering your commit logs, please remove this as well.
> 
> I took the original patch. Every change I made to it because people
> asked to merge changes into the patch where the problem occurred I
> added it here before my sign-off.
> 
> In the end I would like not to post a patch with "From: != me" and
> don't make change which the original author did not do. Also dropping
> their authorship isn't nice. What could we agree on?

Generally speaking, if it is necessary to merge various author's
patches into one, then you can the merger will tend to take authorship
of the commit. Note that just because you are the author of the
commit, it doesn't mean you authored the patch.

I also use the rule of thumb that if you make significant changes to a
patch, then you can also assume authorship too. I'll leave the 'how
much is significant' to your own good judgement.

If you're just making a few fixups, then just add your SOB in the
normal way. That should be enough reward for a mere few patch fixes.

Adding little 'I-did-this' notes to the commit log should mostly be
avoided IMO.
Lee Jones June 11, 2013, 6:42 p.m. UTC | #6
On Tue, 11 Jun 2013, Sebastian Andrzej Siewior wrote:

> On 06/11/2013 05:05 PM, Samuel Ortiz wrote:
> > Hi Sebastian,
> 
> Hi Samuel,
> 
> > On Tue, Jun 11, 2013 at 04:42:30PM +0200, Sebastian Andrzej Siewior wrote:
> >> In the end I would like not to post a patch with "From: != me" and
> >> don't make change which the original author did not do. Also dropping
> >> their authorship isn't nice. What could we agree on?
> > You probably don't want to change authorship unless the final patch is
> > really far from the original one. In which case you can change it and
> > mention the original author name in the commit log.
> > If you have only made a few changes on top of the original patch, please
> > say so explicitely in the commit log. Don't bother if we're talking
> > about small changes or cosmetic ones. But your commit log has to be
> > readable and clear.
> 
> Commit 06c9494 on of many examples where cosmetic are recorded. But to
> make some progress I rewrite the commit log to resolve this and don't
> add anything to the sign-off area.

If you are submitting the patch, you still have to add your own SOB.
diff mbox

Patch

diff --git a/drivers/mfd/ti_am335x_tscadc.c b/drivers/mfd/ti_am335x_tscadc.c
index eaaa253..aae5e55 100644
--- a/drivers/mfd/ti_am335x_tscadc.c
+++ b/drivers/mfd/ti_am335x_tscadc.c
@@ -21,6 +21,8 @@ 
 #include <linux/clk.h>
 #include <linux/mfd/core.h>
 #include <linux/pm_runtime.h>
+#include <linux/of.h>
+#include <linux/of_device.h>
 
 #include <linux/mfd/ti_am335x_tscadc.h>
 #include <linux/input/ti_am335x_tsc.h>
@@ -79,20 +81,31 @@  static	int ti_tscadc_probe(struct platform_device *pdev)
 	struct resource		*res;
 	struct clk		*clk;
 	struct mfd_tscadc_board	*pdata = pdev->dev.platform_data;
+	struct device_node	*node = pdev->dev.of_node;
 	struct mfd_cell		*cell;
 	int			err, ctrl;
 	int			clk_value, clock_rate;
-	int			tsc_wires, adc_channels = 0, total_channels;
+	int			tsc_wires = 0, adc_channels = 0, total_channels;
 
-	if (!pdata) {
+	if (!pdata && !pdev->dev.of_node) {
 		dev_err(&pdev->dev, "Could not find platform data\n");
 		return -EINVAL;
 	}
 
-	if (pdata->adc_init)
-		adc_channels = pdata->adc_init->adc_channels;
+	if (pdev->dev.platform_data) {
+		if (pdata->tsc_init)
+			tsc_wires = pdata->tsc_init->wires;
+
+		if (pdata->adc_init)
+			adc_channels = pdata->adc_init->adc_channels;
+	} else {
+		node = of_get_child_by_name(pdev->dev.of_node, "tsc");
+		of_property_read_u32(node, "ti,wires", &tsc_wires);
+
+		node = of_get_child_by_name(pdev->dev.of_node, "adc");
+		of_property_read_u32(node, "ti,adc-channels", &adc_channels);
+	}
 
-	tsc_wires = pdata->tsc_init->wires;
 	total_channels = tsc_wires + adc_channels;
 
 	if (total_channels > 8) {
@@ -266,11 +279,18 @@  static const struct dev_pm_ops tscadc_pm_ops = {
 #define TSCADC_PM_OPS NULL
 #endif
 
+static const struct of_device_id ti_tscadc_dt_ids[] = {
+	{ .compatible = "ti,am3359-tscadc", },
+	{ }
+};
+MODULE_DEVICE_TABLE(of, ti_tscadc_dt_ids);
+
 static struct platform_driver ti_tscadc_driver = {
 	.driver = {
-		.name   = "ti_tscadc",
+		.name   = "ti_am3359-tscadc",
 		.owner	= THIS_MODULE,
 		.pm	= TSCADC_PM_OPS,
+		.of_match_table = of_match_ptr(ti_tscadc_dt_ids),
 	},
 	.probe	= ti_tscadc_probe,
 	.remove	= ti_tscadc_remove,