Re: [PATCH 0/2] GPIO joystick driver

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Wed, Feb 11, 2015 at 08:49:16AM +0000, Holmberg, Hans wrote:
> > > > As far as I can tell, there is no way to specify values for ABS-"keys"
> > > > in the device tree binding.
> > >
> > > It may not be present in device tree binding, but the driver does
> > > support it, so I would rather extend the binding than have a brand new
> > driver.
> > 
> > All right, I find it a bit like whacking a round peg down a square hole, but I'll
> > head down that path and see where it leads.
> > 
> 
> This is what I've found:
> 
> A digital joystick driver needs to report three states per axis: min,
> max and neutral. The hardware only have two signals per axis(i.e. up
> and down) however. See http://wiki.icomp.de/wiki/DB9-Joystick 
> 
> This makes gpio-keys pretty much impossible to use for joysticks - as
> the driver only reports abs-events when a button/key is pressed, how
> would the neutral state be reported?  (as there is no signal for
> "neutral")
> 
> Even if through some hackery the driver would be modified to report a
> special neutral event if all  "buttons/keys" for that axis are not
> pressed, what value should be reported?  An average of the values for
> that axis?   Also, reporting such an implicit neutral event would
> break the behavior of existing abs-reporting instances, right?

You have 2 gpio per axis, and since you can't measure how "far" down the
axis you have moved the driver should only report values -1, 0, 1 per
axis. You start at neutral position, and move right. IRQ for right gpio
is fired and you report EV_ABS/ABS_X/1. Then you start moving to the
left, gpio IRQ fires (you want it to trigger on both edges) and you
report EV_ABS/ABS_X/0. You continue moving to the left and IRQ for left
gpio fires up and you report EV_ABS/ABS_X/-1.

This assumes that you assign EV_ABS/ABS_X and value 1 for right gpio and
EV_ABS/ABS_X and value -1 for left gpio.

Thanks.

-- 
Dmitry
--
To unsubscribe from this list: send the line "unsubscribe linux-input" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html




[Index of Archives]     [Linux Media Devel]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [Linux Wireless Networking]     [Linux Omap]

  Powered by Linux