From: c.a.subramaniam@gmail.com (Subramaniam Appadodharana)
To: kernelnewbies@lists.kernelnewbies.org
Subject: Run a program when DP monitor is plugged in/out
Date: Fri, 11 Apr 2014 11:29:54 -0500 [thread overview]
Message-ID: <CAJydem=39hvPXg-7-io9hkLyQbMHj9SSjB0n4wSGZuCtU+XJ2g@mail.gmail.com> (raw)
In-Reply-To: <CAMf-jSnhehmUKNO71W+_AQoqW0Yu19NufCNh7VZD2yhqbP+QmQ@mail.gmail.com>
Hi Arun,
Yes I think you can use uevent. Since it is a DP monitor, and it has an
associated driver, it should have an associated sysfs entry? You can send a
uevent to the dev node within the sysfs. I havent used this myself except
for request_firmware().
https://www.kernel.org/doc/pending/hotplug.txt
On Fri, Apr 11, 2014 at 10:46 AM, pramod gurav
<pramod.gurav.etc@gmail.com>wrote:
> Hi Arun,
>
> If it is just an event you want to send across to user space how about
> kernel input sub system. Your userspace can poll on the input device node.
> Once the event is received from kernel it can launch a script or do what
> you say you want to do.
>
>
> On Fri, Apr 11, 2014 at 6:49 PM, arun c <arun.edarath@gmail.com> wrote:
>
>> Hi,
>>
>> I want to run a program when DP monitor is plugged in/out.
>> My linux kernel ( 3.14.0-00348-gbfcbf45) gets an interrupt when DP cable
>> is removed or inserted.
>> From the graphics driver interrupt handler I can differentiate the two
>> events.
>>
>> I want to run a user space program when this removal/insertion happens.
>> What are the possible
>> ways to achieve this?
>>
>> when I google for this I am seeing examples related to udev(How to run a
>> script when a usb device is inserted/removed); but in my case it is not
>> device insertion/removal. There is no need for a device creation when the
>> DP monitor is plugged in/out(There is no device node available for me).
>> Basically I want to send this removal/insertion event from my kernel
>> interrupt handler to
>> user space program.
>>
>> Regards,
>> Arun C
>>
>> _______________________________________________
>> Kernelnewbies mailing list
>> Kernelnewbies at kernelnewbies.org
>> http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies
>>
>>
>
>
> --
> Thanks and Regards
> Pramod
>
> _______________________________________________
> Kernelnewbies mailing list
> Kernelnewbies at kernelnewbies.org
> http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.kernelnewbies.org/pipermail/kernelnewbies/attachments/20140411/9cbaa8c5/attachment.html
prev parent reply other threads:[~2014-04-11 16:29 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-04-11 13:19 Run a program when DP monitor is plugged in/out arun c
2014-04-11 15:46 ` pramod gurav
2014-04-11 16:29 ` Subramaniam Appadodharana [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='CAJydem=39hvPXg-7-io9hkLyQbMHj9SSjB0n4wSGZuCtU+XJ2g@mail.gmail.com' \
--to=c.a.subramaniam@gmail.com \
--cc=kernelnewbies@lists.kernelnewbies.org \
/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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).