From patchwork Sun Jun 23 14:01:35 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Lars-Peter Clausen X-Patchwork-Id: 2768191 Return-Path: X-Original-To: patchwork-linux-media@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork1.web.kernel.org (Postfix) with ESMTP id B8A929F472 for ; Sun, 23 Jun 2013 14:01:29 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 8D77B2017A for ; Sun, 23 Jun 2013 14:01:28 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 8FEE820177 for ; Sun, 23 Jun 2013 14:01:27 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751239Ab3FWOBZ (ORCPT ); Sun, 23 Jun 2013 10:01:25 -0400 Received: from smtp-out-217.synserver.de ([212.40.185.217]:1058 "EHLO smtp-out-216.synserver.de" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1751109Ab3FWOBY (ORCPT ); Sun, 23 Jun 2013 10:01:24 -0400 Received: (qmail 12787 invoked by uid 0); 23 Jun 2013 14:01:23 -0000 X-SynServer-TrustedSrc: 1 X-SynServer-AuthUser: lars@metafoo.de X-SynServer-PPID: 12615 Received: from ppp-93-104-163-252.dynamic.mnet-online.de (HELO lars-adi-laptop.fritz.box) [93.104.163.252] by 217.119.54.96 with SMTP; 23 Jun 2013 14:01:23 -0000 From: Lars-Peter Clausen To: Mauro Carvalho Chehab Cc: Prabhakar Lad , Manjunath Hadli , linux-media@vger.kernel.org, Lars-Peter Clausen Subject: [PATCH v2] [media] tvp514x: Fix init seqeunce Date: Sun, 23 Jun 2013 16:01:35 +0200 Message-Id: <1371996095-24041-1-git-send-email-lars@metafoo.de> X-Mailer: git-send-email 1.8.0 Sender: linux-media-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org X-Spam-Status: No, score=-8.0 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=ham version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP client->driver->id_table will always point to the first entry in the device id table. So all devices will use the same init sequence. Use the id table entry that gets passed to the driver's probe() function to get the right init sequence. Signed-off-by: Lars-Peter Clausen Acked-by: Lad, Prabhakar Tested-by: Lad, Prabhakar --- Changes since v1: Fixed build warnings --- drivers/media/i2c/tvp514x.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/drivers/media/i2c/tvp514x.c b/drivers/media/i2c/tvp514x.c index b8061b5..8f1b74d 100644 --- a/drivers/media/i2c/tvp514x.c +++ b/drivers/media/i2c/tvp514x.c @@ -122,6 +122,8 @@ struct tvp514x_decoder { /* mc related members */ struct media_pad pad; struct v4l2_mbus_framefmt format; + + struct tvp514x_reg *int_seq; }; /* TVP514x default register values */ @@ -863,7 +865,6 @@ tvp514x_s_parm(struct v4l2_subdev *sd, struct v4l2_streamparm *a) static int tvp514x_s_stream(struct v4l2_subdev *sd, int enable) { int err = 0; - struct i2c_client *client = v4l2_get_subdevdata(sd); struct tvp514x_decoder *decoder = to_decoder(sd); if (decoder->streaming == enable) @@ -883,11 +884,8 @@ static int tvp514x_s_stream(struct v4l2_subdev *sd, int enable) } case 1: { - struct tvp514x_reg *int_seq = (struct tvp514x_reg *) - client->driver->id_table->driver_data; - /* Power Up Sequence */ - err = tvp514x_write_regs(sd, int_seq); + err = tvp514x_write_regs(sd, decoder->int_seq); if (err) { v4l2_err(sd, "Unable to turn on decoder\n"); return err; @@ -1090,6 +1088,8 @@ tvp514x_probe(struct i2c_client *client, const struct i2c_device_id *id) memcpy(decoder->tvp514x_regs, tvp514x_reg_list_default, sizeof(tvp514x_reg_list_default)); + decoder->int_seq = (struct tvp514x_reg *)id->driver_data; + /* Copy board specific information here */ decoder->pdata = client->dev.platform_data;