// SPDX-License-Identifier: GPL-2.0-only /* * SH SCI SPI interface * * Copyright (c) 2008 Magnus Damm * * Based on S3C24XX GPIO based SPI driver, which is: * Copyright (c) 2006 Ben Dooks * Copyright (c) 2006 Simtec Electronics
*/
staticinlinevoid setbits(struct sh_sci_spi *sp, int bits, int on)
{ /* * We are the only user of SCSPTR so no locking is required. * Reading bit 2 and 0 in SCSPTR gives pin state as input. * Writing the same bits sets the output value. * This makes regular read-modify-write difficult so we * use sp->val to keep track of the latest register value.
*/
host = spi_alloc_host(&dev->dev, sizeof(struct sh_sci_spi)); if (host == NULL) {
dev_err(&dev->dev, "failed to allocate spi host\n");
ret = -ENOMEM; goto err0;
}
sp = spi_controller_get_devdata(host);
platform_set_drvdata(dev, sp);
sp->info = dev_get_platdata(&dev->dev); if (!sp->info) {
dev_err(&dev->dev, "platform data is missing\n");
ret = -ENOENT; goto err1;
}
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.