Re: [PATCH] platform/x86: Add Asus TF103C dock driver

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

 



On Wed, Jan 05, 2022 at 12:06:57PM +0100, Hans de Goede wrote:
> On 1/4/22 16:32, Andy Shevchenko wrote:
> > On Sun, Dec 26, 2021 at 03:18:49PM +0100, Hans de Goede wrote:

...

> >> +/* Byte 0 is the length of the rest of the packet */
> >> +static const u8 tf103c_dock_enable_cmd[9] = { 8, 0x20, 0, 0, 0, 0, 0x20, 0, 0 };
> >> +static const u8 tf103c_dock_usb_enable_cmd[9] = { 8, 0, 0, 0, 0, 0, 0, 0x40, 0 };
> >> +static const u8 tf103c_dock_suspend_cmd[9] = { 8, 0, 0x20, 0, 0, 0x22, 0, 0, 0 };
> > 
> > This seems to me rather
> > 
> > struct {
> > 	u8 cmd;
> > 	DECLARE_BITMAP(payload, 64);
> > };
> > 
> > And those 2s and 4s are actually some bits in payload with some meaning.
> > 
> > Would it be the case?
> 
> Something like that yes, there are some hints that this is a bitfield in
> the Android driver code, but then in other places it seems to be more of
> a command structure then just individual bits having a meaning.
> 
> All in all we really don't know, so I'm going to keep this as just
> an opaque array of bytes, because that is really what it is / what we know
> about it.

Thinking more about this it rather __le64. then it's more easily to see the
bits there. I still think the byte array here carries less information than
what we can assume. In the case of __le64 you don't need to keep a length,
you may derive it from the size of the supplied variable.

-- 
With Best Regards,
Andy Shevchenko





[Index of Archives]     [Linux Kernel Development]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux