Skip to contentSkip to conversation

drm/bridge: ti-tfp410: switch to using fwnode_gpiod_get_index()

PATCH In review Dmitry Torokhov 5 participants 11 messages Oct 14, 2019 – Nov 13, 2019

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 drm/bridge: ti-tfp410: switch to using fwnode_gpiod_get_index()

Instead of fwnode_get_named_gpiod() that I plan to hide away, let's use the new fwnode_gpiod_get_index() that mimics gpiod_get_index(), but works with arbitrary firmware node.

---

Andrzej, Neil,

This depends on the new code that can be bound in ib-fwnode-gpiod-get-index immutable branch of Linus' Walleij tree:

git pull git://git.kernel.org/pub/scm/linux/kernel/git/linusw/linux-gpio.git ib-fwnode-gpiod-get-index

I hope that it would be possible to pull in this immutable branch and not wait until after 5.5 merge window, or, alternatively, merge through Linus Walleij's tree.

Thanks!

 drivers/gpu/drm/bridge/ti-tfp410.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/gpu/drm/bridge/ti-tfp410.c +2 -2
index aa3198dc9903..6f6d6d1e60ae 100644
@@ -285,8 +285,8 @@ static int tfp410_get_connector_properties(struct tfp410 *dvi)
 	else
 		dvi->connector_type = DRM_MODE_CONNECTOR_DVID;
 
