All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jiri Slaby <jirislaby@gmail.com>
To: Andrew Morton <akpm@linux-foundation.org>
Cc: linux-kernel@vger.kernel.org,
	johann deneux <johann.deneux@gmail.com>,
	Dmitry Torokhov <dtor@insightbb.com>,
	stenyak@gmail.com, linux-input@atrey.karlin.mff.cuni.cz
Subject: Re: [RFC 2/2] Input: phantom, add a new driver
Date: Fri, 20 Apr 2007 11:01:09 +0200	[thread overview]
Message-ID: <46288155.7060701@gmail.com> (raw)
In-Reply-To: <20070419230719.a118a132.akpm@linux-foundation.org>

Andrew Morton napsal(a):
> On Tue, 17 Apr 2007 22:02:10 +0200 (CEST) Jiri Slaby <jirislaby@gmail.com> wrote:
> 
>> phantom, add a new driver
[...]
>> +#define PHANTOM_VERSION		"n0.9.4"
> 
> That's an impressive version number ;)

fork of 0.8 or so 2.4 linux driver -> the n in the meaning of new :)

>> +#define PHM_MAX_TORQUES		3
>> +
>> +#define PHN_CONTROL		0x6
>> +#define PHN_CTL_AMP		0x1
>> +#define PHN_CTL_BUT		0x2
>> +#define PHN_CTL_IRQ		0x10
>> +
>> +#define PHN_IRQCTL		0x4c
>> +
>> +#define PHN_ZERO_FORCE		2048
> 
> <wonders what all those do>

I have no clue too, cut&paste from sensable 2.4 driver. But I'll document as
much as possible.

>> +#define PCI_ENCODER(dev, axis) ((0 - (int)ioread32((dev)->iaddr + (axis))) & \
>> +									0xffff)
> 
> Is there any reason why this cannot be a lower-cased inline C function? 
> Nicer to read, typesafe, etc.

yes, I'll switch it.

>> +#define PHB_RUNNING		1
>> +#define PHB_RESET		2
>> +
>> +static struct PH_CLASSTYPE *phantom_class;
> 
> I guess that PH_CLASSTYPE is some protect-me-from-gregkh compatibility
> thing.  But there isn't such a macro in the tree.  I switched this to plain
> old `class'.

Yes, my bad.

>> +
>> +static irqreturn_t phantom_isr(int irq, void *data)
>> +{
>> +	struct phantom_device *dev = data;
>> +	struct input_dev *idev = dev->idev;
>> +	unsigned int a, hw_status;
>> +
>> +	hw_status = ioread32(dev->iaddr + PHN_CONTROL);
>> +	if (!(hw_status & PHN_CTL_IRQ))
>> +		return IRQ_NONE;
>> +
>> +	iowrite32(0, dev->iaddr);
>> +	wmb();
>> +	iowrite32(0xc0, dev->iaddr);
> 
> there too.

Seems reasonable, it can't be reordered. (I hope this holds on all archs.)

>> +	if (unlikely(idev == NULL))
>> +		return IRQ_HANDLED;
> 
> Can this happen?  If so, a comment explaining why would be nice.

In the case of DEBUG_SHIRQ=y. Comment will be added or better -- devinit code
reordered.

thanks for notes,
-- 
http://www.fi.muni.cz/~xslaby/            Jiri Slaby
faculty of informatics, masaryk university, brno, cz
e-mail: jirislaby gmail com, gpg pubkey fingerprint:
B674 9967 0407 CE62 ACC8  22A0 32CC 55C3 39D4 7A7E

  parent reply	other threads:[~2007-04-20  9:01 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-04-17 20:01 [RFC 1/2] Input: ff, add FF_RAW effect Jiri Slaby
2007-04-17 20:01 ` Jiri Slaby
2007-04-17 20:02 ` [RFC 2/2] Input: phantom, add a new driver Jiri Slaby
2007-04-17 20:02   ` Jiri Slaby
2007-04-20  6:07   ` Andrew Morton
2007-04-20  6:07     ` Andrew Morton
2007-04-20  8:28     ` const struct pci_driver [Was: [RFC 2/2] Input: phantom, add a new driver] Jiri Slaby
2007-04-20 17:31       ` Greg KH
2007-04-20  9:01     ` Jiri Slaby [this message]
2007-04-18 20:00 ` [RFC 1/2] Input: ff, add FF_RAW effect johann deneux
2007-04-18 21:07   ` Jiri Slaby
2007-04-19  4:25     ` johann deneux
2007-04-19  4:58       ` Dmitry Torokhov
2007-04-19 15:38         ` Jiri Slaby
2007-04-19 16:02           ` Dmitry Torokhov
2007-04-22 12:57             ` Jiri Slaby
2007-04-26 16:02               ` Dmitry Torokhov
2007-04-26 23:24                 ` Jiri Slaby
2007-04-23 19:30             ` Jiri Slaby
2007-04-26 15:58               ` Dmitry Torokhov

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=46288155.7060701@gmail.com \
    --to=jirislaby@gmail.com \
    --cc=akpm@linux-foundation.org \
    --cc=dtor@insightbb.com \
    --cc=johann.deneux@gmail.com \
    --cc=linux-input@atrey.karlin.mff.cuni.cz \
    --cc=linux-kernel@vger.kernel.org \
    --cc=stenyak@gmail.com \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.