[PATCH v3] Add OLPC AP-SP input driver

Dmitry Torokhov dmitry.torokhov at gmail.com
Sat Jun 29 04:20:00 EST 2013


Hi Daniel,

On Fri, Jun 28, 2013 at 01:19:58PM -0400, Daniel Drake wrote:
> +static int olpc_apsp_open(struct serio *port)
> +{
> +	struct olpc_apsp *priv = port->port_data;
> +	unsigned int tmp;
> +
> +	if (priv->open_count++ == 0) {
> +		/* Enable interrupt 0 by clearing its bit */
> +		tmp = readl(priv->base + PJ_INTERRUPT_MASK);
> +		writel(tmp & ~INT_0, priv->base + PJ_INTERRUPT_MASK);
> +	}
> +
> +	return 0;
> +}
> +
> +static void olpc_apsp_close(struct serio *port)
> +{
> +	struct olpc_apsp *priv = port->port_data;
> +	unsigned int tmp;
> +
> +	if (--priv->open_count == 0) {

Both need locking. It looks like you need the song and dance similar to
what i8042 has to do with it's multiplexed ports. Or ps2mult.c...

-- 
Dmitry


More information about the devicetree-discuss mailing list