-	dvi->hpd = fwnode_get_named_gpiod(&connector_node->fwnode,
-					"hpd-gpios", 0, GPIOD_IN, "hpd");
+	dvi->hpd = fwnode_gpiod_get_index(&connector_node->fwnode,
+					  "hpd", 0, GPIOD_IN, "hpd");
 	if (IS_ERR(dvi->hpd)) {
 		ret = PTR_ERR(dvi->hpd);
 		dvi->hpd = NULL;
Signature · 5 lines
2.23.0.700.g56cf767bdb-goog


-- 
Dmitry
#1 lore raw
I love your patch! Yet something to improve:

Hi Dmitry,

I love your patch! Yet something to improve:

[auto build test ERROR on linus/master]
[cannot apply to v5.4-rc3 next-20191014]
[if your patch is applied to the wrong git tree, please drop us a note to help improve the system. BTW, we also suggest to use '--base' option to specify the base tree in git format-patch, please see https://stackoverflow.com/a/37406982]

url: https://github.com/0day-ci/linux/commits/Dmitry-Torokhov/drm-bridge-ti-tfp410-switch-to-using-fwnode_gpiod_get_index/20191015-024641
config: mips-allmodconfig (attached as .config)
compiler: mips-linux-gcc (GCC) 7.4.0
reproduce:
wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross chmod +x ~/bin/make.cross
# save the attached .config to linux build tree
GCC_VERSION=7.4.0 make.cross ARCH=mips

If you fix the issue, kindly add following tag

All error/warnings (new ones prefixed by >>):

drivers/gpu//drm/bridge/ti-tfp410.c: In function 'tfp410_get_connector_properties':

>> drivers/gpu//drm/bridge/ti-tfp410.c:287:13: error: implicit declaration of function 'fwnode_gpiod_get_index'; did you mean 'devm_gpiod_get_index'? [-Werror=implicit-function-declaration]
     dvi->hpd = fwnode_gpiod_get_index(&connector_node->fwnode,
                ^~~~~~~~~~~~~~~~~~~~~~
                devm_gpiod_get_index
>> drivers/gpu//drm/bridge/ti-tfp410.c:287:11: warning: assignment makes pointer from integer without a cast [-Wint-conversion]
     dvi->hpd = fwnode_gpiod_get_index(&connector_node->fwnode,
              ^

cc1: some warnings being treated as errors

vim +287 drivers/gpu//drm/bridge/ti-tfp410.c

271
272 static int tfp410_get_connector_properties(struct tfp410 *dvi)
273 {
274 struct device_node *connector_node, *ddc_phandle;
275 int ret = 0;
276
277 /* port@1 is the connector node */
278 connector_node = of_graph_get_remote_node(dvi->dev->of_node, 1, -1);
279 if (!connector_node)
280 return -ENODEV;
281
282 if (of_device_is_compatible(connector_node, "hdmi-connector"))
283 dvi->connector_type = DRM_MODE_CONNECTOR_HDMIA;
284 else
285 dvi->connector_type = DRM_MODE_CONNECTOR_DVID;
286

 > 287		dvi->hpd = fwnode_gpiod_get_index(&connector_node->fwnode,

288 "hpd", 0, GPIOD_IN, "hpd");
289 if (IS_ERR(dvi->hpd)) {
290 ret = PTR_ERR(dvi->hpd);
291 dvi->hpd = NULL;
292 if (ret == -ENOENT)
293 ret = 0;
294 else
295 goto fail;
296 }
297
298 ddc_phandle = of_parse_phandle(connector_node, "ddc-i2c-bus", 0);
299 if (!ddc_phandle)
300 goto fail;
301
302 dvi->ddc = of_get_i2c_adapter_by_node(ddc_phandle);
303 if (dvi->ddc)
304 dev_info(dvi->dev, "Connector's ddc i2c bus found\n");
305 else
306 ret = -EPROBE_DEFER;
307
308 of_node_put(ddc_phandle);
309
310 fail:
311 of_node_put(connector_node);
312 return ret;
313 }
314

---
0-DAY kernel test infrastructure Open Source Technology Center
https://lists.01.org/pipermail/kbuild-all Intel Corporation

#2 lore raw
In reply to Dmitry Torokhov
I love your patch! Perhaps something to improve:

Hi Dmitry,

I love your patch! Perhaps something to improve:

[auto build test WARNING on linus/master]
[cannot apply to v5.4-rc3 next-20191014]
[if your patch is applied to the wrong git tree, please drop us a note to help improve the system. BTW, we also suggest to use '--base' option to specify the base tree in git format-patch, please see https://stackoverflow.com/a/37406982]

url: https://github.com/0day-ci/linux/commits/Dmitry-Torokhov/drm-bridge-ti-tfp410-switch-to-using-fwnode_gpiod_get_index/20191015-024641
config: nds32-allmodconfig (attached as .config)
compiler: nds32le-linux-gcc (GCC) 8.1.0
reproduce:
wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross chmod +x ~/bin/make.cross
# save the attached .config to linux build tree
GCC_VERSION=8.1.0 make.cross ARCH=nds32

If you fix the issue, kindly add following tag

All warnings (new ones prefixed by >>):

drivers/gpu/drm/bridge/ti-tfp410.c: In function 'tfp410_get_connector_properties':
drivers/gpu/drm/bridge/ti-tfp410.c:287:13: error: implicit declaration of function 'fwnode_gpiod_get_index'; did you mean 'devm_gpiod_get_index'? [-Werror=implicit-function-declaration]

     dvi->hpd = fwnode_gpiod_get_index(&connector_node->fwnode,
                ^~~~~~~~~~~~~~~~~~~~~~
                devm_gpiod_get_index
>> drivers/gpu/drm/bridge/ti-tfp410.c:287:11: warning: assignment to 'struct gpio_desc *' from 'int' makes pointer from integer without a cast [-Wint-conversion]
     dvi->hpd = fwnode_gpiod_get_index(&connector_node->fwnode,
              ^

cc1: some warnings being treated as errors

vim +287 drivers/gpu/drm/bridge/ti-tfp410.c

271
272 static int tfp410_get_connector_properties(struct tfp410 *dvi)
273 {
274 struct device_node *connector_node, *ddc_phandle;
275 int ret = 0;
276
277 /* port(a)1 is the connector node */
278 connector_node = of_graph_get_remote_node(dvi->dev->of_node, 1, -1);
279 if (!connector_node)
280 return -ENODEV;
281
282 if (of_device_is_compatible(connector_node, "hdmi-connector"))
283 dvi->connector_type = DRM_MODE_CONNECTOR_HDMIA;
284 else
285 dvi->connector_type = DRM_MODE_CONNECTOR_DVID;
286

 > 287		dvi->hpd = fwnode_gpiod_get_index(&connector_node->fwnode,

288 "hpd", 0, GPIOD_IN, "hpd");
289 if (IS_ERR(dvi->hpd)) {
290 ret = PTR_ERR(dvi->hpd);
291 dvi->hpd = NULL;
292 if (ret == -ENOENT)
293 ret = 0;
294 else
295 goto fail;
296 }
297
298 ddc_phandle = of_parse_phandle(connector_node, "ddc-i2c-bus", 0);
299 if (!ddc_phandle)
300 goto fail;
301
302 dvi->ddc = of_get_i2c_adapter_by_node(ddc_phandle);
303 if (dvi->ddc)
304 dev_info(dvi->dev, "Connector's ddc i2c bus found\n");
305 else
306 ret = -EPROBE_DEFER;
307
308 of_node_put(ddc_phandle);
309
310 fail:
311 of_node_put(connector_node);
312 return ret;
313 }
314

---
0-DAY kernel test infrastructure Open Source Technology Center
https://lists.01.org/pipermail/kbuild-all Intel Corporation

#3 lore raw
In reply to Dmitry Torokhov
Quoted 10 lines · Dmitry Torokhov

Instead of fwnode_get_named_gpiod() that I plan to hide away, let's use the new fwnode_gpiod_get_index() that mimics gpiod_get_index(), but works with arbitrary firmware node.

---

Andrzej, Neil,

Quoted 8 lines

This depends on the new code that can be bound in ib-fwnode-gpiod-get-index immutable branch of Linus' Walleij tree:

git pull git://git.kernel.org/pub/scm/linux/kernel/git/linusw/linux-gpio.git ib-fwnode-gpiod-get-index

I hope that it would be possible to pull in this immutable branch and not wait until after 5.5 merge window, or, alternatively, merge through Linus Walleij's tree.

Any chance this could be merged, please?

Quoted 27 lines

Thanks!

 drivers/gpu/drm/bridge/ti-tfp410.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/gpu/drm/bridge/ti-tfp410.c +2 -2
index aa3198dc9903..6f6d6d1e60ae 100644
@@ -285,8 +285,8 @@ static int tfp410_get_connector_properties(struct tfp410 *dvi)
 	else
 		dvi->connector_type = DRM_MODE_CONNECTOR_DVID;
 
-	dvi->hpd = fwnode_get_named_gpiod(&connector_node->fwnode,
-					"hpd-gpios", 0, GPIOD_IN, "hpd");
+	dvi->hpd = fwnode_gpiod_get_index(&connector_node->fwnode,
+					  "hpd", 0, GPIOD_IN, "hpd");
 	if (IS_ERR(dvi->hpd)) {
 		ret = PTR_ERR(dvi->hpd);
 		dvi->hpd = NULL;
Signature · 5 lines
2.23.0.700.g56cf767bdb-goog


-- 
Dmitry
Signature · 1 line
Dmitry
#4 lore raw
Quoted 15 lines · Dmitry Torokhov
Quoted 13 lines · Dmitry Torokhov

Instead of fwnode_get_named_gpiod() that I plan to hide away, let's use the new fwnode_gpiod_get_index() that mimics gpiod_get_index(), but works with arbitrary firmware node.

---

Andrzej, Neil,

This depends on the new code that can be bound in ib-fwnode-gpiod-get-index immutable branch of Linus' Walleij tree:

Quoted 7 lines
Quoted 5 lines

git pull git://git.kernel.org/pub/scm/linux/kernel/git/linusw/linux-gpio.git ib-fwnode-gpiod-get-index

I hope that it would be possible to pull in this immutable branch and not wait until after 5.5 merge window, or, alternatively, merge through Linus Walleij's tree.

Any chance this could be merged, please?

I'm happy to merge it into the GPIO tree if some DRM maintainer can provide an ACK.

Getting ACK from DRM people is problematic and a bit of friction in the community, DVetter usually advice to seek mutual reviews etc, but IMO it would be better if some people felt more compelled to review stuff eventually. (And that has the problem that it doesn't scale.)

Yours,
Linus Walleij
_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel

#5 lore raw
Quoted 20 lines · Linus Walleij
Quoted 17 lines · Dmitry Torokhov
Quoted 15 lines · Dmitry Torokhov

Instead of fwnode_get_named_gpiod() that I plan to hide away, let's use the new fwnode_gpiod_get_index() that mimics gpiod_get_index(), but works with arbitrary firmware node.

---

Andrzej, Neil,

This depends on the new code that can be bound in ib-fwnode-gpiod-get-index immutable branch of Linus' Walleij tree:

git pull git://git.kernel.org/pub/scm/linux/kernel/git/linusw/linux-gpio.git ib-fwnode-gpiod-get-index

Quoted 8 lines
Quoted 5 lines
Quoted 3 lines

I hope that it would be possible to pull in this immutable branch and not wait until after 5.5 merge window, or, alternatively, merge through Linus Walleij's tree.

Any chance this could be merged, please?

I'm happy to merge it into the GPIO tree if some DRM maintainer can provide an ACK.

Ack.

Quoted 4 lines

Getting ACK from DRM people is problematic and a bit of friction in the community, DVetter usually advice to seek mutual reviews etc, but IMO it would be better if some people felt more compelled to review stuff eventually. (And that has the problem that it doesn't scale.)

This has a review already plus if you merge your implied review. That's more than good enough imo, so not seeing the issue here? -Daniel

Signature · 7 lines
Daniel Vetter
Software Engineer, Intel Corporation
+41 (0) 79 365 57 48 - http://blog.ffwll.ch
_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel
#6 lore raw

Hi Daniel,

Quoted 30 lines · Daniel Vetter
Quoted 18 lines · Linus Walleij
Quoted 17 lines · Dmitry Torokhov
Quoted 15 lines · Dmitry Torokhov

Instead of fwnode_get_named_gpiod() that I plan to hide away, let's use the new fwnode_gpiod_get_index() that mimics gpiod_get_index(), but works with arbitrary firmware node.

---

Andrzej, Neil,

This depends on the new code that can be bound in ib-fwnode-gpiod-get-index immutable branch of Linus' Walleij tree:

git pull git://git.kernel.org/pub/scm/linux/kernel/git/linusw/linux-gpio.git ib-fwnode-gpiod-get-index

Quoted 8 lines
Quoted 5 lines
Quoted 3 lines

I hope that it would be possible to pull in this immutable branch and not wait until after 5.5 merge window, or, alternatively, merge through Linus Walleij's tree.

Any chance this could be merged, please?

I'm happy to merge it into the GPIO tree if some DRM maintainer can provide an ACK.

Ack.

Quoted 7 lines
Quoted 4 lines

Getting ACK from DRM people is problematic and a bit of friction in the community, DVetter usually advice to seek mutual reviews etc, but IMO it would be better if some people felt more compelled to review stuff eventually. (And that has the problem that it doesn't scale.)

This has a review already plus if you merge your implied review. That's more than good enough imo, so not seeing the issue here?

Isn't the issue that the patch should have been picked by someone for drm-misc ?

Signature · 3 lines
Regards,

Laurent Pinchart
#7 lore raw
Quoted 38 lines · Laurent Pinchart

Hi Daniel,

Quoted 35 lines · Daniel Vetter
Quoted 18 lines · Linus Walleij
Quoted 17 lines · Dmitry Torokhov
Quoted 15 lines · Dmitry Torokhov

Instead of fwnode_get_named_gpiod() that I plan to hide away, let's use the new fwnode_gpiod_get_index() that mimics gpiod_get_index(), but works with arbitrary firmware node.

---

Andrzej, Neil,

This depends on the new code that can be bound in ib-fwnode-gpiod-get-index immutable branch of Linus' Walleij tree:

git pull git://git.kernel.org/pub/scm/linux/kernel/git/linusw/linux-gpio.git ib-fwnode-gpiod-get-index

Quoted 8 lines
Quoted 5 lines
Quoted 3 lines

I hope that it would be possible to pull in this immutable branch and not wait until after 5.5 merge window, or, alternatively, merge through Linus Walleij's tree.

Any chance this could be merged, please?

I'm happy to merge it into the GPIO tree if some DRM maintainer can provide an ACK.

Ack.

Quoted 4 lines

Getting ACK from DRM people is problematic and a bit of friction in the community, DVetter usually advice to seek mutual reviews etc, but IMO it would be better if some people felt more compelled to review stuff eventually. (And that has the problem that it doesn't scale.)

Quoted 5 lines
Quoted 2 lines

This has a review already plus if you merge your implied review. That's more than good enough imo, so not seeing the issue here?

Isn't the issue that the patch should have been picked by someone for drm-misc ?

It requires prep work that isn't in drm-misc I thought? Anyway, Linus has commit rights to drm-misc, could also push it there.

Plus you have, except you don't want it.
-Daniel

Signature · 7 lines
Daniel Vetter
Software Engineer, Intel Corporation
http://blog.ffwll.ch
_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel
#8 lore raw
In reply to Daniel Vetter
Quoted 8 lines · Daniel Vetter
Quoted 5 lines · Linus Walleij

On Tue, Nov 5, 2019 at 1:40 AM Dmitry Torokhov
<[email protected]> wrote:

I'm happy to merge it into the GPIO tree if some DRM maintainer can provide an ACK.

Ack.

Thanks!

Quoted 6 lines
Quoted 4 lines

Getting ACK from DRM people is problematic and a bit of friction in the community, DVetter usually advice to seek mutual reviews etc, but IMO it would be better if some people felt more compelled to review stuff eventually. (And that has the problem that it doesn't scale.)

This has a review already plus if you merge your implied review.

Yeah I missed Laurent's review tag. I needed some kund of consent to take it into the GPIO tree I suppose.

Quoted 1 line

That's more than good enough imo, so not seeing the issue here?

No issue.

What freaked me out was the option of having to pull in an immutable branch from my GPIO tree into drm-misc. That would have been scary. Keeping it all in my tree works fine.

Yours,
Linus Walleij
_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel

#9 lore raw
Quoted 22 lines · Linus Walleij
Quoted 8 lines · Daniel Vetter
Quoted 5 lines · Linus Walleij

On Tue, Nov 5, 2019 at 1:40 AM Dmitry Torokhov
<[email protected]> wrote:

I'm happy to merge it into the GPIO tree if some DRM maintainer can provide an ACK.

Ack.

Thanks!

Quoted 6 lines
Quoted 4 lines

Getting ACK from DRM people is problematic and a bit of friction in the community, DVetter usually advice to seek mutual reviews etc, but IMO it would be better if some people felt more compelled to review stuff eventually. (And that has the problem that it doesn't scale.)

This has a review already plus if you merge your implied review.

Yeah I missed Laurent's review tag. I needed some kund of consent to take it into the GPIO tree I suppose.

Quoted 7 lines
Quoted 1 line

That's more than good enough imo, so not seeing the issue here?

No issue.

What freaked me out was the option of having to pull in an immutable branch from my GPIO tree into drm-misc. That would have been scary. Keeping it all in my tree works fine.

For next time around, just ping one of the drm-misc (or drm maintainers) for an ack to merge it through a different tree. Or ask them what they want to do. committer model isn't 100% free-wheeling, for cross-tree stuff you still have maintainers who're supposed to do their jobs :-)

But by default everyone will assume you'll just commit, so you need to poke them explicitly (like you've done here).
-Daniel

Signature · 3 lines
Daniel Vetter
Software Engineer, Intel Corporation
http://blog.ffwll.ch
#10 lore raw
In reply to Dmitry Torokhov
Quoted 6 lines · Dmitry Torokhov

Instead of fwnode_get_named_gpiod() that I plan to hide away, let's use the new fwnode_gpiod_get_index() that mimics gpiod_get_index(), but works with arbitrary firmware node.

I applied this with some ACKs to the GPIO devel branch for v5.5.

Yours,
Linus Walleij
_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel