linux-media.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "Michał Winiarski" <michal.winiarski@intel.com>
To: <linux-media@vger.kernel.org>
Cc: "Michał Winiarski" <michal.winiarski@intel.com>,
	"Jarod Wilson" <jarod@redhat.com>, "Sean Young" <sean@mess.org>
Subject: [PATCH 3/3] media: rc: nuvoton: Keep device enabled during reg init
Date: Mon, 21 May 2018 16:38:03 +0200	[thread overview]
Message-ID: <20180521143803.25664-3-michal.winiarski@intel.com> (raw)
In-Reply-To: <20180521143803.25664-1-michal.winiarski@intel.com>

Doing writes when the device is disabled seems to be a NOOP.
Let's enable the device, write the values, and then disable it on init.
This changes the behavior for wake device, which is now being disabled
after init.

Signed-off-by: Michał Winiarski <michal.winiarski@intel.com>
Cc: Jarod Wilson <jarod@redhat.com>
Cc: Sean Young <sean@mess.org>
---
 drivers/media/rc/nuvoton-cir.c | 9 +++++++--
 1 file changed, 7 insertions(+), 2 deletions(-)

diff --git a/drivers/media/rc/nuvoton-cir.c b/drivers/media/rc/nuvoton-cir.c
index eebd6fef5602..61b68cde35f1 100644
--- a/drivers/media/rc/nuvoton-cir.c
+++ b/drivers/media/rc/nuvoton-cir.c
@@ -535,6 +535,8 @@ static void nvt_set_cir_iren(struct nvt_dev *nvt)
 
 static void nvt_cir_regs_init(struct nvt_dev *nvt)
 {
+	nvt_enable_logical_dev(nvt, LOGICAL_DEV_CIR);
+
 	/* set sample limit count (PE interrupt raised when reached) */
 	nvt_cir_reg_write(nvt, CIR_RX_LIMIT_COUNT >> 8, CIR_SLCH);
 	nvt_cir_reg_write(nvt, CIR_RX_LIMIT_COUNT & 0xff, CIR_SLCL);
@@ -546,10 +548,14 @@ static void nvt_cir_regs_init(struct nvt_dev *nvt)
 	/* clear hardware rx and tx fifos */
 	nvt_clear_cir_fifo(nvt);
 	nvt_clear_tx_fifo(nvt);
+
+	nvt_disable_logical_dev(nvt, LOGICAL_DEV_CIR);
 }
 
 static void nvt_cir_wake_regs_init(struct nvt_dev *nvt)
 {
+	nvt_enable_logical_dev(nvt, LOGICAL_DEV_CIR_WAKE);
+
 	/*
 	 * Disable RX, set specific carrier on = low, off = high,
 	 * and sample period (currently 50us)
@@ -562,8 +568,7 @@ static void nvt_cir_wake_regs_init(struct nvt_dev *nvt)
 	/* clear any and all stray interrupts */
 	nvt_cir_wake_reg_write(nvt, 0xff, CIR_WAKE_IRSTS);
 
-	/* enable the CIR WAKE logical device */
-	nvt_enable_logical_dev(nvt, LOGICAL_DEV_CIR_WAKE);
+	nvt_disable_logical_dev(nvt, LOGICAL_DEV_CIR);
 }
 
 static void nvt_enable_wake(struct nvt_dev *nvt)
-- 
2.17.0

  parent reply	other threads:[~2018-05-21 14:38 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-05-21 14:38 [PATCH 1/3] media: rc: nuvoton: Tweak the interrupt enabling dance Michał Winiarski
2018-05-21 14:38 ` [PATCH 2/3] media: rc: nuvoton: Keep track of users on CIR enable/disable Michał Winiarski
2018-05-21 14:38 ` Michał Winiarski [this message]
2018-05-24 11:31   ` [PATCH 3/3] media: rc: nuvoton: Keep device enabled during reg init Sean Young
2018-05-25 13:35     ` Michał Winiarski
2018-05-25 13:59       ` Sean Young
2018-05-25 14:42         ` Michał Winiarski
2018-05-25 17:51           ` Sean Young
2018-05-25 14:28   ` [PATCH v2 " Michał Winiarski
2018-05-21 15:54 ` [PATCH 1/3] media: rc: nuvoton: Tweak the interrupt enabling dance Sean Young
2018-05-21 16:22   ` Michał Winiarski

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=20180521143803.25664-3-michal.winiarski@intel.com \
    --to=michal.winiarski@intel.com \
    --cc=jarod@redhat.com \
    --cc=linux-media@vger.kernel.org \
    --cc=sean@mess.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).