/** * struct gw_pld - State container for Gateworks PLD * @chip: GPIO chip instance * @client: I2C client * @out: shadow register for the output bute
*/ struct gw_pld { struct gpio_chip chip; struct i2c_client *client;
u8 out;
};
/* * The Gateworks I2C PLD chip only expose one read and one write register. * Writing a "one" bit (to match the reset state) lets that pin be used as an * input. It is an open-drain model.
*/ staticint gw_pld_input8(struct gpio_chip *gc, unsigned offset)
{ struct gw_pld *gw = gpiochip_get_data(gc);
/* * The Gateworks I2C PLD chip does not properly send the acknowledge * bit at all times, but we can still use the standard i2c_smbus * functions by simply ignoring this bit.
*/
client->flags |= I2C_M_IGNORE_NAK;
gw->out = 0xFF;
i2c_set_clientdata(client, gw);
ret = devm_gpiochip_add_data(dev, &gw->chip, gw); if (ret) return ret;
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.