This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

Interrupt problem in adc driver

Hi,

i have interrupt problem in adc driver

my driver called interrupt :

request_irq(ADC_TSC_GENINT,adc_irq_handler,IRQF_SHARED,"adcsample",&my_dev_id);

ADC_TSC_GENINT =16

handler function :

my handler function is : static irqreturn_t  adc_irq_handler(int irq , void *dev_id)
{

    printk(KERN_ERR "Interupt called refer by srini\n");
      
       return IRQ_HANDLED;

}

when i check in cat /proc/interrupt

16:          0      INTC   0  adcsample  (my driver name)

this way is correct or not calling adc interrupt .

Thanks & Regards

Naven

  • Hi Naven,

    Please post what processor and Linux version you are using. Also please describe what your problem is in more details.

  • H sir,

    am using Beagle Bone Black AM335x ,SDK7 ,3.12 kernel
    iam writing my own driver for adc ,
    so when request_irq in my driver successful retrun and executing driver
    no call to handler function and when am check proc/interrupts
    its will like

    request_irq(ADC_TSC_GENINT,adc_irq_handler,IRQF_SHARED,"adcsample",&my_dev_id);

    16: 0 INTC 0 adcsample (my driver name)

    this way correct interrupt in adc driver if any other method
    plz repy me.


    Regards,
    Naven
  • Naven,

    The code you posted seems ok.


    One way to check if your ADC IRQ is ok (that is if you have touchscreen attached to your board), try the following:
    1. Enter device in suspend:
    echo mem > /sys/power/state
    2. Wake up the device by pressing on your TOUCHSCREEN.
    3. Check the what is the wakeup source on your debug console, i.e. when I do the above with uart, I get: "PM: Wakeup source UART" You should get similar message referencing the ADC, this should indicate that your ADC irq handler is working.

    Another thing to try is, through kernel code try dumping the values of IRQSTATUS_RAW register; the corresponding bit field in irq_status_raw should be asserted any time an interrupt event occurs.

    Also did you enabled your tscadc node in device tree?

    Best Regards,
    Yordan

  • Hi Yordan,

    when i check echo mem >/sys/power/state

    [ 61.328126] PM: Syncing filesystems ... done.
    [ 61.335299] Freezing user space processes ... (elapsed 0.001 seconds) done.
    [ 61.343836] Freezing remaining freezable tasks ... (elapsed 0.001 seconds) done.
    [ 61.352790] Suspending console(s) (use no_console_suspend to debug)
    [ 61.365866] PM: suspend of devices complete after 5.939 msecs
    [ 61.366343] PM: late suspend of devices complete after 0.464 msecs
    [ 61.366973] PM: noirq suspend of devices complete after 0.616 msecs
    [ 61.367034] PM: Successfully put all powerdomains to target state
    [ 61.367034] PM: Wakeup source UART
    [ 61.381178] PM: noirq resume of devices complete after 14.096 msecs
    [ 61.381594] PM: early resume of devices complete after 0.340 msecs
    [ 61.382087] net eth0: initializing cpsw version 1.12 (0)
    [ 61.384157] net eth0: phy found : id is : 0x7c0f1
    [ 61.446646] PM: resume of devices complete after 65.028 msecs
    [ 61.505944] Restarting tasks ... done.

    No visible my device name .

    am working my own driver and node will created in dev ,data read through dev system,
    so it is need to device tree ??
    am commented adc in device tree files .
    am not using sysfs only dev systems .

    Regards,
    Naven
  • Naven,

    "[ 61.367034] PM: Wakeup source UART"

    This means that you've entered a character through your debug uart <-> hance you've pressed a keyboard button. To wakeup via intarnal  TSC-ADC module you need to press the TOUCHSCREEN.

    However, regarding your question:

    p naveen kumar said:
    so it is need to device tree ??

    Since you use SDK7 with Kernel 3.12 on your BeagleBone Black, then YES, you need to enable your TSC-ADC module in the device tree. Also in the compatible field in your tsc device node you need to point your custom driver, not the default TI driver.

    Also, can you check the values of: IRQSTATUS_RAW, IRQSTATUS, IRQENABLE_SET, IRQENABLE_CLR & IRQWAKEUP registers, after your board boots up?  Maybe interrupts are not properly enabled.


    Best Regards,
    Yordan

  • am not using TI Driver , am writing own driver so my driver directly mapping through adc base addres
    so device tree need ??

    when am reading registers values the o/p :

    [ 1939.886256] IRQSTATU = 0x90
    [ 1939.889219] IRQSTATUS_RAW =0x90
    [ 1939.892509] IRQENABLE_SET = 0x3ff
    [ 1939.895984] IRQWAKEUP =0x0


    Regards,
    Naveen
  • am not using touchscreen in my project,
    reading all adc channels data and send input to pwm ,
    so just am reading proper values through all adc channels
    my task completed.
    am reading all channels data through sysfs i get some timing problem,
    so iam trying to writing my own driver read data through dev node

    Regards,
    Naven