Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 9609b59d authored by Heikki Krogerus's avatar Heikki Krogerus Committed by Jack Pham
Browse files

usb: typec: ucsi: Simplified registration and I/O API



Adding more simplified API for interface registration and
read and write operations.

The registration is split into separate creation and
registration phases. That allows the drivers to properly
initialize the interface before registering it if necessary.

The read and write operations are supplied in a completely
separate struct ucsi_operations that is passed to the
ucsi_register() function during registration. The new read
and write operations will work more traditionally so that
the read callback function reads a requested amount of data
from an offset, and the write callback functions write the
given data to the offset. The drivers will have to support
both non-blocking writing and blocking writing. In blocking
writing the driver itself is responsible of waiting for the
completion event.

The new API makes it possible for the drivers to perform
tasks also independently of the core ucsi.c, and that should
allow for example quirks to be handled completely in the
drivers without the need to touch ucsi.c.

The old API is kept until all drivers have been converted to
the new API.

Change-Id: Ica25b44b228a96adbc2bd397d74978db6074c82e
Signed-off-by: default avatarHeikki Krogerus <heikki.krogerus@linux.intel.com>
Tested-by: default avatarAjay Gupta <ajayg@nvidia.com>
Reviewed-by: default avatarGuenter Roeck <linux@roeck-us.net>
Link: https://lore.kernel.org/r/20191104142435.29960-12-heikki.krogerus@linux.intel.com


Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Git-commit: bdc62f2bae8fb0e8e99574de5232f0a3c54a27df
Git-repo: https://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb.git


Signed-off-by: default avatarJack Pham <jackp@codeaurora.org>
parent 088f52f1
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment