Received: by 10.223.148.5 with SMTP id 5csp7051320wrq; Wed, 17 Jan 2018 23:54:42 -0800 (PST) X-Google-Smtp-Source: ACJfBotEen8CUlWp3971I9afRBScNOgqnbkDAdo5w1fPZa/qKwK1y8Rx6xiJA16NpbwYWg8ILLv+ X-Received: by 10.99.160.26 with SMTP id r26mr10432882pge.230.1516262082627; Wed, 17 Jan 2018 23:54:42 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1516262082; cv=none; d=google.com; s=arc-20160816; b=g9SO2v4CqVisZnmKDP7ukqR0wXlqkuFkmrNVELkVI0FoIcuZEGcAREMCtIBhshc0E1 X0WSxhWXLQ8yIrf9tEYXS+OnkUP4uyrD9+JM9BLV+cQ2/IpT2HW7q0SWdJqn69Z52diL OuJfpvto5yIyszky4OPY59NOTa+NfMlU4bXZMkTSwAIk6sP8YcTU6dqoD6EKmreRe/OQ jGny//JaUQK/69KIzbN1J5cx26EKOa5VTv1rQLaEivEgMnIPMT72p+54lZ8c5HMXjOOb bWGzwVKPH45rmL9r/SaMpgQ70tI2XXusWDotuIfpVZc/3tfCYJh8LZ+4xeVJ6qaSAA/n zzmw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :references:in-reply-to:mime-version:arc-authentication-results; bh=7E7Oc8nDCWv7kbOrM6eM8Hrm1FZAw3YMKwjmLLEktIs=; b=R8OiOg/67HtSaOcRVnVZImOSnuJCalcclSVI4eXIzLcMjEJA/FfqT+ro9p8naIs64V WKgRDH8sroGogcQRud7A+iRzvOraGzP5K9msJWjT3yfJf7n3mhIPrJloxh6vaNP2xlmZ 2fUYwsfZbLUgM7UfPXopW73PnSDzhnvsS+8/CsfCWmXQ5E7cF3nCIAY/vjtW0GMSUqYb FbeIF7cNzUCqAO5lWPfxb3JqcwJsrrzDS6FU+9fJlxs4GINgxZ0k1LoSJ/YaqUD8AiTO 9m2xzu5DzlUoMjQ5v94n2rHWwjNwmXlhcsTisX0+NPafuE4Rwt2sjpDSeJ1n3gMR+CfM pvOA== 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 n64si6165417pfj.112.2018.01.17.23.54.28; Wed, 17 Jan 2018 23:54:42 -0800 (PST) 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 S1754761AbeARHxh (ORCPT + 99 others); Thu, 18 Jan 2018 02:53:37 -0500 Received: from mail-wm0-f50.google.com ([74.125.82.50]:38222 "EHLO mail-wm0-f50.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753390AbeARHxg (ORCPT ); Thu, 18 Jan 2018 02:53:36 -0500 Received: by mail-wm0-f50.google.com with SMTP id 141so20650164wme.3 for ; Wed, 17 Jan 2018 23:53:36 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=7E7Oc8nDCWv7kbOrM6eM8Hrm1FZAw3YMKwjmLLEktIs=; b=plBB0OIcBImBPVoZiJiiZQOGnmTm4hmTILzuvxtb7CMvfGkR39uHN9EiKKcd1rXJ53 eFaPA+D/ASMYMCSnuWjgUXbSS4/ThzCV4C/9WJlwr7B83gYzQMIXfOO6zFGZiTW9FA+W oun3V4NvZTqgvJZF8VYLG0zGy8nl9BIhXdAl7Ev0+szx7yQH4Clp0UIerhq1U8Cwp4IC zXxMyL6YQNf8sTcnKzWfGfCY2ZpQMxU0QxqKFlrmVf5b0m4Gk/FnJE9RaZPzbJLVynvH Rk3qguTbqnmomb1naOfkd5/376BYWrBpMwIdmkKPjRXYAKNloCiJNiR1/RDRj4TYepNn D+/Q== X-Gm-Message-State: AKwxytc2iWDFmvnYxmhE6eIYEZAsD3C71VrcBev26FyqKeOwp606QlbE OztQh/SDoq7kHR+bUBsXf0uAZzfB X-Received: by 10.80.173.110 with SMTP id z43mr6584772edc.305.1516262015219; Wed, 17 Jan 2018 23:53:35 -0800 (PST) Received: from mail-wr0-f173.google.com (mail-wr0-f173.google.com. [209.85.128.173]) by smtp.gmail.com with ESMTPSA id k12sm3929330edl.86.2018.01.17.23.53.33 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 17 Jan 2018 23:53:34 -0800 (PST) Received: by mail-wr0-f173.google.com with SMTP id d9so21582134wre.3 for ; Wed, 17 Jan 2018 23:53:33 -0800 (PST) X-Received: by 10.223.163.196 with SMTP id m4mr5538367wrb.85.1516262013467; Wed, 17 Jan 2018 23:53:33 -0800 (PST) MIME-Version: 1.0 Received: by 10.223.176.78 with HTTP; Wed, 17 Jan 2018 23:53:12 -0800 (PST) In-Reply-To: <20180118072258.ucbchh32mhyln2qn@flea.lan> References: <3b7164f4a5199f0499c6f41201b31bc471cb3af9.1515492513.git-series.maxime.ripard@free-electrons.com> <20180118072258.ucbchh32mhyln2qn@flea.lan> From: Chen-Yu Tsai Date: Thu, 18 Jan 2018 15:53:12 +0800 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH v3 08/13] drm/sun4i: Add a driver for the display frontend To: Maxime Ripard Cc: Daniel Vetter , David Airlie , dri-devel , linux-kernel , linux-arm-kernel , Thomas Petazzoni , Neil Armstrong , thomas@vitsch.nl Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Jan 18, 2018 at 3:22 PM, Maxime Ripard wrote: > Hi, > > On Wed, Jan 17, 2018 at 09:43:31PM +0800, Chen-Yu Tsai wrote: >> > if (sun4i_drv_node_is_connector(node)) >> > return 0; >> > >> > - if (!sun4i_drv_node_is_frontend(node)) { >> > + /* >> > + * If the device is either just a regular device, or an >> > + * enabled frontend supported by the driver, we add it to our >> > + * component list. >> > + */ >> > + if (!sun4i_drv_node_is_frontend(node) || >> > + (sun4i_drv_node_is_supported_frontend(node) && >> > + of_device_is_available(node))) { >> >> Nit: sun4i_drv_node_is_supported_frontend should be a subset of >> sun4i_drv_node_is_frontend, so of_device_is_available should always >> be true at this point. > > That's not really the condition though :) > > It's if the device is *not* a frontend or if it is a supported > frontend that is available, add it to the endpoints list. Right. I got confused by the inverted logic. Sorry. > >> > + regmap_write(frontend->regs, SUN4I_FRONTEND_INPUT_FMT_REG, >> > + SUN4I_FRONTEND_INPUT_FMT_DATA_MOD(1) | >> > + SUN4I_FRONTEND_INPUT_FMT_DATA_FMT(in_fmt_val) | >> > + SUN4I_FRONTEND_INPUT_FMT_PS(1)); >> > + regmap_write(frontend->regs, SUN4I_FRONTEND_OUTPUT_FMT_REG, >> > + SUN4I_FRONTEND_OUTPUT_FMT_DATA_FMT(out_fmt_val)); >> >> Seems that you also need to set the "ALPHA_EN" bit for ARGB. > > I have not seen that bit documented anywhere. Where is it coming from? The A31's user manual. I just checked all the datasheets, and only the A31 and the A80 have this bit (bit 7) defined. It says if the bit is cleared, alpha is replaced with 0xff. I assume it works either way on the A33, or you wouldn't be suprised. Leave it out for now then. (Or maybe a TODO note now that we know about it.) ChenYu > >> > + frontend->reset = devm_reset_control_get(dev, NULL); >> > + if (IS_ERR(frontend->reset)) { >> > + dev_err(dev, "Couldn't get our reset line\n"); >> > + return PTR_ERR(frontend->reset); >> > + } >> > + reset_control_reset(frontend->reset); >> >> reset_control_reset leaves the reset control deasserted. At this >> point the clock might not be running, which might mean the internal >> state is not completely wiped out. (Though this really depends on >> the design of the internal logic.) >> >> Maybe just assert it? It gets deasserted in the runtime PM callback >> later. And just to be safe, I would move it close to the end of the >> probe path, past all possible errors, so the hardware doesn't get >> touched until everything is ready. Or don't touch it anywhere in >> the probe path, and have the runtime PM resume function do a reset. > > That seems like the best solution yes. > > Thanks! > Maxime > > -- > Maxime Ripard, Free Electrons > Embedded Linux and Kernel engineering > http://free-electrons.com