devicetree.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* emxx_udc device tree bindings
@ 2018-09-20 18:35 Arkadiusz Lis
  2018-09-20 18:57 ` Dan Carpenter
  0 siblings, 1 reply; 2+ messages in thread
From: Arkadiusz Lis @ 2018-09-20 18:35 UTC (permalink / raw)
  To: devicetree; +Cc: devel, gregkh, linus.walleij, chrisadr, dan.carpenter

Hi all,
I would like to help getting emxx_udc driver out of staging.
One of the things to do is to adjust it to using device tree.
The bindings are not defined yet. I have a blurred idea what properties are needed
however I've never done it and your support and comments will be really appreciated.

So, the drivers usually need the 'compatible' property with the manufacturer and device name,
so it is probably needed here as well.

According to Documentation/driver-api/gpio/board.rst,
to use gpio consumer interface (also on TODO list), '<function>-gpios'
property will be required. '<function>' is the name that is referenced in the driver
to obtain the gpio via gpiod_get(). Linus Walleij proposed 'vbus-gpios'.

IRQs are also used in this driver: USB_UDC_IRQ_1 and INT_VBUS,
it seems that 'interrupts' property will also be required.

Also memory region is mapped in the probe function.
	r = platform_get_resource(pdev, IORESOURCE_MEM, 0);
	mmio_base = devm_ioremap_resource(&pdev->dev, r);

Maybe 'reg' property can be used to describe physical base address and size of register map?
What are your suggestions?

Thanks for help,
Arek

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: emxx_udc device tree bindings
  2018-09-20 18:35 emxx_udc device tree bindings Arkadiusz Lis
@ 2018-09-20 18:57 ` Dan Carpenter
  0 siblings, 0 replies; 2+ messages in thread
From: Dan Carpenter @ 2018-09-20 18:57 UTC (permalink / raw)
  To: Arkadiusz Lis; +Cc: devel, devicetree, linus.walleij, chrisadr, gregkh

I don't know about device tree...

There a bunch of easy aesthetic things one could do.

1) Get rid of forward declarations. (I haven't looked if this is easy).
2) Remove underscore prefixes from names.
3) Fix the comments.  (Delete most of them).
4) pr_info("=== %s()\n", __func__);  <-- delete useles prints
5) Clean up the strange white space.
6) Also it's a bad idea to try to align declarations inside a .c file.
   That's fine for struct declarations in a .h file but in a .c file we
   mess with stuff too much.  You need to change all the declarations to
   make them line up but it's not really related to the patch so you're
   not allowed to change them.  Catch-22.

   In other words change:
-	int             result = -EINVAL;
+	int result = -EINVAL;
7) Remove pointless NULL checks:

	ep = container_of(_ep, struct nbu2ss_ep, ep);
	if (!ep) {

We already know the _ep is non-NULL so that means container_of() can't
be NULL.

regards,
dan carpenter

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2018-09-20 18:57 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-09-20 18:35 emxx_udc device tree bindings Arkadiusz Lis
2018-09-20 18:57 ` Dan Carpenter

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).