Received: by 2002:a25:824b:0:0:0:0:0 with SMTP id d11csp876306ybn; Tue, 24 Sep 2019 10:55:40 -0700 (PDT) X-Google-Smtp-Source: APXvYqzB77O+ldRCjP82FZ6kY8I8j8qDL6jrwebbeCbo2b4giUWiXmj7Bhp89qQquChJeSEXLGFC X-Received: by 2002:a17:906:6c8:: with SMTP id v8mr3802345ejb.252.1569347739799; Tue, 24 Sep 2019 10:55:39 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1569347739; cv=none; d=google.com; s=arc-20160816; b=BjtfHqa+Yxg6OZHg14pLLx0tmlf8oLp7N98INV9LTPxAz+EE9y7XFtMFXh/MIS/WAH wzk3/1WM4LXoHcm1BCyiB4C3QGqIqiF3z7c9ReGZ2KlR5J7+56tcxTxiJ7REcE2BqwTh QJXnnQLkgu4tozf97lqOnYBIMHZaMgW3kv5KMXREIv66uwk9hpmJ59M8QKSOO/iCOVLI 2VYyDzU/fXBTUieQcDPuUeV40bB2nVZnegMSnTRZHp5Z6DlD/eJcxwqFP40jK3mbEN4l dzxFC94yHq3uv/c6WVlpHRDtmO3SD7j7IVMXnaBGSq4XTEzNO8UyI/EjhPCsOVOo9zxZ y6Rw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature; bh=O+YhmwqJrHg8o6DEETBNoHqDhZ6WmrPrrzc39GoEXSQ=; b=kB/GGQOkvWj17JcYAytkknNVP2jvtoq3hn5qLMgLi112BQz8o50CuRwE+9Csn57Y8D Gcxxj75w+we0L6/BROwZSRFBNUybPe6nsvt4iDc0Q6mvJD0pyUyRl4jHGRoTZGbxcfuJ 0ggnmq4OwjgpT+K4+lzKjrfgWAMAlNdqBfmu53TIyj/FBwzb92f+kigcgkDliYDukqvD +ARSsJ2OQoVGTu+TS2ijhUj6CFzRXPw+j8PN3NSEBEY8Sl9DY22rsitto5vdc/thPMo6 6HEZ8od6zurnrnVhrfubSW4caY+Qhmw+iH/Z0XiWd+JownKU+Tsu3rxFTbss9+XvZf/a zwgQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@oracle.com header.s=corp-2019-08-05 header.b="rUdbJ/8h"; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=oracle.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id pk19si1293390ejb.257.2019.09.24.10.55.14; Tue, 24 Sep 2019 10:55:39 -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; dkim=pass header.i=@oracle.com header.s=corp-2019-08-05 header.b="rUdbJ/8h"; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=oracle.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1731063AbfIWOEu (ORCPT + 99 others); Mon, 23 Sep 2019 10:04:50 -0400 Received: from aserp2120.oracle.com ([141.146.126.78]:57886 "EHLO aserp2120.oracle.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729899AbfIWOEt (ORCPT ); Mon, 23 Sep 2019 10:04:49 -0400 Received: from pps.filterd (aserp2120.oracle.com [127.0.0.1]) by aserp2120.oracle.com (8.16.0.27/8.16.0.27) with SMTP id x8NDx5PF042124; Mon, 23 Sep 2019 14:04:13 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=date : from : to : cc : subject : message-id : references : mime-version : content-type : in-reply-to; s=corp-2019-08-05; bh=O+YhmwqJrHg8o6DEETBNoHqDhZ6WmrPrrzc39GoEXSQ=; b=rUdbJ/8hA/VRkmlkYysbjBYbTVpAIEo5jYl1VG/zBgnaU6yTOaLSH91/KDorVc4oaLac 2X/lPPyu5JYGk95UVccSjCyKHj14FknozrdZVGYlbGhnWAoHLjkLDVTMvWDt3RDmx2uJ YfyleDmNpBiDzewPJiIpbLrTOgPtNCzlMQ4i/t0SpMUDzExvj7A/lNgSJfkaKwe+m6W5 l+uU1tXk4v7lcb7NtY6BF7I3Y8siJzayWrNeJe64B2iiPpPosqWRZ8ZFPv2xcj8306FO UcG/0fKULdRPDIq3OGHekuKGEUpRH8hoWBEeKXbqga4gCJ0OB1Kg2rLgmfMhrZemVEF3 Hw== Received: from aserp3020.oracle.com (aserp3020.oracle.com [141.146.126.70]) by aserp2120.oracle.com with ESMTP id 2v5btpq5w9-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Mon, 23 Sep 2019 14:04:13 +0000 Received: from pps.filterd (aserp3020.oracle.com [127.0.0.1]) by aserp3020.oracle.com (8.16.0.27/8.16.0.27) with SMTP id x8NE3dd3083540; Mon, 23 Sep 2019 14:04:12 GMT Received: from aserv0122.oracle.com (aserv0122.oracle.com [141.146.126.236]) by aserp3020.oracle.com with ESMTP id 2v5bpgefpw-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Mon, 23 Sep 2019 14:04:12 +0000 Received: from abhmp0020.oracle.com (abhmp0020.oracle.com [141.146.116.26]) by aserv0122.oracle.com (8.14.4/8.14.4) with ESMTP id x8NE47q9025842; Mon, 23 Sep 2019 14:04:07 GMT Received: from kadam (/41.57.98.10) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Mon, 23 Sep 2019 07:04:05 -0700 Date: Mon, 23 Sep 2019 17:03:55 +0300 From: Dan Carpenter To: Xin Ji Cc: "devel@driverdev.osuosl.org" , Laurent Pinchart , Andrzej Hajda , Jernej Skrabec , Jonas Karlman , David Airlie , Neil Armstrong , "linux-kernel@vger.kernel.org" , "dri-devel@lists.freedesktop.org" , Sheng Pan , Daniel Vetter Subject: Re: [PATCH v1 2/2] drm/bridge: anx7625: Add anx7625 MIPI to DP bridge driver Message-ID: <20190923140355.GH2959@kadam> References: <02319a7db948900efe0f945b684221ac076bac48.1568957789.git.xji@analogixsemi.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <02319a7db948900efe0f945b684221ac076bac48.1568957789.git.xji@analogixsemi.com> User-Agent: Mutt/1.9.4 (2018-02-28) X-Proofpoint-Virus-Version: vendor=nai engine=6000 definitions=9388 signatures=668685 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 suspectscore=2 malwarescore=0 phishscore=0 bulkscore=0 spamscore=0 mlxscore=0 mlxlogscore=999 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1908290000 definitions=main-1909230138 X-Proofpoint-Virus-Version: vendor=nai engine=6000 definitions=9388 signatures=668685 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 priorityscore=1501 malwarescore=0 suspectscore=2 phishscore=0 bulkscore=0 spamscore=0 clxscore=1011 lowpriorityscore=0 mlxscore=0 impostorscore=0 mlxlogscore=999 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1908290000 definitions=main-1909230138 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org I wish you would think more about the error codes that you're returning. Most functions do "ret |= frob()." which ORs the error codes together, and results in a nonsense negative error code. But then some functions return 1 on error and zero on success which is sometimes a bug, sometimes confusing but always ugly. On Fri, Sep 20, 2019 at 06:07:43AM +0000, Xin Ji wrote: > The ANX7625 is an ultra-low power 4K Mobile HD Transmitter designed > for portable device. It converts MIPI to DisplayPort 1.3 4K. > > Signed-off-by: Xin Ji > --- > drivers/gpu/drm/bridge/Makefile | 2 +- > drivers/gpu/drm/bridge/analogix/Kconfig | 6 + > drivers/gpu/drm/bridge/analogix/Makefile | 1 + > drivers/gpu/drm/bridge/analogix/anx7625.c | 2085 +++++++++++++++++++++++++++++ > drivers/gpu/drm/bridge/analogix/anx7625.h | 397 ++++++ > 5 files changed, 2490 insertions(+), 1 deletion(-) > create mode 100644 drivers/gpu/drm/bridge/analogix/anx7625.c > create mode 100644 drivers/gpu/drm/bridge/analogix/anx7625.h > > diff --git a/drivers/gpu/drm/bridge/Makefile b/drivers/gpu/drm/bridge/Makefile > index 4934fcf..bcd388a 100644 > --- a/drivers/gpu/drm/bridge/Makefile > +++ b/drivers/gpu/drm/bridge/Makefile > @@ -12,8 +12,8 @@ obj-$(CONFIG_DRM_SII9234) += sii9234.o > obj-$(CONFIG_DRM_THINE_THC63LVD1024) += thc63lvd1024.o > obj-$(CONFIG_DRM_TOSHIBA_TC358764) += tc358764.o > obj-$(CONFIG_DRM_TOSHIBA_TC358767) += tc358767.o > -obj-$(CONFIG_DRM_ANALOGIX_DP) += analogix/ > obj-$(CONFIG_DRM_I2C_ADV7511) += adv7511/ > obj-$(CONFIG_DRM_TI_SN65DSI86) += ti-sn65dsi86.o > obj-$(CONFIG_DRM_TI_TFP410) += ti-tfp410.o > +obj-y += analogix/ > obj-y += synopsys/ > diff --git a/drivers/gpu/drm/bridge/analogix/Kconfig b/drivers/gpu/drm/bridge/analogix/Kconfig > index e930ff9..b2f127e 100644 > --- a/drivers/gpu/drm/bridge/analogix/Kconfig > +++ b/drivers/gpu/drm/bridge/analogix/Kconfig > @@ -2,3 +2,9 @@ > config DRM_ANALOGIX_DP > tristate > depends on DRM > + > +config ANALOGIX_ANX7625 > + tristate "Analogix MIPI to DP interface support" > + help > + ANX7625 is an ultra-low power 4K mobile HD transmitter designed > + for portable devices. It converts MIPI/DPI to DisplayPort1.3 4K. > diff --git a/drivers/gpu/drm/bridge/analogix/Makefile b/drivers/gpu/drm/bridge/analogix/Makefile > index fdbf3fd..8a52867 100644 > --- a/drivers/gpu/drm/bridge/analogix/Makefile > +++ b/drivers/gpu/drm/bridge/analogix/Makefile > @@ -1,3 +1,4 @@ > # SPDX-License-Identifier: GPL-2.0-only > +obj-$(CONFIG_ANALOGIX_ANX7625) += anx7625.o > analogix_dp-objs := analogix_dp_core.o analogix_dp_reg.o > obj-$(CONFIG_DRM_ANALOGIX_DP) += analogix_dp.o > diff --git a/drivers/gpu/drm/bridge/analogix/anx7625.c b/drivers/gpu/drm/bridge/analogix/anx7625.c > new file mode 100644 > index 0000000..eceadef > --- /dev/null > +++ b/drivers/gpu/drm/bridge/analogix/anx7625.c > @@ -0,0 +1,2085 @@ > +// SPDX-License-Identifier: GPL-2.0-only > +/* > + * Copyright(c) 2016, Analogix Semiconductor. All rights reserved. > + * > + */ > +#include > +#include > +#include > +#include > +#include > +#include > +#include > +#include > +#include > +#include > +#include > +#include > + > +#include > +#include > +#include > + > +#include > +#include > +#include > +#include > +#include > +#include > +#include > +#include > + > +#include