All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jonathan Cameron <jic23@kernel.org>
To: "Ksenija Stanojević" <ksenija.stanojevic@gmail.com>
Cc: linux-kernel@vger.kernel.org, "Lee Jones" <lee.jones@linaro.org>,
	"Dmitry Torokhov" <dmitry.torokhov@gmail.com>,
	linux-input@vger.kernel.org, "Hartmut Knaack" <knaack.h@gmx.de>,
	"Lars-Peter Clausen" <lars@metafoo.de>,
	"Peter Meerwald-Stadler" <pmeerw@pmeerw.net>,
	"Marek Vašut" <marex@denx.de>,
	linux-iio@vger.kernel.org, "Harald Geyer" <harald@ccbib.org>
Subject: Re: [PATCH 3/3] input: touchscreen: mxs-lradc: Add support for touchscreen
Date: Sun, 29 May 2016 20:53:01 +0100	[thread overview]
Message-ID: <509a10d9-fe46-b159-86be-12de0ccf5a5a@kernel.org> (raw)
In-Reply-To: <CAL7P5jJYptf4OQE+d1AFLy92uajDTUD-B5Qsk-noBx36k3rGsg@mail.gmail.com>

<snip>
>>>>> +     if (of_property_read_u32(node, "fsl,settling", &adapt)) {
>>>>> +             ts->settling_delay = 10;
>>>>> +     } else {
>>>>> +             if (adapt < 1 || adapt > LRADC_DELAY_DELAY_MASK) {
>>>>> +                     dev_err(ts->dev, "Invalid settling delay (%u)\n",
>>>>> +                             adapt);
>>>>> +                     touch_ret = -EINVAL;
>>>>> +             } else {
>>>>> +                     ts->settling_delay = adapt;
>>>>> +             }
>>>>> +     }
>>>>> +
>>>>> +     mxs_lradc_ts_hw_init(ts);
>>>>> +     for (i = 0; i < lradc->irq_count; i++) {
>>>>> +             ret = devm_request_irq(dev, lradc->irq[i],
>>>>> +                                    mxs_lradc_ts_handle_irq,
>>>>> +                                    IRQF_SHARED, lradc->irq_name[i], ts);
>>>> As with the adc driver, are we actually using all of these?  I'd prefer we
>>>> only grab the ones that are actually relevant.
>>>
>>> Only irq lines relevant for touchscreen are:
>>> mxs-lradc-touchscreen, mxs-lradc-channel6 and mxs-lradc-channel7
>>> But not all interrupts are beiing used even when I enabled all remaining
>>> channels (not used by touchscreen) for bufferd capture via
>>> echo 1 >/sys/bus/iio/devices/iio\:device0/scan_elements/in_voltagexx_en
>>>
>>> So I don't know if it's supposed to work like this...
>>> (It works the same on the original code)
>> Certainly should only grab the relevant ones to touch screen use in here..
>> Original code probably being overly enthusiastic and we never noticed ;)
> 
> Sorry for being unclear...
> The point I was trying to make was that even though touchscreen and
> adc don't share irq lines, irqs mxs-lradc-channel(2,3,4,5,6) are never
> being used.
> So touchscreen is only use 2 out of 3 irqs assigned to it:
> mxs-lradc-touchscreen and mxs-lradc-channel7  . And adc
> is only using 2 irq lines mxs-lradc-channel(0,1) during buffered
> capture, even when all virtal channels are enabled.
> I found that odd...
odd indeed. It's odd hardware ;)

>From what I recall this hardware is capable of scheduling things in really
complex ways, but the driver elects not to use that, basically because it became
unmanageably complex and KISS was applied....

If there is an application needing that complexity we can revisit.

Of course there may be a better explanation ;)

