/* * By attaching hardware latches to the EBU it is possible to create output * only gpios. This driver configures a special memory address, which when * written to outputs 16 bit to the latches.
*/
#define LTQ_EBU_BUSCON 0x1e7ff /* 16 bit access, slowest timing */ #define LTQ_EBU_WP 0x80000000 /* write protect bit */
struct ltq_mm { struct of_mm_gpio_chip mmchip;
u16 shadow; /* shadow the latches state */
};
/** * ltq_mm_apply() - write the shadow value to the ebu address. * @chip: Pointer to our private data structure. * * Write the shadow value to the EBU to set the gpios. We need to set the * global EBU lock to make sure that PCI/MTD don't break.
*/ staticvoid ltq_mm_apply(struct ltq_mm *chip)
{ unsignedlong flags;
/** * ltq_mm_set() - gpio_chip->set - set gpios. * @gc: Pointer to gpio_chip device structure. * @gpio: GPIO signal number. * @val: Value to be written to specified signal. * * Set the shadow value and call ltq_mm_apply. Always returns 0.
*/ staticint ltq_mm_set(struct gpio_chip *gc, unsignedint offset, int value)
{ struct ltq_mm *chip = gpiochip_get_data(gc);
/** * ltq_mm_dir_out() - gpio_chip->dir_out - set gpio direction. * @gc: Pointer to gpio_chip device structure. * @gpio: GPIO signal number. * @val: Value to be written to specified signal. * * Same as ltq_mm_set, always returns 0.
*/ staticint ltq_mm_dir_out(struct gpio_chip *gc, unsigned offset, int value)
{ return ltq_mm_set(gc, offset, value);
}
/* store the shadow value if one was passed by the devicetree */ if (!of_property_read_u32(pdev->dev.of_node, "lantiq,shadow", &shadow))
chip->shadow = shadow;
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.