linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: <sean.wang@mediatek.com>
To: <mchehab@osg.samsung.com>, <sean@mess.org>, <hdegoede@redhat.com>,
	<hkallweit1@gmail.com>, <robh+dt@kernel.org>,
	<mark.rutland@arm.com>, <matthias.bgg@gmail.com>
Cc: <andi.shyti@samsung.com>, <hverkuil@xs4all.nl>,
	<ivo.g.dimitrov.75@gmail.com>, <linux-media@vger.kernel.org>,
	<devicetree@vger.kernel.org>,
	<linux-mediatek@lists.infradead.org>,
	<linux-arm-kernel@lists.infradead.org>,
	<linux-kernel@vger.kernel.org>,
	Sean Wang <sean.wang@mediatek.com>
Subject: [PATCH v1 3/4] media: rc: mtk-cir: add support for MediaTek MT7622 SoC
Date: Fri, 30 Jun 2017 14:03:06 +0800	[thread overview]
Message-ID: <37ff7a2deabfddfd899613caf13209754e9ac68a.1498794408.git.sean.wang@mediatek.com> (raw)
In-Reply-To: <cover.1498794408.git.sean.wang@mediatek.com>

From: Sean Wang <sean.wang@mediatek.com>

This patch adds driver for CIR controller on MT7622 SoC. It has similar
handling logic as the previously MT7623 does, but there are some
differences in the register and field definition. So for ease portability
and maintenance, those differences all are being kept inside the platform
data as other drivers usually do. Currently testing successfully on NEC
and SONY remote controller.

Signed-off-by: Sean Wang <sean.wang@mediatek.com>
---
 drivers/media/rc/mtk-cir.c | 21 +++++++++++++++++++++
 1 file changed, 21 insertions(+)

diff --git a/drivers/media/rc/mtk-cir.c b/drivers/media/rc/mtk-cir.c
index 32b1031..6672772 100644
--- a/drivers/media/rc/mtk-cir.c
+++ b/drivers/media/rc/mtk-cir.c
@@ -84,6 +84,13 @@ static const u32 mt7623_regs[] = {
 	[MTK_IRINT_CLR_REG] =	0xd0,
 };
 
+static const u32 mt7622_regs[] = {
+	[MTK_IRCLR_REG] =	0x18,
+	[MTK_CHKDATA_REG] =	0x30,
+	[MTK_IRINT_EN_REG] =	0x1c,
+	[MTK_IRINT_CLR_REG] =	0x20,
+};
+
 struct mtk_field_type {
 	u32 reg;
 	u8 offset;
@@ -113,6 +120,11 @@ static const struct mtk_field_type mt7623_fields[] = {
 	[MTK_HW_PERIOD] = {0x10, 0, GENMASK(7, 0)},
 };
 
+static const struct mtk_field_type mt7622_fields[] = {
+	[MTK_CHK_PERIOD] = {0x24, 0, GENMASK(24, 0)},
+	[MTK_HW_PERIOD] = {0x10, 0, GENMASK(24, 0)},
+};
+
 /*
  * struct mtk_ir -	This is the main datasructure for holding the state
  *			of the driver
@@ -268,8 +280,17 @@ static const struct mtk_ir_data mt7623_data = {
 	.div	= 4,
 };
 
+static const struct mtk_ir_data mt7622_data = {
+	.regs = mt7622_regs,
+	.fields = mt7622_fields,
+	.ok_count = 0xf,
+	.hw_period = 0xffff,
+	.div	= 32,
+};
+
 static const struct of_device_id mtk_ir_match[] = {
 	{ .compatible = "mediatek,mt7623-cir", .data = &mt7623_data},
+	{ .compatible = "mediatek,mt7622-cir", .data = &mt7622_data},
 	{},
 };
 MODULE_DEVICE_TABLE(of, mtk_ir_match);
-- 
2.7.4

  parent reply	other threads:[~2017-06-30  6:03 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <CGME20170630060312epcas4p351a77795e8469640d5177039f6b1955d@epcas4p3.samsung.com>
2017-06-30  6:03 ` [PATCH v1 0/4] media: rc: add support for IR receiver on MT7622 SoC sean.wang
2017-06-30  6:03   ` [PATCH v1 1/4] dt-bindings: media: mtk-cir: Add support for " sean.wang
2017-07-06 18:56     ` Rob Herring
2017-06-30  6:03   ` [PATCH v1 2/4] media: rc: mtk-cir: add platform data to adapt into various hardware sean.wang
2017-06-30  6:03   ` sean.wang [this message]
2017-06-30  6:03   ` [PATCH v1 4/4] MAINTAINERS: add entry for MediaTek CIR driver sean.wang
2017-07-04 10:10   ` [PATCH v1 0/4] media: rc: add support for IR receiver on MT7622 SoC Andi Shyti
2017-08-02  2:24     ` Sean Wang
2017-08-02 10:02       ` Sean Young

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=37ff7a2deabfddfd899613caf13209754e9ac68a.1498794408.git.sean.wang@mediatek.com \
    --to=sean.wang@mediatek.com \
    --cc=andi.shyti@samsung.com \
    --cc=devicetree@vger.kernel.org \
    --cc=hdegoede@redhat.com \
    --cc=hkallweit1@gmail.com \
    --cc=hverkuil@xs4all.nl \
    --cc=ivo.g.dimitrov.75@gmail.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-media@vger.kernel.org \
    --cc=linux-mediatek@lists.infradead.org \
    --cc=mark.rutland@arm.com \
    --cc=matthias.bgg@gmail.com \
    --cc=mchehab@osg.samsung.com \
    --cc=robh+dt@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).