On Thu, 2015-05-28 at 23:33 -0700, Lawrence Yu wrote:
> It looks like send email confirmation for the wiki is working again
> and I was able to finish user registration for the wiki.
>
> I created a new device for Yones TopTech BS1078 v2 in the wiki as
> requested.
>
> Back to on topic for this thread, I think I figured out how to work
> the external interrupts on the sun6i and this may come in useful for
> other people writing or porting device drivers. The code is copied
> from the mmc driver's handling of the cd pin.
>
> To define an external interrupt in the dts I used this
>
> gsl3675: touchscreen@40 {
> compatible = "silead,gsl3675";
> reg = <0x40>;
> interrupt-parent = <&pio>;
> interrupts = <23 IRQ_TYPE_EDGE_FALLING >;
> ts-gpios = <&pio 0 23 GPIO_ACTIVE_HIGH>; /* PA23 */
> };
>
> and in the driver module probe, to connect an irq handler, I used
> this snippet of code
>
> // Setup the IRQ
> desc = devm_gpiod_get_index(dev, "ts", 0, GPIOD_IN);
> irq = gpiod_to_irq(desc);
> ret = devm_request_threaded_irq(dev, irq, NULL, gsl3675_irq,
> IRQF_TRIGGER_RISING | IRQF_TRIGGER_FALLING | IRQF_ONESHOT, client
> ->name, data);
>
> It works on an A31 Hummingbird board and fires my irq handler when I
> bring the gpio a23 pin to 3V , but it doesn't work on my tablet. I
> suspect I have burned out the a23 gpio pin on the A31s of the tablet
> while probing since the touchscreen no longer works in Android either
> but I can see interrupt pulses on the line with a logic analyzer.
> I'll give writing the driver another shot when I get another tablet
> with a gsl3675 touchscreen on it.
Just an idea for workaround:
In case you're able to find unused GPIO pin on the board, you could try
routing the touchscreen pin there via small
wire.
>
>
>
>
>
>
> On Tue, May 26, 2015 at 10:49 PM, Gustavo Zamboni <
> [email protected]> wrote:
> > When did you get this message ?
> > We finished configuring the new mail server yesterday.
> > I supose the wiki user credential is ok ( the same we used in the
> > other mail server ).
> > Maybe its a dns replication delay.
> > Can you retest later today ?
> >
> > Thanks,
> >
> > Gustavo Zamboni
> >
> >
> > Le 27/05/2015 07:35, Lawrence Yu a écrit :
> > > Hi,
> > >
> > > On Tue, May 26, 2015 at 10:17 PM, Priit Laes <[email protected]>
> > > wrote:
> > > > On Wednesday, May 27, 2015 at 5:53:06 AM UTC+3, Lawrence Y
> > > > wrote:
> > > > > Hi,
> > > > >
> > > > Hi!
> > > >
> > > > >
> > > > > I was wondering if there was an example of a dts that used
> > > > > external interrupts with the sun6i or sun8i chips? I've been
> > > > > trying to configure an external interrupt on PA23 with no
> > > > > luck so far. I looked through all of the sun6i and sun8i dts
> > > > > files for an example but did not find anything that appeared
> > > > > to be using an external interrupt.
> > > > >
> > > > > I did find this documentation on external interrupts on the
> > > > > wiki
> > > > >
> > > > >
> > > > > http://linux-sunxi.org/External_interrupts
> > > > >
> > > > It is nice that you found our wiki somewhat helpful, but please
> > > > see below.
> > > >
> > > >
> > > > > but it appears to be for sun7i which does not use a banked
> > > > > interrupt architecture.
> > > > >
> > > > > I also found this patch set which contains functionality for
> > > > > external interrupts on the sun6i A31, but I think I am
> > > > > misunderstanding how to setup the interrupt in the dts.
> > > > >
> > > > > http://lists.infradead.org/pipermail/linux-arm-kernel/2014
> > > > > -May/260377.html
> > > > >
> > > > > For background, I am trying to get a gsl3675 touchscreen to
> > > > > generate an IRQ inside the sun6i A31s when the interrupt line
> > > > > toggles. I can confirm that some signal line toggles when
> > > > > touches are present with a logic analyzer, but it's unclear
> > > > > if it is PA3 or PA23 and I have been trying both. The fex
> > > > > file says PA3 but the A31 schematics say PA23.
> > > > >
> > > > Now, please start with the New Device Howto page found here:
> > > >
> > > > http://linux-sunxi.org/New_Device_howto
> > > >
> > > > And work through it, because there currently isn't a single
> > > > device documented in the wiki with gsl3675 touchscreen
> > > > controller.
> > > >
> > > >
> > > > > A snippet of the relevant portions of my dts are below, if it
> > > > > helps. (my dts could be totally wrong)
> > > > >
> > > > > &i2c1 {
> > > > > pinctrl-names = "default";
> > > > > pinctrl-0 = <&i2c1_pins_a>;
> > > > > status = "okay";
> > > > >
> > > > > gsl3675: touchscreen@40 {
> > > > > compatible = "silead,gsl3675";
> > > > > reg = <0x40>;
> > > > > interrupt-parent = <&pio>;
> > > > > interrupts = <GIC_SPI 11 IRQ_TYPE_LEVEL_HIGH>;
> > > > > pinctrl-names = "default";
> > > > > pinctrl-0 = <&ts_irq_pin>;
> > > > > };
> > > > > };
> > > > >
> > > > > &pio {
> > > > > ts_irq_pin: tspin@0 {
> > > > > allwinner,pins = "PA23";
> > > > > allwinner,function = "irq";
> > > > > allwinner,drive = <0>;
> > > > > allwinner,pull = <1>;
> > > > > };
> > > > > };
> > > > >
> > > > > When I load my test module I get the following error which
> > > > > may or may not be relevant. (I don't see where the irq 55 is
> > > > > coming from)
> > > > >
> > > > > [ 10.826782] genirq: Setting trigger mode 11 for irq 55
> > > > > failed (sunxi_pinctrl_irq_set_type+0x0/0x144)
> > > > >
> > > > > If anyone has any suggestions on things I could try to set
> > > > > things up properly so that the the IRQ will fire, I would
> > > > > appreciate them.
> > > > >
> > > > > Thanks!
> > > > >
> > > > > Lawrence
> > > > >
> > > > >
> > > > >
> > > > >
> > > > >
> > > > >
> > > > >
> > > > --
> > > > You received this message because you are subscribed to the
> > > > Google Groups "linux-sunxi" group.
> > > > To unsubscribe from this group and stop receiving emails from
> > > > it, send an email to
> > > > [email protected].
> > > > For more options, visit https://groups.google.com/d/optout.
> > > >
> > > I may be doing something wrong registering for the wiki or there
> > > might be a problem with the wiki sending out confirmation emails.
> > > I get the following error when trying to register in order to
> > > edit the wiki to add a new device page. I double checked and my
> > > email address appears correct.
> > >
> > > linux-sunxi.org could not send your confirmation mail. Please
> > > check your email address for invalid characters.
> > > Mailer returned: Unknown error in PHP's mail() function.
> > >
> > > Lawrence
> > > --
> > > You received this message because you are subscribed to the
> > > Google Groups "linux-sunxi" group.
> > > To unsubscribe from this group and stop receiving emails from it,
> > > send an email to
> > > [email protected].
> > > For more options, visit https://groups.google.com/d/optout.
> >
--
You received this message because you are subscribed to the Google Groups
"linux-sunxi" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
For more options, visit https://groups.google.com/d/optout.