/* * Some registers must be read back to modify. * To save time we cache them here in memory
*/ struct mc33880 { struct mutex lock; /* protect from simultaneous accesses */
u8 port_config; struct gpio_chip chip; struct spi_device *spi;
};
mc->port_config = 0x00; /* write twice, because during initialisation the first setting * is just for testing SPI communication, and the second is the * "real" configuration
*/
ret = mc33880_write_config(mc);
mc->port_config = 0x00; if (!ret)
ret = mc33880_write_config(mc);
if (ret) {
dev_err(&spi->dev, "Failed writing to " DRIVER_NAME ": %d\n",
ret); goto exit_destroy;
}
ret = gpiochip_add_data(&mc->chip, mc); if (ret) goto exit_destroy;
staticint __init mc33880_init(void)
{ return spi_register_driver(&mc33880_driver);
} /* register after spi postcore initcall and before * subsys initcalls that may rely on these GPIOs
*/
subsys_initcall(mc33880_init);
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.