summaryrefslogtreecommitdiffstats
path: root/tests/pca9552-test.c
Commit message (Collapse)AuthorAgeFilesLines
* libqos: i2c: move address into QI2CDevicePaolo Bonzini2019-06-031-17/+14Star
| | | | | | | | | | | | This removes the hardcoded I2C address from the tests. The address is passed via QOSGraphEdgeOptions to i2c_device_create and stored in the QI2CDevice. The i2c_send and i2c_recv functions, along with their wrappers, therefore, can be changed to take a QI2CDevice rather than an adapter/address pair. Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
* tests: convert OMAP i2c tests to qgraphPaolo Bonzini2019-06-031-25/+19Star
| | | | | | | This way, pca9952-test and tmp105-test will run for every machine that exposes an i2c-bus. Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
* libqos: split I2CAdapter initialization and allocationPaolo Bonzini2019-06-031-1/+1
| | | | | | | | | | | | | | Provide *_init functions that populate an I2CAdapter struct without allocating one, and make the existing *_create functions wrap them. Because in the new setup *_create might return a pointer inside the IMXI2C or OMAPI2C struct, create companion *_free functions to go back to the outer pointer. All this is temporary until allocation will be handled entirely by qgraph. Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
* pca9552-test: do not rely on state across testsPaolo Bonzini2019-06-031-4/+11
| | | | | | | | | receive_autoinc is relying on the LED state that is set by send_and_receive. Stop doing that, because qgraph resets the machine between tests. Reviewed-by: Thomas Huth <thuth@redhat.com> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
* libqos: move common i2c code to libqosPaolo Bonzini2019-06-031-29/+8Star
| | | | | | | | | | | | | The functions to read/write 8-bit or 16-bit registers are the same in tmp105 and pca9552 tests, and in fact they are a special case of "read block"/"write block" functionality; read block in turn is used in ds1338-test. Move everything inside libqos-test, removing the duplication. Account for the small differences by adding to tmp105-test.c the "read register after writing" behavior that is specific to it. Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
* misc: add pca9552 LED blinker modelCédric Le Goater2018-06-081-0/+116
Specs are available here : https://www.nxp.com/docs/en/application-note/AN264.pdf This is a simple model supporting the basic registers for led and GPIO mode. The device also supports two blinking rates but not the model yet. Signed-off-by: Cédric Le Goater <clg@kaod.org> Reviewed-by: Peter Maydell <peter.maydell@linaro.org> Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org> Message-id: 20180530064049.27976-7-clg@kaod.org Signed-off-by: Peter Maydell <peter.maydell@linaro.org>