Commit graph

8 commits

Author SHA1 Message Date
David van Moolenbroek 6700874deb Block drivers: make IOCTL request unsigned long
The block driver protocol and libblockdriver's bdr_ioctl hook are
changed, as well as the users of this hook. Other parts of the system
are expected to change accordingly eventually, since the ioctl(2)
prototype has been aligned with NetBSD's.

Change-Id: Ide46245b22cfa89ed267a38088fb0ab7696eba92
2014-02-19 11:22:15 +01:00
David van Moolenbroek 95624ae072 Block protocol: add user endpoint to IOCTL request
I/O control requests now come with the endpoint of the user process
that initiated the ioctl(2) call. It is stored in a new BDEV_USER
field, which is an alias for BDEV_FLAGS. The contents of this field
are to be used only in highly specific situations. It should be
preserved (not replaced!) by services that forward IOCTL requests,
and may be set to NONE for service-initiated IOCTL requests.

Change-Id: I68a01b9ce43eca00e61b985a9cf87f55ba683de4
2014-02-19 11:22:15 +01:00
David van Moolenbroek 0f7f3c0d54 libblockdriver: various updates
- internal structure rearrangement;
- respond to char device open requests to avoid hanging VFS threads;
- make drivers use designated initializers;
- use devminor_t for all minor device numbers;
- change bdr_other hook to take ipc_status and return nothing;
- fix default geometry computation;
- add support for sef_cancel.

Change-Id: Ia063a136a3ddb2b78de36180feda870605753d70
2014-02-19 11:22:15 +01:00
David van Moolenbroek 26cb85535e Block drivers: reply ENOTTY to unknown IOCTLs
Change-Id: Ie2e82d2491d546f4dd73b009100646e249a147b5
2014-02-19 11:22:15 +01:00
Thomas Cort 75bd3009d3 libi2cdriver: add functions for IC register access
Many i2c device drivers used similar code to access registers on
the ICs they drive. This commit implements that functionality in
libi2cdriver and updates the drivers to use the library instead of
their own register access functions. The net result is 375+ fewer
lines of code and less work for people developing new drivers.

The two exceptions were cat24c256 and parts of tda19988. They access
the bus in uncommon ways. It doesn't make sense at this time to
move their read/write functions into libi2cdriver.

Change-Id: Id8280b71af33b710a49944d7f20a7262be9f5988
2013-09-18 08:10:26 -04:00
Thomas Cort 493e4fffc5 tda19988: add missing blockdriver_announce() call
To provide EDID to fb, the TDA19988 implements the block device
protocol with libblockdriver. To properly use the library,
blockdriver_announce() should be called by the driver.

Issue reported by David van Moolenbroek

Change-Id: Id55d159d91502a9afac5c1d4de0fee1e8945b5c1
2013-09-18 08:10:26 -04:00
Thomas Cort 6405d78182 readclock/tda19988: fix compiler/cppcheck warnings
readclock:
 - the setup function for readclock on i386 was missing a return.
 - the message field for RTCDEV_GRANT wasn't the right type.

tda19988:
 - position variable was used without being initialized.

Change-Id: I3f78dd0a9d44f35eb38cb7da0974909f066b7007
2013-08-10 14:36:10 -04:00
Thomas Cort 1b78e86fb8 tda19988: driver for the TDA19988 HDMI Transmitter
Change-Id: Ia7750df3dd4ec4bd68624c800a0241c70eea7ca4
2013-07-29 12:38:01 -04:00