Received: by 2002:ab2:6991:0:b0:1f7:f6c3:9cb1 with SMTP id v17csp650478lqo; Wed, 8 May 2024 10:25:15 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCWkgDlWQKal4yQg40QXrxmFiQHAPldlrvcdtVo6+QrUQexpF5lEPJ3IDmaQOEbrUAJa3dUDPtWjl1ELUurhE7fYzJRObTjZv1MAfJesaQ== X-Google-Smtp-Source: AGHT+IFeJ55EuL2TKwgxiusTF1Vw6LDQ77mzluP4RK1TrB4UypmiqjSjo+Zws60p61nQogDO7Wj7 X-Received: by 2002:a17:906:f359:b0:a59:c46b:c525 with SMTP id a640c23a62f3a-a59fb709598mr234293566b.0.1715189115030; Wed, 08 May 2024 10:25:15 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1715189115; cv=pass; d=google.com; s=arc-20160816; b=NxlMC9eMrY5XBJ6yqdZlqzzMX8kicCfyPlnwSSCr1oxtJT8zs5G6E78hGgy/RjSQOl qLIsfBoUC65bpStyuRRegRiU/OyMmb6iEcQwG37Eh/oivVH/GW+ZG7sOYd4cV1jkTIJr Yxh0qgX10bQYDxPBqdyOsGPQPe1Ww6Yzx8i/r0OwuJRL6LP2QO7R17w4XEojj+5W8jTY mv8qZ5ybphs5h7U1HidfNILyXFtazgdpIlPKhTfgx31/0sn/X7LmoD7CHYfu+Bnw9V7y vYra1lVtPhSV5i//OKFimtE4ez71mJciozCdx/mL2GdSOkA9z+mh2NsDLIJ+8ukZ2xfm ccqQ== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:list-unsubscribe:list-subscribe :list-id:precedence:dkim-signature; bh=B+VKTM4P5eufJalRCrDbHQ7nMVvva4ngXjaL2EQ5cWU=; fh=W6HkYT9tZhhQhru6CHo9afD9uZzLKqU2iGMlXB8uwPs=; b=XADOVpfgdpYNySYcNbLJH7yZAKIVKUnBTnGOT7xga8IxjA1PNvF9/svlWt1d4e6YQK eG6aMt/XqCzOyPKgk+1u/uhA1A7pH+A6BW3nMZHYm3pgk/Zt8ZwsSu6mp/0VJFTTNFLo XkHnqohfr2T+4k6waGbxCg8G8HHv63zQ5nOTJpV7fw04znIypQKsQZG+n38+LcF9+Wwk XbfaSxO95niclqk/Fst4wOQU/71Iv0A6eY/wOPXLplCGiYnNhBl6OctIBdL0/q44j8uh yakcE3SQf4bw2vLBeTp4dNqABEBDFm4+EvTPRVcyD63NDS9elpWoJK1Ebhv2NwYNIHf2 LFzw==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=hzNqPoyN; arc=pass (i=1 spf=pass spfdomain=chromium.org dkim=pass dkdomain=chromium.org dmarc=pass fromdomain=chromium.org); spf=pass (google.com: domain of linux-kernel+bounces-173623-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-173623-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=chromium.org Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [2604:1380:4601:e00::3]) by mx.google.com with ESMTPS id t18-20020a17090605d200b00a5934cc1fbdsi6937229ejt.446.2024.05.08.10.25.14 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 08 May 2024 10:25:15 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-173623-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) client-ip=2604:1380:4601:e00::3; Authentication-Results: mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=hzNqPoyN; arc=pass (i=1 spf=pass spfdomain=chromium.org dkim=pass dkdomain=chromium.org dmarc=pass fromdomain=chromium.org); spf=pass (google.com: domain of linux-kernel+bounces-173623-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-173623-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=chromium.org Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by am.mirrors.kernel.org (Postfix) with ESMTPS id 922161F22813 for ; Wed, 8 May 2024 17:25:14 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 0CA42128383; Wed, 8 May 2024 17:25:08 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=chromium.org header.i=@chromium.org header.b="hzNqPoyN" Received: from mail-qv1-f43.google.com (mail-qv1-f43.google.com [209.85.219.43]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 81F9259165 for ; Wed, 8 May 2024 17:25:05 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.219.43 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1715189107; cv=none; b=dXGbpZXbfXcUXFFJ6qz/zJRYbV8PLQJt7/9Y0SfjHJDBRKa+qgOCl/BHK1Iu01gVRuODDiODNFbOQ85t1Z4pmadkAnvq7ZCtj8DxW1x6wm60CrmpSI2SPzs8SY9Z284T9IHXiMGUcTfpdBag6DOeUyNipLDwLKxBATwyNpi/h58= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1715189107; c=relaxed/simple; bh=mRchDPxMeHJwLDj1d+HyfPvCH4lFbS4D7KCFGiKd3zs=; h=MIME-Version:References:In-Reply-To:From:Date:Message-ID:Subject: To:Cc:Content-Type; b=IUBqf6/DDnOrwnhWLPm5hrFExLmlgn0NevZXAVqkIhaJwNl/TrhUd4nDlOQhZY8ZAp2lIUlPJ7f5OTQHVOOQeGEU+keEwd8OFjCzGo5T2hoUuRwHmbwvdL0b1P60F+h6fRAf1t/hKtUTP1F6+CAmEnGqJIpG/59M69XLa0FxGYc= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=chromium.org; spf=pass smtp.mailfrom=chromium.org; dkim=pass (1024-bit key) header.d=chromium.org header.i=@chromium.org header.b=hzNqPoyN; arc=none smtp.client-ip=209.85.219.43 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=chromium.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=chromium.org Received: by mail-qv1-f43.google.com with SMTP id 6a1803df08f44-69b5ece41dfso115366d6.2 for ; Wed, 08 May 2024 10:25:05 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; t=1715189103; x=1715793903; darn=vger.kernel.org; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=B+VKTM4P5eufJalRCrDbHQ7nMVvva4ngXjaL2EQ5cWU=; b=hzNqPoyNkuwnHwuHdxrfPq7+hg2nM9sxsbJU8Q7k+uuQZzwKI05gAV/d06oI9tMAly nl0HlYlnYXN7njM2mkIuKAXmhOapqvXMLuv0cxheRGfHimvY6uyKzI1uAd2BcEUuERdZ 4sZuhfzippZbaFfx9BjGSvgwh4xPeZ0MBkZLE= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1715189103; x=1715793903; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=B+VKTM4P5eufJalRCrDbHQ7nMVvva4ngXjaL2EQ5cWU=; b=jIJfSJBGmJGaVN7SVJ5LdKO+v1aJJ6NmlYWkWtTgBb0r2ZRZRNRTLHYn/3qtMu3Twb AhYTsr4auwjo+6dfN+6BM/nj26YtaxaPJ/QyunEeBBqU+DScVG6jXxI/ZugAwIEg3BqX GjjRDZ7hjAeWgewnJ9J2kMEpCSN5Skqe8MAEKe8tXNL9A1t37vUZzZWwiI4X1SwVTaSf cB2d0HGxWuCdwRU35TyyPbP/2PSilKsL6otDEFKyPKYTKxoPZv5jWdPquD6qzupd43ma jmewlaJA6TROvoOxV90EjbD09/5Hzu8LIJaT6QoEortB3wksc8tcbjqVyTXzLKnMolUW OEhQ== X-Forwarded-Encrypted: i=1; AJvYcCVK7jHm3Jiwgpc1vPx0RaiehJZ9Av6uw2J2rWVAnvvuXV8G73QeMBZ0ZK91TAjwJeCEIu4ce1QamAVAFLxv6oxjw7EusB8cqdcqi6pJ X-Gm-Message-State: AOJu0YyrdkJsOEeq3M6oPit+gl6pu0bS7nzYwoCzjYZv+qYEOdMxvi/w Mp+NH8t5KDpS7hUqQeORKJeZ8L7seQCUolJY0v6q1ORub9SOiBz9gVH9yXtN/Z5CjfoYS3cNAGA = X-Received: by 2002:a05:6214:2a4d:b0:6a0:7a3f:d290 with SMTP id 6a1803df08f44-6a1514cee2fmr37668716d6.51.1715189103190; Wed, 08 May 2024 10:25:03 -0700 (PDT) Received: from mail-qt1-f176.google.com (mail-qt1-f176.google.com. [209.85.160.176]) by smtp.gmail.com with ESMTPSA id a14-20020a0cefce000000b006a0fa61359asm5753269qvt.41.2024.05.08.10.25.01 for (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Wed, 08 May 2024 10:25:01 -0700 (PDT) Received: by mail-qt1-f176.google.com with SMTP id d75a77b69052e-439b1c72676so30981cf.1 for ; Wed, 08 May 2024 10:25:01 -0700 (PDT) X-Forwarded-Encrypted: i=1; AJvYcCUE9f/a3+RJXE1w44zSomfQwF1GqXLJOTQXuwf0RTG+1oX5EBsY/UZcE9wwluTPJpCp65Kw4JOfVtS6iyz2Yb6sgzD/JsUtA9Or2Ihn X-Received: by 2002:a05:622a:4e0a:b0:43d:db04:45d1 with SMTP id d75a77b69052e-43ddb044c2fmr2760251cf.1.1715189101210; Wed, 08 May 2024 10:25:01 -0700 (PDT) Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 References: <20240507135234.1356855-1-yangcong5@huaqin.corp-partner.google.com> <20240507135234.1356855-3-yangcong5@huaqin.corp-partner.google.com> In-Reply-To: From: Doug Anderson Date: Wed, 8 May 2024 10:24:43 -0700 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH v4 2/7] drm/panel: himax-hx83102: Break out as separate driver To: cong yang Cc: sam@ravnborg.org, neil.armstrong@linaro.org, daniel@ffwll.ch, linus.walleij@linaro.org, krzysztof.kozlowski+dt@linaro.org, robh+dt@kernel.org, conor+dt@kernel.org, airlied@gmail.com, dri-devel@lists.freedesktop.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, xuxinxiong@huaqin.corp-partner.google.com Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Hi, On Wed, May 8, 2024 at 4:52=E2=80=AFAM cong yang wrote: > > > > +static int starry_himax83102_j02_init(struct hx83102 *ctx) > > > +{ > > > + struct mipi_dsi_multi_context dsi_ctx =3D { .dsi =3D ctx->dsi= }; > > > + > > > + hx83102_enable_extended_cmds(ctx, true); > > > + mipi_dsi_dcs_write_seq_multi(&dsi_ctx, HX83102_SETPOWER, 0x2c= , 0xb5, 0xb5, 0x31, 0xf1, > > > + 0x31, 0xd7, 0x2f, 0x36, 0x36= , 0x36, 0x36, 0x1a, 0x8b, 0x11, > > > + 0x65, 0x00, 0x88, 0xfa, 0xff= , 0xff, 0x8f, 0xff, 0x08, 0x74, > > > + 0x33); > > > > The indentation is still off here. You have 5 tabs followed by a > > space. To make things line up with the opening brace I think it should > > be 4 tabs followed by 5 spaces. > > Sorry, my editor 'Visual Studio Code' It seems that the correct indentat= ion > is not recognized. I have checked it through the 'vim' editor in the V4 v= ersion. > Thanks. FWIW, I use VS Code and it looks fine to me. Maybe check your VS Code settings? Tab size should be 8. > > > +static int hx83102_enable(struct drm_panel *panel) > > > +{ > > > + struct hx83102 *ctx =3D panel_to_hx83102(panel); > > > + struct mipi_dsi_device *dsi =3D ctx->dsi; > > > + struct device *dev =3D &dsi->dev; > > > + int ret; > > > + > > > + ret =3D ctx->desc->init(ctx); > > > + if (ret) > > > + return ret; > > > > You're still changing behavior here. In the old boe-tv101wum-nl6 > > driver the init() function was invoked at the end of prepare(). Now > > you've got it at the beginning of enable(). If this change is > > important it should be in a separate commit and explained. > > > > > > > + ret =3D mipi_dsi_dcs_exit_sleep_mode(dsi); > > > + if (ret) { > > > + dev_err(dev, "Failed to exit sleep mode: %d\n", ret); > > > + return ret; > > > + } > > > + > > > + msleep(120); > > > + > > > + ret =3D mipi_dsi_dcs_set_display_on(dsi); > > > + if (ret) { > > > + dev_err(dev, "Failed to turn on the display: %d\n", r= et); > > > + } > > > > The old boe-tv101wum-nl6 driver didn't call > > mipi_dsi_dcs_exit_sleep_mode() nor mipi_dsi_dcs_set_display_on() in > > its enable routine, did it? If this change is important please put it > > in a separate change and justify it. > > In the old boe-tv101wum-nl6 driver inital cmds was invoked at the end of > prepare() function , and call 0x11 and 0x29 at end of inital. For > himax-hx83102 driver, we move inital cmds invoked at enable() function. > For panel timing, I think there is no much difference. They are > all initial cmds executed after meeting the power-on sequence. > I will update these in the v4 commit message. Ah, I see! So the mipi_dsi_dcs_exit_sleep_mode() was the 0x11 in the old code and the mipi_dsi_dcs_set_display_on() was the 0x29 in the old code. OK, I agree that it's better like you've done it where those functions are moved out of the "->init()" function and into the caller, so please keep that as you have it. The only thing I would request is to keep the ->init() call to be made at the end of prepare() instead of the beginning of enable(). It may not matter too much, but in that case I'd rather keep it how it was or make it an explicit change and not an implicit part of the refactor. -Doug