Re: Serdev: USB device and sysdev probing ala i2c

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Thu, May 24, 2018 at 7:18 AM, Ricardo Ribalda Delgado
<ricardo.ribalda@xxxxxxxxx> wrote:
> Hi Johan,
>
> On Thu, May 24, 2018 at 2:07 PM Johan Hovold <johan@xxxxxxxxxx> wrote:
>
>> Hi Ricardo,
>
>> On Wed, May 23, 2018 at 11:17:20AM +0200, Ricardo Ribalda Delgado wrote:
>> > Hi
>> >
>> > I have a flash controller connected to the main computer via a usb to
>> > serial. My plan is to expose it to the system as a video4linux
> subdevice.
>> >
>> > With the inclusion of serdev I was expecting that it would be as easy as
>> > adding a i2c device, but seems that there are some functionality that
> it is
>> > still not implemented:
>> >
>> > 1) Serdev for usb serial devices.
>
>> Right, I didn't want to enable serdev for USB serial before we have
>> determined how to handle hotplugging (e.g. in serdev core or by making
>> sure every serdev driver can handle devices going away at any time) in
>> order to avoid having things crash left and right.
>
>> I have out-of-tree code for USB serial that I use for testing purposes,
>> so it's mostly a matter of finding the time to think this through.
>
> Could you share those patches? I would love to test them.
> In my setup the system does not support hotplugg and/or power saving.
>
>
>> > 2) Instatiating via sysfs. Something like
>> > echo hci_nokia > /sys/bus/serio/devices/serio0/new_device
>> > (inspired in: echo eeprom 0x50 > /sys/bus/i2c/devices/i2c-3/new_device)
>
>> Serdev currently only supports device tree and ACPI. Using out-of-tree
>> code, you could load a device tree fragment during runtime to describe
>> your serial bus (or you just amend the device tree).
>
>> Using device tree overlays would have the benefit of being able to
>> describe associated resources (e.g. reset gpios) which a simple
>> compatible string (or equivalent) would not.
>
>> But there are examples where a simple compatible string would do, for
>> example an existing CEC device presenting itself as a generic USB CDC
>> device (hopefully with a dedicated VID/PID so that no user-space
>> configuration is needed at all).
>
> What about platform devices? Can it be instatiated like that?

Platform devices generally mean memory mapped devices. How would that
work thru serial? I guess you could have some serial to mmio bridge
exposed thru regmap.

The fundamental problem here is you need a parent device node to apply
a DT overlay to and a USB device hotplugged has no DT device node. The
system you are running on may not even have a DT (like a PC). If you
have an overlay of the downstream devices, they have to be a child of
something for the overlay to apply to. We could just create virtual
device nodes for the purposes of applying overlays to. Another option
would be allowing multiple DTs. Then you aren't even using overlays
(what's the point of an overlay when a system has no real DT to begin
with). That also would mean they are completely independent from any
real DT or other instances (you may want to plug in multiple of the
same device).

Rob
--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[Index of Archives]     [Linux Media]     [Linux Input]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [Old Linux USB Devel Archive]

  Powered by Linux