public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Dmitry Torokhov <dtor_core@ameritech.net>
To: linux-kernel@vger.kernel.org
Cc: Pavel Machek <pavel@ucw.cz>,
	rpurdie@rpsys.net, lenz@cs.wisc.edu, rmk@arm.linux.org.uk,
	vojtech@suse.cz
Subject: Re: [patch,rfc] Support for touchscreen on sharp zaurus sl-5500
Date: Thu, 21 Jul 2005 00:50:25 -0500	[thread overview]
Message-ID: <200507210050.26306.dtor_core@ameritech.net> (raw)
In-Reply-To: <20050721052455.GB7849@elf.ucw.cz>

Hi,

On Thursday 21 July 2005 00:24, Pavel Machek wrote:
>  
> +config TOUCHSCREEN_COLLIE
> +	tristate "Collie touchscreen (for Sharp SL-5500)"
> +	depends on MCP_UCB1200 && INPUT

I don't think you need && INPUT here.

>  
>  obj-$(CONFIG_TOUCHSCREEN_BITSY)	+= h3600_ts_input.o
>  obj-$(CONFIG_TOUCHSCREEN_CORGI)	+= corgi_ts.o
> +obj-$(CONFIG_TOUCHSCREEN_COLLIE)+= collie_ts.o

A tab would be nice.

> +
> +/*
> + * This is a RT kernel thread that handles the ADC accesses
> + * (mainly so we can use semaphores in the UCB1200 core code
> + * to serialise accesses to the ADC).  The UCB1400 access
> + * functions are expected to be able to sleep as well.
> + */
> +static int ucb1x00_thread(void *_ts)
> +{
> +	struct ucb1x00_ts *ts = _ts;
> +	struct task_struct *tsk = current;
> +	int valid;
> +
> +	ts->rtask = tsk;
> +
> +	daemonize("ktsd");
> +	/* only want to receive SIGKILL */
> +	allow_signal(SIGKILL);
> +

This should be converted to kthread interface.


> +static int ucb1x00_ts_open(struct input_dev *idev)
> +{
> +	struct ucb1x00_ts *ts = (struct ucb1x00_ts *)idev;
> +	int ret = 0;
> +
> +	if (down_interruptible(&ts->sem))
> +		return -EINTR;
> +
> +	if (ts->use_count++ != 0)
> +		goto out;
> +

Please kill both ts->sem and ts->use_count - input core already serializes
input_open and input_close.

> +	if (ts->rtask)
> +		panic("ucb1x00: rtask running?");
> +
> +	sema_init(&ts->irq_wait, 0);
> +	ret = ucb1x00_hook_irq(ts->ucb, UCB_IRQ_TSPX, ucb1x00_ts_irq, ts);
> +	if (ret < 0)
> +		goto out;
> +
> +	/*
> +	 * If we do this at all, we should allow the user to
> +	 * measure and read the X and Y resistance at any time.
> +	 */
> +	ucb1x00_adc_enable(ts->ucb);
> +	ts->x_res = ucb1x00_ts_read_xres(ts);
> +	ts->y_res = ucb1x00_ts_read_yres(ts);
> +	ucb1x00_adc_disable(ts->ucb);
> +
> +	init_completion(&ts->init_exit);
> +	ret = kernel_thread(ucb1x00_thread, ts, CLONE_KERNEL);
> +	if (ret >= 0) {
> +		wait_for_completion(&ts->init_exit);
> +		ret = 0;
> +	} else {
> +		ucb1x00_free_irq(ts->ucb, UCB_IRQ_TSPX, ts);
> +	}

	kthread_run(ucb1x00_thread, ts, "ktsd")...

> +
> +MODULE_PARM(adcsync, "i");
> +MODULE_PARM_DESC(adcsync, "Enable use of ADCSYNC signal");

Die, MODULE_PARM, die!

-- 
Dmitry

  reply	other threads:[~2005-07-21  5:50 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-07-21  5:24 [patch,rfc] Support for touchscreen on sharp zaurus sl-5500 Pavel Machek
2005-07-21  5:50 ` Dmitry Torokhov [this message]
2005-07-21 15:40   ` Pavel Machek
2005-07-22  0:24 ` Nish Aravamudan
2005-07-22  1:28   ` Pavel Machek
2005-07-22  5:02     ` Nish Aravamudan

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=200507210050.26306.dtor_core@ameritech.net \
    --to=dtor_core@ameritech.net \
    --cc=lenz@cs.wisc.edu \
    --cc=linux-kernel@vger.kernel.org \
    --cc=pavel@ucw.cz \
    --cc=rmk@arm.linux.org.uk \
    --cc=rpurdie@rpsys.net \
    --cc=vojtech@suse.cz \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox