Received: by 2002:a25:ad19:0:0:0:0:0 with SMTP id y25csp7296953ybi; Mon, 22 Jul 2019 10:30:43 -0700 (PDT) X-Google-Smtp-Source: APXvYqzdfaHkYgd1jf4EU4QJvg6vRxIsPDMQ8MPAALhKuABnah+12YaCzNKv+kml25qU6v3+uxnX X-Received: by 2002:a17:90a:3aed:: with SMTP id b100mr78925395pjc.63.1563816643578; Mon, 22 Jul 2019 10:30:43 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1563816643; cv=none; d=google.com; s=arc-20160816; b=w3L2l4LppojqxX8mBBhgoRUPLg7osKaypHYXsBjbd6NhjCi93loj1Qoh3fgP2qbQhz ZBY5V83Td4jLvtIiDJtSotclqDb8LRx/vuCHBYguP536IoLeMMGO/L+O01GUeoBwUBY7 VtCDGddsPzOKcn/VUIHTVreb+ojUWC1pMn5NAYAX67OyDyyQfsMelBtK6I4T1DRTOnRV 6d0+5dd2ArYiGnx+ipINCLEz0vRAd50VZjsSqJ1Zny7JhwOVe2A0t7TKOyyGnfg4HdQi ct5t/hNs5qQiFBcTnpDBtWIPxoJ7NpgVFSj1BHQHJyFsuTSSwOkkKRCxQyuTyjok8dnr IToQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:date:message-id:subject:references:cc:to :from; bh=gq4bMaafEQz2mUxOP9prtmc8Ni/BTtugxq7d2dw6By8=; b=R2LOZaSnV2E0ItJmOlTXvqx2z3eDy6ky7Zxk93/jl3tWsc4MOIm1vucZNM2gKVKnPa z87tvrkeiNa2W1oa4eSTaJjOnbDiLfM3RztZam9/RyOScvx63keQynxeNVzqoHAvUlQM 0kTSXq4RD/RRhBHGVlBpuer5h7A4gJEy+NxbOwldXCBUxhsxwoOcanFgbj/1unj355GF G1xau5O0nEm6fEb5dpjTdNKO+fM4eM2rp0J1s4jjWVIjiUD9cLIjCrggkHd0N8nEe/9X /gA2ij600K8hgZ6krh6xEnXJI4M/PFYtEk8U6r4JbhUCpCtOCRZTUWjwCRl2LYLzExQd Qv8A== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id 61si11367645plb.270.2019.07.22.10.30.27; Mon, 22 Jul 2019 10:30:43 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727884AbfGVPLv (ORCPT + 99 others); Mon, 22 Jul 2019 11:11:51 -0400 Received: from verein.lst.de ([213.95.11.211]:33146 "EHLO verein.lst.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726990AbfGVPLv (ORCPT ); Mon, 22 Jul 2019 11:11:51 -0400 Received: by verein.lst.de (Postfix, from userid 2005) id A17CC227A8A; Mon, 22 Jul 2019 17:11:48 +0200 (CEST) From: Torsten Duwe To: Maxime Ripard , Chen-Yu Tsai , Rob Herring , Mark Rutland , Thierry Reding , David Airlie , Daniel Vetter , Andrzej Hajda , Laurent Pinchart , Icenowy Zheng , Sean Paul , Vasily Khoruzhick , Harald Geyer , Greg Kroah-Hartman , Thomas Gleixner Cc: dri-devel@lists.freedesktop.org, devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org References: <<20190722150414.9F97668B20@verein.lst.de>> Subject: [PATCH v3 4/7] drm/bridge: Prepare Analogix anx6345 support Message-Id: <20190722151148.A17CC227A8A@verein.lst.de> Date: Mon, 22 Jul 2019 17:11:48 +0200 (CEST) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Add bit definitions required for the anx6345 and add a sanity check in anx_dp_aux_transfer. Signed-off-by: Icenowy Zheng Signed-off-by: Vasily Khoruzhick Signed-off-by: Torsten Duwe Reviewed-by: Andrzej Hajda --- drivers/gpu/drm/bridge/analogix/analogix-i2c-dptx.c | 2 +- drivers/gpu/drm/bridge/analogix/analogix-i2c-dptx.h | 8 ++++++++ drivers/gpu/drm/bridge/analogix/analogix-i2c-txcommon.h | 3 +++ 3 files changed, 12 insertions(+), 1 deletion(-) diff --git a/drivers/gpu/drm/bridge/analogix/analogix-i2c-dptx.c b/drivers/gpu/drm/bridge/analogix/analogix-i2c-dptx.c index 60707bb5afe7..fe40bab21530 100644 --- a/drivers/gpu/drm/bridge/analogix/analogix-i2c-dptx.c +++ b/drivers/gpu/drm/bridge/analogix/analogix-i2c-dptx.c @@ -116,7 +116,7 @@ ssize_t anx_dp_aux_transfer(struct regmap *map_dptx, else /* For non-zero-sized set the length field. */ ctrl1 |= (msg->size - 1) << SP_AUX_LENGTH_SHIFT; - if ((msg->request & DP_AUX_I2C_READ) == 0) { + if ((msg->size > 0) && ((msg->request & DP_AUX_I2C_READ) == 0)) { /* When WRITE | MOT write values to data buffer */ err = regmap_bulk_write(map_dptx, SP_DP_BUF_DATA0_REG, buffer, diff --git a/drivers/gpu/drm/bridge/analogix/analogix-i2c-dptx.h b/drivers/gpu/drm/bridge/analogix/analogix-i2c-dptx.h index 430a039c10cd..24bc67ac5479 100644 --- a/drivers/gpu/drm/bridge/analogix/analogix-i2c-dptx.h +++ b/drivers/gpu/drm/bridge/analogix/analogix-i2c-dptx.h @@ -74,7 +74,11 @@ #define SP_CHA_STA BIT(2) /* Bits for DP System Control Register 3 */ #define SP_HPD_STATUS BIT(6) +#define SP_HPD_FORCE BIT(5) +#define SP_HPD_CTRL BIT(4) #define SP_STRM_VALID BIT(2) +#define SP_STRM_FORCE BIT(1) +#define SP_STRM_CTRL BIT(0) /* Bits for DP System Control Register 4 */ #define SP_ENHANCED_MODE BIT(3) @@ -119,6 +123,9 @@ #define SP_LINK_BW_SET_MASK 0x1f #define SP_INITIAL_SLIM_M_AUD_SEL BIT(5) +/* DP Lane Count Setting Register */ +#define SP_DP_LANE_COUNT_SET_REG 0xa1 + /* DP Training Pattern Set Register */ #define SP_DP_TRAINING_PATTERN_SET_REG 0xa2 @@ -132,6 +139,7 @@ /* DP Link Training Control Register */ #define SP_DP_LT_CTRL_REG 0xa8 +#define SP_DP_LT_INPROGRESS 0x80 #define SP_LT_ERROR_TYPE_MASK 0x70 # define SP_LT_NO_ERROR 0x00 # define SP_LT_AUX_WRITE_ERROR 0x01 diff --git a/drivers/gpu/drm/bridge/analogix/analogix-i2c-txcommon.h b/drivers/gpu/drm/bridge/analogix/analogix-i2c-txcommon.h index c1030e0f74cc..9fa6f426f990 100644 --- a/drivers/gpu/drm/bridge/analogix/analogix-i2c-txcommon.h +++ b/drivers/gpu/drm/bridge/analogix/analogix-i2c-txcommon.h @@ -179,6 +179,9 @@ #define SP_VBIT BIT(1) #define SP_AUDIO_LAYOUT BIT(0) +/* Analog Debug Register 1 */ +#define SP_ANALOG_DEBUG1_REG 0xdc + /* Analog Debug Register 2 */ #define SP_ANALOG_DEBUG2_REG 0xdd #define SP_FORCE_SW_OFF_BYPASS 0x20 -- 2.16.4