Jonathan
> 
>>> root@cfa100xx:~# cat /proc/interrupts
>>>            CPU0
>>>  16:      13108         -  48 Edge      MXS Timer Tick
>>>  17:       4240         -  82 Edge      mxs-dma
>>>  25:          6         -  96 Edge      80010000.ssp
>>> 196:          0         -  68 Edge      mxs-dma
>>> 210:         13         -  10 Edge      mxs-lradc-touchscreen
>>> 211:          0         -  14 Edge      mxs-lradc-thresh0
>>> 212:          0         -  15 Edge      mxs-lradc-thresh1
>>> 213:         10         -  16 Edge      mxs-lradc-channel0
>>> 214:         10         -  17 Edge      mxs-lradc-channel1
>>> 215:          0         -  18 Edge      mxs-lradc-channel2
>>> 216:          0         -  19 Edge      mxs-lradc-channel3
>>> 217:          0         -  20 Edge      mxs-lradc-channel4
>>> 218:          0         -  21 Edge      mxs-lradc-channel5
>>> 219:          0         -  22 Edge      mxs-lradc-channel6
>>> 220:        412         -  23 Edge      mxs-lradc-channel7
>>> 221:          0         -  24 Edge      mxs-lradc-button0
>>> 222:          0         -  25 Edge      mxs-lradc-button1
>>> 223:          0         -  29 Edge      RTC alarm
>>> 224:          0         - 111 Edge      80058000.i2c
>>> 228:        174         -  47 Edge      uart-pl011
>>> 229:        439         -  93 Edge      80080000.usb
>>> 230:          0         -  92 Edge      80090000.usb
>>> 231:       3610         - 101 Edge      800f0000.ethernet
>>> 232:         10  80050000.lradc-dev0 Edge
>>> Err:          0
>>>
>>>>> +             if (ret)
>>>>> +                     return ret;
>>>>> +     }
>>>>> +
>>>>> +     if (!touch_ret) {
>>>>> +             ret = mxs_lradc_ts_register(ts);
>>>>> +             if (!ret)
>>>>> +                     goto err_ts_register;
>>>>> +     }
>>>>> +
>>>>> +     return 0;
>>>>> +
>>>>> +err_ts_register:
>>>>> +     mxs_lradc_ts_hw_stop(ts);
>>>>> +     return ret;
>>>>> +}
>>>>> +
>>>>> +static int mxs_lradc_ts_remove(struct platform_device *pdev)
>>>>> +{
>>>>> +     struct mxs_lradc_ts *ts = platform_get_drvdata(pdev);
>>>>> +
>>>>> +     mxs_lradc_ts_hw_stop(ts);
>>>>> +
>>>>> +     return 0;
>>>>> +}
>>>>> +
>>>>> +static struct platform_driver mxs_lradc_ts_driver = {
>>>>> +     .driver = {
>>>>> +             .name = DRIVER_NAME_TS,
>>>>> +     },
>>>>> +     .probe  = mxs_lradc_ts_probe,
>>>>> +     .remove = mxs_lradc_ts_remove,
>>>>> +};
>>>>> +module_platform_driver(mxs_lradc_ts_driver);
>>>>> +
>>>>> +MODULE_LICENSE("GPL v2");
>>>>>
>>>>
>>> --
>>> To unsubscribe from this list: send the line "unsubscribe linux-iio" in
>>> the body of a message to majordomo@vger.kernel.org
>>> More majordomo info at  http://vger.kernel.org/majordomo-info.html
>>>
>>
> 

      reply	other threads:[~2016-05-29 19:53 UTC|newest]

Thread overview: 40+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-04-29 11:46 [PATCH 0/3] mxs-lradc: Split driver into MFD Ksenija Stanojevic
2016-04-29 11:46 ` Ksenija Stanojevic
2016-04-29 11:47 ` [PATCH 1/3] mfd: mxs-lradc: Add support for mxs-lradc MFD Ksenija Stanojevic
2016-04-29 11:47   ` Ksenija Stanojevic
2016-04-29 13:15   ` Marek Vasut
2016-04-29 13:15     ` Marek Vasut
2016-04-29 13:43     ` Ksenija Stanojević
2016-04-29 14:12       ` Marek Vasut
2016-04-29 14:12         ` Marek Vasut
2016-04-29 17:19   ` Harald Geyer
2016-04-29 17:19     ` Harald Geyer
2016-05-01 13:06   ` Jonathan Cameron
2016-04-29 11:48 ` [PATCH 2/3] iio: adc: mxs-lradc: Add support for adc driver Ksenija Stanojevic
2016-04-29 13:21   ` Marek Vasut
2016-05-01 16:38   ` Jonathan Cameron
2016-05-01 16:38     ` Jonathan Cameron
2016-05-28 17:49     ` Ksenija Stanojević
2016-05-28 17:49       ` Ksenija Stanojević
2016-05-29 16:46       ` Jonathan Cameron
2016-05-29 16:46         ` Jonathan Cameron
2016-04-29 11:49 ` [PATCH 3/3] input: touchscreen: mxs-lradc: Add support for touchscreen Ksenija Stanojevic
2016-04-29 13:22   ` Marek Vasut
2016-04-29 23:36   ` Dmitry Torokhov
2016-04-29 23:36     ` Dmitry Torokhov
2016-04-29 23:57     ` Marek Vasut
2016-04-29 23:57       ` Marek Vasut
2016-05-02 16:58       ` Dmitry Torokhov
2016-05-02 16:58         ` Dmitry Torokhov
2016-05-28 17:46     ` Ksenija Stanojević
2016-05-28 17:46       ` Ksenija Stanojević
2016-06-01 18:29       ` Dmitry Torokhov
2016-06-01 18:29         ` Dmitry Torokhov
2016-05-01 16:47   ` Jonathan Cameron
2016-05-28 17:45     ` Ksenija Stanojević
2016-05-28 17:45       ` Ksenija Stanojević
2016-05-29 16:49       ` Jonathan Cameron
2016-05-29 18:00         ` Ksenija Stanojević
2016-05-29 18:00           ` Ksenija Stanojević
2016-05-29 18:00           ` Ksenija Stanojević
2016-05-29 19:53           ` Jonathan Cameron [this message]

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=509a10d9-fe46-b159-86be-12de0ccf5a5a@kernel.org \
    --to=jic23@kernel.org \
    --cc=dmitry.torokhov@gmail.com \
    --cc=harald@ccbib.org \
    --cc=knaack.h@gmx.de \
    --cc=ksenija.stanojevic@gmail.com \
    --cc=lars@metafoo.de \
    --cc=lee.jones@linaro.org \
    --cc=linux-iio@vger.kernel.org \
    --cc=linux-input@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=marex@denx.de \
    --cc=pmeerw@pmeerw.net \
    /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.