From: "Mats Randgaard (matrandg)" <matrandg@cisco.com>
To: Philipp Zabel <p.zabel@pengutronix.de>
Cc: Hans Verkuil <hansverk@cisco.com>,
linux-media@vger.kernel.org, kernel@pengutronix.de
Subject: Re: [RFC 10/12] [media] tc358743: detect chip by ChipID instead of IntMask
Date: Mon, 04 May 2015 16:09:59 +0200 [thread overview]
Message-ID: <55477DB7.4000704@cisco.com> (raw)
In-Reply-To: <1427713856-10240-11-git-send-email-p.zabel@pengutronix.de>
On 03/30/2015 01:10 PM, Philipp Zabel wrote:
> When resetting the CPU instead of power cycling, IntMask is still set
> from last boot. Instead of depending on it to be set to its reset
> defaults, check the ChipID register and rewrite IntMask if needed.
>
> Signed-off-by: Philipp Zabel<p.zabel@pengutronix.de>
> ---
> drivers/media/i2c/tc358743.c | 12 +++++++++---
> 1 file changed, 9 insertions(+), 3 deletions(-)
>
> diff --git a/drivers/media/i2c/tc358743.c b/drivers/media/i2c/tc358743.c
> index 2cf97d9..02b131b 100644
> --- a/drivers/media/i2c/tc358743.c
> +++ b/drivers/media/i2c/tc358743.c
> @@ -1847,13 +1847,19 @@ static int tc358743_probe(struct i2c_client *client,
> sd->flags |= V4L2_SUBDEV_FL_HAS_DEVNODE | V4L2_SUBDEV_FL_HAS_EVENTS;
>
> /* i2c access */
> + if (i2c_rd16(sd, CHIPID) != 0x0000) {
> + v4l2_info(sd, "not a TC358743 on address 0x%x\n",
> + client->addr << 1);
> + return -ENODEV;
> + }
Yes, it is better to read a read-only-register.
> /* read the interrupt mask register, it should carry the
> * default values, as it hasn't been touched at this point.
> */
> if (i2c_rd16(sd, INTMASK) != 0x0400) {
> - v4l2_info(sd, "not a TC358743 on address 0x%x\n",
> - client->addr << 1);
> - return -ENODEV;
> + v4l2_warn(sd, "initial interrupt mask: 0x%04x\n",
> + i2c_rd16(sd, INTMASK));
> + i2c_wr16(sd, INTMASK, 0x0400);
> + }
>
> tc358743_clear_interrupt_status(sd);
Are there other registers that are not reset? If so, I think the driver
should reset them all during initialization.
Regards,
Mats Randgaard
next prev parent reply other threads:[~2015-05-04 14:10 UTC|newest]
Thread overview: 20+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-03-30 11:10 [RFC 00/12] TC358743 async subdev and dt support Philipp Zabel
2015-03-30 11:10 ` [RFC 01/12] [media] Driver for Toshiba TC358743 CSI-2 to HDMI bridge Philipp Zabel
2015-03-30 11:10 ` [RFC 02/12] [media] tc358743: register v4l2 asynchronous subdevice Philipp Zabel
2015-05-04 14:09 ` Mats Randgaard (matrandg)
2015-03-30 11:10 ` [RFC 03/12] [media] tc358743: support probe from device tree Philipp Zabel
2015-05-04 14:09 ` Mats Randgaard (matrandg)
2015-03-30 11:10 ` [RFC 04/12] [media] tc358743: fix set_pll to enable PLL with default frequency Philipp Zabel
[not found] ` <55477DAE.5040408@cisco.com>
2015-05-04 14:13 ` Mats Randgaard (matrandg)
2015-03-30 11:10 ` [RFC 05/12] [media] tc358743: fix lane number calculation to include blanking Philipp Zabel
2015-05-04 14:09 ` Mats Randgaard (matrandg)
2015-03-30 11:10 ` [RFC 06/12] [media] tc358743: split set_csi into set_csi and start_csi Philipp Zabel
2015-03-30 11:10 ` [RFC 07/12] [media] tc358743: also set TCLK_TRAILCNT and TCLK_POSTCNT Philipp Zabel
2015-03-30 11:10 ` [RFC 08/12] [media] tc358743: parse MIPI CSI-2 endpoint, support noncontinuous clock Philipp Zabel
2015-03-30 11:10 ` [RFC 09/12] [media] tc358743: add direct interrupt handling Philipp Zabel
2015-03-30 11:10 ` [RFC 10/12] [media] tc358743: detect chip by ChipID instead of IntMask Philipp Zabel
2015-05-04 14:09 ` Mats Randgaard (matrandg) [this message]
2015-03-30 11:10 ` [RFC 11/12] [media] tc358743: don't return E2BIG from G_EDID Philipp Zabel
2015-03-30 11:10 ` [RFC 12/12] [media] tc358743: allow event subscription Philipp Zabel
2015-04-08 11:40 ` [RFC 00/12] TC358743 async subdev and dt support Mats Randgaard (matrandg)
[not found] ` <55477D9C.7050006@cisco.com>
2015-05-04 14:12 ` Mats Randgaard (matrandg)
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=55477DB7.4000704@cisco.com \
--to=matrandg@cisco.com \
--cc=hansverk@cisco.com \
--cc=kernel@pengutronix.de \
--cc=linux-media@vger.kernel.org \
--cc=p.zabel@pengutronix.de \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.