/** * struct grts_state - generic resistive touch screen information struct * @x_plate_ohms: resistance of the X plate * @pressure_min: number representing the minimum for the pressure * @pressure: are we getting pressure info or not * @iio_chans: list of channels acquired * @iio_cb: iio_callback buffer for the data * @input: the input device structure that we register * @prop: touchscreen properties struct * @ch_map: map of channels that are defined for the touchscreen
*/ struct grts_state {
u32 x_plate_ohms;
u32 pressure_min; bool pressure; struct iio_channel *iio_chans; struct iio_cb_buffer *iio_cb; struct input_dev *input; struct touchscreen_properties prop;
u8 ch_map[GRTS_CH_MAX];
};
st = devm_kzalloc(dev, sizeof(struct grts_state), GFP_KERNEL); if (!st) return -ENOMEM;
/* get the channels from IIO device */
st->iio_chans = devm_iio_channel_get_all(dev); if (IS_ERR(st->iio_chans)) return dev_err_probe(dev, PTR_ERR(st->iio_chans), "can't get iio channels\n");
if (!device_property_present(dev, "io-channel-names")) return -ENODEV;
error = grts_get_properties(st, dev); if (error) {
dev_err(dev, "Failed to parse properties\n"); return error;
}
if (st->pressure) {
error = device_property_read_u32(dev, "touchscreen-min-pressure",
&st->pressure_min); if (error) {
dev_dbg(dev, "can't get touchscreen-min-pressure property.\n");
st->pressure_min = GRTS_DEFAULT_PRESSURE_MIN;
}
}
input = devm_input_allocate_device(dev); if (!input) {
dev_err(dev, "failed to allocate input device.\n"); return -ENOMEM;
}
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.