From patchwork Sat Jun 15 14:34:36 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: 2727451 Return-Path: X-Original-To: patchwork-linux-media@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 62640C0AB1 for ; Sat, 15 Jun 2013 14:49:37 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 909E5201BD for ; Sat, 15 Jun 2013 14:49:36 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 64E1B201B9 for ; Sat, 15 Jun 2013 14:49:34 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753933Ab3FOOtb (ORCPT ); Sat, 15 Jun 2013 10:49:31 -0400 Received: from smtp-out-220.synserver.de ([212.40.185.220]:1027 "EHLO smtp-out-220.synserver.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752337Ab3FOOtb (ORCPT ); Sat, 15 Jun 2013 10:49:31 -0400 X-Greylist: delayed 899 seconds by postgrey-1.27 at vger.kernel.org; Sat, 15 Jun 2013 10:49:30 EDT Received: (qmail 18430 invoked by uid 0); 15 Jun 2013 14:34:26 -0000 X-SynServer-TrustedSrc: 1 X-SynServer-AuthUser: lars@metafoo.de X-SynServer-PPID: 18396 Received: from ppp-93-104-187-255.dynamic.mnet-online.de (HELO lars-adi-laptop.fritz.box) [93.104.187.255] by 217.119.54.87 with SMTP; 15 Jun 2013 14:34:25 -0000 From: Lars-Peter Clausen To: Mauro Carvalho Chehab Cc: Prabhakar Lad , Manjunath Hadli , linux-media@vger.kernel.org, Lars-Peter Clausen Subject: [PATCH] [media] tvp514x: Fix init seqeunce Date: Sat, 15 Jun 2013 16:34:36 +0200 Message-Id: <1371306876-8596-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=-7.2 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 --- drivers/media/i2c/tvp514x.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/drivers/media/i2c/tvp514x.c b/drivers/media/i2c/tvp514x.c index 7438e01..8640d68 100644 --- a/drivers/media/i2c/tvp514x.c +++ b/drivers/media/i2c/tvp514x.c @@ -123,6 +123,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 */ @@ -882,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; @@ -1089,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 = id->driver_data; + /* Copy board specific information here */ decoder->pdata = client->dev.platform_data;