From: Barry Song <hidden> Date: 2014-02-14 03:20:01
From: Xianglong Du <redacted>
this patch adds a delayed_work to detect the untouch of onkey since HW will
not generate interrupt for it.
at the same time, we move the KEY event to POWER instead of SUSPEND, which
will be suitable for both Android and Linux. Userspace PowerManager Daemon
will decide to suspend or shutdown based on how long we have touched onkey
Signed-off-by: Xianglong Du <redacted>
Signed-off-by: Rongjun Ying <redacted>
Signed-off-by: Barry Song <redacted>
---
-v3: move to use custom devres action
drivers/input/misc/sirfsoc-onkey.c | 60 +++++++++++++++++++++++++++++------
1 files changed, 49 insertions(+), 11 deletions(-)
Hi Barry,
On Fri, Feb 14, 2014 at 11:20:01AM +0800, Barry Song wrote:
From: Xianglong Du <redacted>
this patch adds a delayed_work to detect the untouch of onkey since HW will
not generate interrupt for it.
at the same time, we move the KEY event to POWER instead of SUSPEND, which
will be suitable for both Android and Linux. Userspace PowerManager Daemon
will decide to suspend or shutdown based on how long we have touched onkey
Signed-off-by: Xianglong Du <redacted>
Signed-off-by: Rongjun Ying <redacted>
Signed-off-by: Barry Song <redacted>
---
-v3: move to use custom devres action
Thank you for making the changes, however it seems that we can control
whether the device generates interrupts or not and so we can implement
open and close methods. If patch below works then your
cancel_delayed_work() call should go into sirfosc_pwrc_close() and we do
not need to use devm_free_irq() not custom action.
Thanks.
--
Dmitry
Input: sirfsoc-onkey - implement open and close methods
From: Dmitry Torokhov <dmitry.torokhov@gmail.com>
We can control whetehr device generates interrupts or not so let's
implement open and close methods of input device so that we do not do any
processing until there are users.
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
---
drivers/input/misc/sirfsoc-onkey.c | 50 +++++++++++++++++++++++++++++-------
1 file changed, 40 insertions(+), 10 deletions(-)
Hi Barry,
On Fri, Feb 14, 2014 at 11:20:01AM +0800, Barry Song wrote:
quoted
From: Xianglong Du <redacted>
this patch adds a delayed_work to detect the untouch of onkey since HW will
not generate interrupt for it.
at the same time, we move the KEY event to POWER instead of SUSPEND, which
will be suitable for both Android and Linux. Userspace PowerManager Daemon
will decide to suspend or shutdown based on how long we have touched onkey
Signed-off-by: Xianglong Du <redacted>
Signed-off-by: Rongjun Ying <redacted>
Signed-off-by: Barry Song <redacted>
---
-v3: move to use custom devres action
Thank you for making the changes, however it seems that we can control
whether the device generates interrupts or not and so we can implement
open and close methods. If patch below works then your
cancel_delayed_work() call should go into sirfosc_pwrc_close() and we do
not need to use devm_free_irq() not custom action.
this one looks making lots of senses. it makes sure HW will not
trigger any SW behaviour before probe() finishes, and also makes sure
HW will not trigger any SW behaviour in remove(). i'd like xianglong
to give a quick test on it.
quoted hunk
Thanks.
--
Dmitry
Input: sirfsoc-onkey - implement open and close methods
From: Dmitry Torokhov <dmitry.torokhov@gmail.com>
We can control whetehr device generates interrupts or not so let's
implement open and close methods of input device so that we do not do any
processing until there are users.
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
---
drivers/input/misc/sirfsoc-onkey.c | 50 +++++++++++++++++++++++++++++-------
1 file changed, 40 insertions(+), 10 deletions(-)
From: Xianglong Du <hidden> Date: 2014-02-14 10:32:08
Tested-by: Xianglong Du <redacted>
________________________________________
From: Barry Song [21cnbao@gmail.com]
Sent: Friday, February 14, 2014 16:49
To: Dmitry Torokhov
Cc: linux-input@vger.kernel.org; linux-arm-kernel@lists.infradead.org; DL-SHA-WorkGroupLinux; Xianglong Du; Rongjun Ying; Barry Song
Subject: Re: [PATCH v3] input: sirfsoc-onkey - report onkey untouch event by detecting pin status
2014-02-14 15:57 GMT+08:00 Dmitry Torokhov [off-list ref]:
Hi Barry,
On Fri, Feb 14, 2014 at 11:20:01AM +0800, Barry Song wrote:
quoted
From: Xianglong Du <redacted>
this patch adds a delayed_work to detect the untouch of onkey since HW will
not generate interrupt for it.
at the same time, we move the KEY event to POWER instead of SUSPEND, which
will be suitable for both Android and Linux. Userspace PowerManager Daemon
will decide to suspend or shutdown based on how long we have touched onkey
Signed-off-by: Xianglong Du <redacted>
Signed-off-by: Rongjun Ying <redacted>
Signed-off-by: Barry Song <redacted>
---
-v3: move to use custom devres action
Thank you for making the changes, however it seems that we can control
whether the device generates interrupts or not and so we can implement
open and close methods. If patch below works then your
cancel_delayed_work() call should go into sirfosc_pwrc_close() and we do
not need to use devm_free_irq() not custom action.
this one looks making lots of senses. it makes sure HW will not
trigger any SW behaviour before probe() finishes, and also makes sure
HW will not trigger any SW behaviour in remove(). i'd like xianglong
to give a quick test on it.
quoted hunk
Thanks.
--
Dmitry
Input: sirfsoc-onkey - implement open and close methods
From: Dmitry Torokhov <dmitry.torokhov@gmail.com>
We can control whetehr device generates interrupts or not so let's
implement open and close methods of input device so that we do not do any
processing until there are users.
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
---
drivers/input/misc/sirfsoc-onkey.c | 50 +++++++++++++++++++++++++++++-------
1 file changed, 40 insertions(+), 10 deletions(-)
@@ -70,7 +99,7 @@ static int sirfsoc_pwrc_probe(struct platform_device *pdev)}/*-*wecan'tuseof_iomapbecausepwrcisnotmappedinmemory,+*Wecan'tuseof_iomapbecausepwrcisnotmappedinmemory,*theso-calledbaseaddressisonlyoffsetinrtciobrg*/error=of_property_read_u32(np,"reg",&pwrcdrv->pwrc_base);
@@ -88,6 +117,11 @@ static int sirfsoc_pwrc_probe(struct platform_device *pdev)pwrcdrv->input->phys="pwrc/input0";pwrcdrv->input->evbit[0]=BIT_MASK(EV_PWR);+pwrcdrv->input->open=sirfsoc_pwrc_open;+pwrcdrv->input->close=sirfsoc_pwrc_close;++input_set_drvdata(pwrcdrv->input,pwrcdrv);+irq=platform_get_irq(pdev,0);error=devm_request_irq(&pdev->dev,irq,sirfsoc_pwrc_isr,IRQF_SHARED,
@@ -98,11 +132,6 @@ static int sirfsoc_pwrc_probe(struct platform_device *pdev)returnerror;}-sirfsoc_rtc_iobrg_writel(-sirfsoc_rtc_iobrg_readl(pwrcdrv->pwrc_base+PWRC_INT_MASK)|-PWRC_ON_KEY_BIT,-pwrcdrv->pwrc_base+PWRC_INT_MASK);-error=input_register_device(pwrcdrv->input);if(error){dev_err(&pdev->dev,
@@ -129,15 +158,16 @@ static int pwrc_resume(struct device *dev){structplatform_device*pdev=to_platform_device(dev);structsirfsoc_pwrc_drvdata*pwrcdrv=platform_get_drvdata(pdev);+structinput_dev*input=pwrcdrv->input;/**Donotmaskpwrcinterruptaswewantpwrcworkasawakeupsource*ifuserstouchX_ONKEY_B,seearch/arm/mach-prima2/pm.c*/-sirfsoc_rtc_iobrg_writel(-sirfsoc_rtc_iobrg_readl(-pwrcdrv->pwrc_base+PWRC_INT_MASK)|PWRC_ON_KEY_BIT,-pwrcdrv->pwrc_base+PWRC_INT_MASK);+mutex_lock(&input->mutex);+if(input->users)+sirfsoc_pwrc_toggle_interrupts(pwrcdrv,true);+mutex_unlock(&input->mutex);return0;}
-barry
To report this email as spam click https://www.mailcontrol.com/sr/MZbqvYs5QwJvpeaetUwhCQ== .
Member of the CSR plc group of companies. CSR plc registered in England and Wales, registered number 4187346, registered office Churchill House, Cambridge Business Park, Cowley Road, Cambridge, CB4 0WZ, United Kingdom
More information can be found at www.csr.com. Keep up to date with CSR on our technical blog, www.csr.com/blog, CSR people blog, www.csr.com/people, YouTube, www.youtube.com/user/CSRplc, Facebook, www.facebook.com/pages/CSR/191038434253534, or follow us on Twitter at www.twitter.com/CSR_plc.
New for 2014, you can now access the wide range of products powered by aptX at www.aptx.com.
From: Barry Song <hidden> Date: 2014-02-14 13:41:06
quoted
Input: sirfsoc-onkey - implement open and close methods
From: Dmitry Torokhov <dmitry.torokhov@gmail.com>
We can control whetehr device generates interrupts or not so let's
implement open and close methods of input device so that we do not do any
processing until there are users.
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
Tested-by: Xianglong Du <redacted>
Dmitry, will you push this one to your tree so that i can rebase others?
On Fri, Feb 14, 2014 at 09:41:06PM +0800, Barry Song wrote:
quoted
quoted
Input: sirfsoc-onkey - implement open and close methods
From: Dmitry Torokhov <dmitry.torokhov@gmail.com>
We can control whetehr device generates interrupts or not so let's
implement open and close methods of input device so that we do not do any
processing until there are users.
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
Tested-by: Xianglong Du <redacted>
Dmitry, will you push this one to your tree so that i can rebase others?
I rebased and pushed everything out, please take a look to make sure it
all looks good.
Thanks.
--
Dmitry
On Fri, Feb 14, 2014 at 09:41:06PM +0800, Barry Song wrote:
quoted
quoted
quoted
Input: sirfsoc-onkey - implement open and close methods
From: Dmitry Torokhov <dmitry.torokhov@gmail.com>
We can control whetehr device generates interrupts or not so let's
implement open and close methods of input device so that we do not do any
processing until there are users.
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
Tested-by: Xianglong Du <redacted>
Dmitry, will you push this one to your tree so that i can rebase others?
I rebased and pushed everything out, please take a look to make sure it
all looks good.