From patchwork Tue Feb 27 15:05:49 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Kieran Bingham X-Patchwork-Id: 10245649 X-Patchwork-Delegate: geert@linux-m68k.org Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 1F5A060362 for ; Tue, 27 Feb 2018 15:07:34 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 132A2286C8 for ; Tue, 27 Feb 2018 15:07:34 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 0772B28734; Tue, 27 Feb 2018 15:07:34 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-7.0 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, RCVD_IN_DNSWL_HI autolearn=unavailable version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 01876286C8 for ; Tue, 27 Feb 2018 15:07:33 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753238AbeB0PHA (ORCPT ); Tue, 27 Feb 2018 10:07:00 -0500 Received: from galahad.ideasonboard.com ([185.26.127.97]:33192 "EHLO galahad.ideasonboard.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753996AbeB0PF7 (ORCPT ); Tue, 27 Feb 2018 10:05:59 -0500 Received: from localhost.localdomain (cpc89242-aztw30-2-0-cust488.18-1.cable.virginm.net [86.31.129.233]) by galahad.ideasonboard.com (Postfix) with ESMTPSA id D87C6203A0; Tue, 27 Feb 2018 16:04:05 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com; s=mail; t=1519743846; bh=Nzt8jAQ883QtpV7suSLepSIg+RWKZMbxevAyR913l+U=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=iBgWCvwtYcFPELOKdEa4CW4SqLPawgsHbjuMx5KSSi+to03dc3WpRdx3iX1Qgi3d/ OI0JOaOv2uZqsaIeE8oDrAXijnLZhgly+ZSSH4mXkrol3eOjC1qgeMKf+pjEehR3G1 644YVaix/ZMxuHYU4fob9PJo+weY9nyEut3DwvLo= From: Kieran Bingham To: linux-renesas-soc@vger.kernel.org, linux-media@vger.kernel.org, Kieran Bingham Cc: niklas.soderlund@ragnatech.se, Mauro Carvalho Chehab , linux-kernel@vger.kernel.org (open list) Subject: [PATCH v2 2/3] media: i2c: adv748x: Add missing CBUS page Date: Tue, 27 Feb 2018 15:05:49 +0000 Message-Id: <1519743950-28346-3-git-send-email-kieran.bingham+renesas@ideasonboard.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1519743950-28346-1-git-send-email-kieran.bingham+renesas@ideasonboard.com> References: <1519743950-28346-1-git-send-email-kieran.bingham+renesas@ideasonboard.com> MIME-Version: 1.0 Sender: linux-renesas-soc-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-renesas-soc@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP From: Kieran Bingham The ADV748x has 12 pages mapped onto I2C addresses. In the existing implementation only 11 are mapped correctly in the page enumerations, which causes an off-by-one fault on pages above the infoframe definition due to a missing 'CBUS' page. This causes the address for the CEC, SDP, TXA, and TXB to be incorrectly programmed during the iterations in adv748x_initialise_clients(). Until now this has gone un-noticed due to the fact that following the creation of the clients - the device is reset and the addresses are reprogrammed in manually by the call to "adv748x_write_regs(state, adv748x_set_slave_address);" As part of moving to dynamic i2c address allocations repair this by providing the missing CBUS page definition. Signed-off-by: Kieran Bingham Reviewed-by: Niklas Söderlund --- v2 - Remove period from commit title. - Collect Niklas' RB tag. drivers/media/i2c/adv748x/adv748x-core.c | 3 +++ drivers/media/i2c/adv748x/adv748x.h | 2 ++ 2 files changed, 5 insertions(+) diff --git a/drivers/media/i2c/adv748x/adv748x-core.c b/drivers/media/i2c/adv748x/adv748x-core.c index faf73949962b..9dcaadaca217 100644 --- a/drivers/media/i2c/adv748x/adv748x-core.c +++ b/drivers/media/i2c/adv748x/adv748x-core.c @@ -52,6 +52,7 @@ static const struct regmap_config adv748x_regmap_cnf[] = { ADV748X_REGMAP_CONF("edid"), ADV748X_REGMAP_CONF("repeater"), ADV748X_REGMAP_CONF("infoframe"), + ADV748X_REGMAP_CONF("cbus"), ADV748X_REGMAP_CONF("cec"), ADV748X_REGMAP_CONF("sdp"), ADV748X_REGMAP_CONF("txa"), @@ -89,6 +90,7 @@ static int adv748x_i2c_addresses[ADV748X_PAGE_MAX] = { ADV748X_I2C_EDID, ADV748X_I2C_REPEATER, ADV748X_I2C_INFOFRAME, + ADV748X_I2C_CBUS, ADV748X_I2C_CEC, ADV748X_I2C_SDP, ADV748X_I2C_TXB, @@ -352,6 +354,7 @@ static const struct adv748x_reg_value adv748x_set_slave_address[] = { {ADV748X_PAGE_IO, 0xf6, ADV748X_I2C_EDID << 1}, {ADV748X_PAGE_IO, 0xf7, ADV748X_I2C_REPEATER << 1}, {ADV748X_PAGE_IO, 0xf8, ADV748X_I2C_INFOFRAME << 1}, + {ADV748X_PAGE_IO, 0xf9, ADV748X_I2C_CBUS << 1}, {ADV748X_PAGE_IO, 0xfa, ADV748X_I2C_CEC << 1}, {ADV748X_PAGE_IO, 0xfb, ADV748X_I2C_SDP << 1}, {ADV748X_PAGE_IO, 0xfc, ADV748X_I2C_TXB << 1}, diff --git a/drivers/media/i2c/adv748x/adv748x.h b/drivers/media/i2c/adv748x/adv748x.h index 6789e2f3bc8c..725662edc4b8 100644 --- a/drivers/media/i2c/adv748x/adv748x.h +++ b/drivers/media/i2c/adv748x/adv748x.h @@ -35,6 +35,7 @@ #define ADV748X_I2C_EDID 0x36 /* EDID Map */ #define ADV748X_I2C_REPEATER 0x32 /* HDMI RX Repeater Map */ #define ADV748X_I2C_INFOFRAME 0x31 /* HDMI RX InfoFrame Map */ +#define ADV748X_I2C_CBUS 0x30 /* CBUS MHL Map */ #define ADV748X_I2C_CEC 0x41 /* CEC Map */ #define ADV748X_I2C_SDP 0x79 /* SDP Map */ #define ADV748X_I2C_TXB 0x48 /* CSI-TXB Map */ @@ -48,6 +49,7 @@ enum adv748x_page { ADV748X_PAGE_EDID, ADV748X_PAGE_REPEATER, ADV748X_PAGE_INFOFRAME, + ADV748X_PAGE_CBUS, ADV748X_PAGE_CEC, ADV748X_PAGE_SDP, ADV748X_PAGE_TXB,