Received: by 2002:ab2:6816:0:b0:1f9:5764:f03e with SMTP id t22csp2959544lqo; Tue, 21 May 2024 02:32:02 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCVDN9k56moPS33fW1yqqr4NBeagK3LzHJg7qO5oMYIdY9MEtmRMtR97dPbwg9nHzraoTHs1CSqoe1ZVVKqvkVTTY6oJcuEj2MSwnCm01w== X-Google-Smtp-Source: AGHT+IGYmSXEzW5ZLcjcxBa7Qp+/aKESeZFvllVT7FPZ5NXY+K0mQur0xqzhm0sZqQw3qaD74ihq X-Received: by 2002:a05:6512:2ee:b0:51b:5c9f:992e with SMTP id 2adb3069b0e04-5220ff71d7bmr20086471e87.14.1716283922603; Tue, 21 May 2024 02:32:02 -0700 (PDT) Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [2604:1380:4601:e00::3]) by mx.google.com with ESMTPS id 4fb4d7f45d1cf-5733beac427si13657452a12.27.2024.05.21.02.32.02 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 21 May 2024 02:32:02 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-184708-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=neutral (body hash did not verify) header.i=@kernel.org header.s=k20201202 header.b=GPrBYDFC; arc=fail (body hash mismatch); spf=pass (google.com: domain of linux-kernel+bounces-184708-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-184708-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.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 1B2DF1F22B1C for ; Tue, 21 May 2024 09:32:02 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 25FFA5B69E; Tue, 21 May 2024 09:31:55 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=fail reason="signature verification failed" (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="GPrBYDFC" Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 3B6241D554; Tue, 21 May 2024 09:31:53 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1716283914; cv=none; b=CZBGjIxZv1JbNg299w7qLVeOsFTw00c35cCo3ku9MgCwPLViyhi4kDKIvdazickJsX/zwZTKT/AUtqnlXWkLJqM1WmEY5fQx9Q3rt4QdLGfOIpy/rRIVd9hdO0d5q5l3oHRSfb4CGXFq/AfySAfaNHUVYwclg/GUzYiosYCQR+w= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1716283914; c=relaxed/simple; bh=UWCVCjCl906tjXacuShzM1G1T44KjkD2GCeJ9RE58ZE=; h=Message-ID:Date:MIME-Version:Subject:To:Cc:References:From: In-Reply-To:Content-Type; b=io7pMzyRitagnc+Iwl2kIyv3m7hqvzSTtQz/JD/WQxnUCYiDR5+0pPmyBl5qvQEPKFzpiQnZKagU9b/gqaZGKMxYLBu2q9l2C+hlBk4J0a8KEDptuK1rNyyXSDVICjhaBvzCofA1VI3E3EsatWlFdxQMF7xwFAIFJXxhoIvHGEQ= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=GPrBYDFC; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id 13FDEC2BD11; Tue, 21 May 2024 09:31:45 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1716283913; bh=UWCVCjCl906tjXacuShzM1G1T44KjkD2GCeJ9RE58ZE=; h=Date:Subject:To:Cc:References:From:In-Reply-To:From; b=GPrBYDFCLb7oH1fnTJb3RthIZJRAGxX4QWMFlYRjJpLobkalbXqGxRAmZ5WILY3Oe qfL7Nppcy3DMA1rIurkwUhtwDOXaZIc/8US5QmoNAS/a0yvSurSx4liX2vmSLj6YFk eH9N/r7c01KSo/zoIzHo0WTt0paoChUc8SvLV/1RiqCB8hGLCi4m01n5PslUkOSKWO OcQd3YB1FynF9Njl1TvmGD6gYHzDcPjV0pP9lpr0qNV+A4VI5rbzfn6V4rqSKOnU/4 4cbjUFWl0ZJ94EOvz+aEevKATlmXbh+SYrae3FsRLZRzrkasgdp/ESzQ2MI+RAOsi0 b4FwXwr9va0Fg== Message-ID: <6c936567-bb22-47d0-8759-983a2d99c994@kernel.org> Date: Tue, 21 May 2024 11:31:43 +0200 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH v4 09/10] drm/vs: Innosilicon HDMI support To: keith , andrzej.hajda@intel.com, neil.armstrong@linaro.org, rfoss@kernel.org, Laurent.pinchart@ideasonboard.com, jonas@kwiboo.se, jernej.skrabec@gmail.com, maarten.lankhorst@linux.intel.com, mripard@kernel.org, tzimmermann@suse.de, airlied@gmail.com, daniel@ffwll.ch, robh@kernel.org, krzk+dt@kernel.org, conor+dt@kernel.org, hjc@rock-chips.com, heiko@sntech.de, andy.yan@rock-chips.com, xingyu.wu@starfivetech.com, p.zabel@pengutronix.de, jack.zhu@starfivetech.com, shengyang.chen@starfivetech.com Cc: dri-devel@lists.freedesktop.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org References: <20240521105817.3301-1-keith.zhao@starfivetech.com> <20240521105817.3301-10-keith.zhao@starfivetech.com> From: Krzysztof Kozlowski Content-Language: en-US Autocrypt: addr=krzk@kernel.org; keydata= xsFNBFVDQq4BEAC6KeLOfFsAvFMBsrCrJ2bCalhPv5+KQF2PS2+iwZI8BpRZoV+Bd5kWvN79 cFgcqTTuNHjAvxtUG8pQgGTHAObYs6xeYJtjUH0ZX6ndJ33FJYf5V3yXqqjcZ30FgHzJCFUu JMp7PSyMPzpUXfU12yfcRYVEMQrmplNZssmYhiTeVicuOOypWugZKVLGNm0IweVCaZ/DJDIH gNbpvVwjcKYrx85m9cBVEBUGaQP6AT7qlVCkrf50v8bofSIyVa2xmubbAwwFA1oxoOusjPIE J3iadrwpFvsZjF5uHAKS+7wHLoW9hVzOnLbX6ajk5Hf8Pb1m+VH/E8bPBNNYKkfTtypTDUCj NYcd27tjnXfG+SDs/EXNUAIRefCyvaRG7oRYF3Ec+2RgQDRnmmjCjoQNbFrJvJkFHlPeHaeS BosGY+XWKydnmsfY7SSnjAzLUGAFhLd/XDVpb1Een2XucPpKvt9ORF+48gy12FA5GduRLhQU vK4tU7ojoem/G23PcowM1CwPurC8sAVsQb9KmwTGh7rVz3ks3w/zfGBy3+WmLg++C2Wct6nM Pd8/6CBVjEWqD06/RjI2AnjIq5fSEH/BIfXXfC68nMp9BZoy3So4ZsbOlBmtAPvMYX6U8VwD TNeBxJu5Ex0Izf1NV9CzC3nNaFUYOY8KfN01X5SExAoVTr09ewARAQABzSVLcnp5c3p0b2Yg S296bG93c2tpIDxrcnprQGtlcm5lbC5vcmc+wsGVBBMBCgA/AhsDBgsJCAcDAgYVCAIJCgsE FgIDAQIeAQIXgBYhBJvQfg4MUfjVlne3VBuTQ307QWKbBQJgPO8PBQkUX63hAAoJEBuTQ307 QWKbBn8P+QFxwl7pDsAKR1In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dnRBY fv0= In-Reply-To: <20240521105817.3301-10-keith.zhao@starfivetech.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit On 21/05/2024 12:58, keith wrote: > add inno hdmi driver which binds to vs display controller > and this driver uses the commom api from the inno hdmi > > Signed-off-by: keith > --- .. > +static int starfive_hdmi_bind(struct device *dev, struct device *master, > + void *data) > +{ > + struct platform_device *pdev = to_platform_device(dev); > + struct drm_device *drm = dev_get_drvdata(master); > + struct stf_inno_hdmi *stf_hdmi; > + struct inno_hdmi *hdmi; > + struct resource *iores; > + > + int ret; > + unsigned long long rate; > + > + stf_hdmi = drmm_simple_encoder_alloc(drm, struct stf_inno_hdmi, > + encoder, DRM_MODE_ENCODER_TMDS); > + hdmi = &stf_hdmi->inno_hdmi; > + > + hdmi->dev = dev; > + hdmi->plat_data = (struct inno_hdmi_plat_data *)of_device_get_match_data(dev); > + > + iores = platform_get_resource(pdev, IORESOURCE_MEM, 0); > + hdmi->regs = devm_ioremap_resource(dev, iores); There's a helper combining these two. > + if (IS_ERR(hdmi->regs)) > + return PTR_ERR(hdmi->regs); > + > + ret = starfive_hdmi_get_clk_rst(dev, stf_hdmi); > + if (ret < 0) > + return ret; > + > + ret = starfive_hdmi_enable_clk_rst(dev, stf_hdmi); > + if (ret) > + return ret; > + > + rate = clk_get_rate(stf_hdmi->clk_hdmi[CLK_SYS].clk); > + inno_hdmi_i2c_init(hdmi, rate); > + > + ret = inno_hdmi_bind(drm, hdmi, &stf_hdmi->encoder); > + if (ret) > + goto err_disable_clk; > + > + dev_set_drvdata(dev, stf_hdmi); > + > + return 0; > + Best regards, Krzysztof