From nobody Fri Dec 19 06:34:31 2025 Received: from mail-lf1-f54.google.com (mail-lf1-f54.google.com [209.85.167.54]) (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 AF7C718C31 for ; Sun, 9 Feb 2025 05:06:50 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.167.54 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1739077612; cv=none; b=dqewSCf61VVnm0aaoQRkCyc5XZGjFOXR/u91VcsCCEQmxVvNJyZ6rL0FjbGWrRMjD3OSoErS977iBw67cYdvu0PN5bcDr2WDfY37KuDL8LBT4qjSOIDoYlMjcmul62B5OBfajGj6J/4lYF7BZuXFUB08jmpo1JrN5H4aVPvTb68= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1739077612; c=relaxed/simple; bh=BXA7Q9IpU3LJo5o0YQp3oC/xe/tm2VyAy8ivKO92PBQ=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=hgH6QrwRkNgfmKjByjQKdUjwb4lgpqmVdqkqlMQ0RUVPpXPKMEYM7tZNCF2gfrFH7n/mXXr0s4xKxcGIlns8QOrwCd1+X0pCuT896jV22WJPYxovGiXd2bVaekylLRjgOm2zW8C+fNzw5y9uGLY3Qd6MVIz7yBMg3KrFnMmmuJs= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org; spf=pass smtp.mailfrom=linaro.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b=aSYylMB/; arc=none smtp.client-ip=209.85.167.54 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linaro.org Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="aSYylMB/" Received: by mail-lf1-f54.google.com with SMTP id 2adb3069b0e04-5450b91da41so31570e87.3 for ; Sat, 08 Feb 2025 21:06:50 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1739077609; x=1739682409; darn=vger.kernel.org; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:from:to:cc:subject:date:message-id :reply-to; bh=yj0BuWh1hjkMiCnQtqM7MPhpgvXgx80zo8kYUYLklb8=; b=aSYylMB/ayzXdDs5w1kWFx8Egop05cq1dPpL03zCKNGZishvNUzHx8NKlk2If3fOTM JmoEVnJFDYClCD7pYWo9rbmJYEezaJ989ZqqxUA9RUl1V4WRXEFF8aYwjUDM1iTdK57R 3mSqJI6cHO9T1RIcoMUvUzWlPsghJGEa17SyKX4U3mxsk+40XQqD6+UeZPK23oyiOpbr PPF7AYbpnoz7UpnIP5pxLegLYjHxfk0deTydLjb4DvnwjggGVdgFW0Vf1sBPXXvVhZk3 GIbMqhgxwEtzWbnCssvReM+WNx7iNS9+ny06qK+5xFZ3b05u5QYd4Wq1WEG4ozDSm6uX sAPg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1739077609; x=1739682409; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=yj0BuWh1hjkMiCnQtqM7MPhpgvXgx80zo8kYUYLklb8=; b=KFdjHE60j4Dcep9iGDWHtMEq8NZuLyjXZ3dZJB7GUniiDTTlMCvgDQk+cE5u6BeDB5 wiKNFY2b+T+d8BYAsGiz/9I6IplObQ0cOhRtpUdNBDz5kOLSNIbM5A89IPHeVo2zPFiY e72jqnxECJWdMzZHUpMHUH6u2IWHXMtACR15q6P2vaRFwbe9yh3uforqizSz8Yf4T7iw aXfIUzBHzsYf0aIKjf0NVRjP1EO/ScrZHL4KcDxigSiRtx7BVrKQCe+A60wth9L5wVtG juOyIHL7Z3JVUGLu4DkFheIx3upg6znU3qORcktcwZFYjYu8qoceT6BqVnImRzR6yLCF NhAQ== X-Forwarded-Encrypted: i=1; AJvYcCWRKs4r8lstKUoaoIFo46JLjKO6fAFKM4vhMgh1hN8ZVYv67YSgTiHmoGCQQV3OeC/KIpC54Hlys4/lTjA=@vger.kernel.org X-Gm-Message-State: AOJu0YwReZ0c6cB3Yj6WOBciKc0AIEXDdKkZQ7cCpKSxu3q60SADxmTR X5s/FgEfazcvzZs8lVlo5W8p8c+h1qpH1mE/DKdu4JZbv6Vl0m6U37O6TLgubbY= X-Gm-Gg: ASbGncu9J5oN2kQjs/n7JiW0q6+aastzsLNKvlYvXB1VNHaJ8JqbJNL/LhbvH9/9Hwk mKfJ00IG0w1kIVTD7cTByQGpCHrPbty6TDxsXfFUhfb+AEfyw5zga0S3vfpwY7OBWSqTlauQuaL x+8lradrtxmc/pvH5D2nI62k22RFtBOYuvY0BFh+hsZuCi/0rJptgpQzsaH6OsnqbzxfTzZQe3z BXHDG0EQqsIUK5LVQS28EUfFgzoTcKuPNJalXKGmUvt3uiBAHjtBbfPZaemVd8I5pYEhYfxj62I upy7oT+gwFh3YTi0uxoDIiA= X-Google-Smtp-Source: AGHT+IHlnIFRUHNy4Pv8cos18vLNYdATiWlvlgAGSIQwUUTZUpNqTfhFg+S88Fft5a+ZKQPZyT7Z3g== X-Received: by 2002:a05:6512:2384:b0:53e:23ec:b2e7 with SMTP id 2adb3069b0e04-54414adfaebmr3141413e87.34.1739077608720; Sat, 08 Feb 2025 21:06:48 -0800 (PST) Received: from umbar.lan ([192.130.178.90]) by smtp.gmail.com with ESMTPSA id 2adb3069b0e04-54506ef1733sm245576e87.1.2025.02.08.21.06.46 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 08 Feb 2025 21:06:47 -0800 (PST) From: Dmitry Baryshkov Date: Sun, 09 Feb 2025 07:04:45 +0200 Subject: [PATCH v4 01/16] dt-bindings: display/msm/hdmi: drop obsolete GPIOs from schema Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Message-Id: <20250209-fd-hdmi-hpd-v4-1-6224568ed87f@linaro.org> References: <20250209-fd-hdmi-hpd-v4-0-6224568ed87f@linaro.org> In-Reply-To: <20250209-fd-hdmi-hpd-v4-0-6224568ed87f@linaro.org> To: Rob Clark , Abhinav Kumar , Sean Paul , Marijn Suijten , David Airlie , Simona Vetter , Maarten Lankhorst , Maxime Ripard , Thomas Zimmermann , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Bjorn Andersson , Konrad Dybcio , Simona Vetter Cc: linux-arm-msm@vger.kernel.org, dri-devel@lists.freedesktop.org, freedreno@lists.freedesktop.org, linux-kernel@vger.kernel.org, devicetree@vger.kernel.org X-Mailer: b4 0.14.2 X-Developer-Signature: v=1; a=openpgp-sha256; l=1225; i=dmitry.baryshkov@linaro.org; h=from:subject:message-id; bh=BXA7Q9IpU3LJo5o0YQp3oC/xe/tm2VyAy8ivKO92PBQ=; b=owEBbQGS/pANAwAKAYs8ij4CKSjVAcsmYgBnqDfhD1AdF8cdaEFbZcUVUS48D8BueW7S4NJjP m99fsTsa8mJATMEAAEKAB0WIQRMcISVXLJjVvC4lX+LPIo+Aiko1QUCZ6g34QAKCRCLPIo+Aiko 1UjqB/9FEXBtULbRjjbPI2zjBtvnostnj5+h5M5uFG+qcq1zFtALCl0x1N5gtOoekLyqo4wWRO8 pm+HZ10170lI47GVEPlWbenUymsUQLGvEXx62AaHWZOLQ+peYt3EPJyrGaCRAk+ck635Ewh6olI erz99ab2bo/ggk2quQvQ4jzbw2cCWnm+HxsPjvxw38guV+w1YmqU8jGXfOmn7PgnM235jR/PiEs AydsPxkkK6SYICEpdFWJl2RcHmBqxCAtETjF6I+U3SPBT5NvEm8HeZeXNr2DeLp4fQlYlWSlAii rC2DEgtxa7xXBPhqjINBQTnuKu9LthaXvCgHcbl7D5+CBhzE X-Developer-Key: i=dmitry.baryshkov@linaro.org; a=openpgp; fpr=8F88381DD5C873E4AE487DA5199BF1243632046A The commit 68e674b13b17 ("drm/msm/hdmi: drop unused GPIO support") dropped support for obsolete qcom,hdmi-tx-mux-* gpios. They were not used by any of the upstream platforms. Drop them from the bindings too. Signed-off-by: Dmitry Baryshkov Reviewed-by: Krzysztof Kozlowski --- Documentation/devicetree/bindings/display/msm/hdmi.yaml | 15 -------------= -- 1 file changed, 15 deletions(-) diff --git a/Documentation/devicetree/bindings/display/msm/hdmi.yaml b/Docu= mentation/devicetree/bindings/display/msm/hdmi.yaml index d4a2033afea8d4e4f83c9859f8840d30ae9d53f8..7e6f776a047a00851e3e1e27fec= 3dabeed5242fd 100644 --- a/Documentation/devicetree/bindings/display/msm/hdmi.yaml +++ b/Documentation/devicetree/bindings/display/msm/hdmi.yaml @@ -66,21 +66,6 @@ properties: maxItems: 1 description: hpd pin =20 - qcom,hdmi-tx-mux-en-gpios: - maxItems: 1 - deprecated: true - description: HDMI mux enable pin - - qcom,hdmi-tx-mux-sel-gpios: - maxItems: 1 - deprecated: true - description: HDMI mux select pin - - qcom,hdmi-tx-mux-lpm-gpios: - maxItems: 1 - deprecated: true - description: HDMI mux lpm pin - '#sound-dai-cells': const: 1 =20 --=20 2.39.5 From nobody Fri Dec 19 06:34:31 2025 Received: from mail-lf1-f52.google.com (mail-lf1-f52.google.com [209.85.167.52]) (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 3C80D12CDA5 for ; Sun, 9 Feb 2025 05:06:51 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.167.52 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1739077615; cv=none; b=PkLS1Z6dcJCQp9hM7FqweuOPcN0WGZzo+0EKvCZZqnLPiWuoHT+cDXeK/2+xZRNb6VKCaDeP/cET+HVduv7c31vZncqnaZrBnqYNwgYBgZTv98asX94gWosXoSDJXn2XnOibPQdosVP3ik6cjlvCCftjl5KQQpLyHfMuZYwMmEY= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1739077615; c=relaxed/simple; bh=NLSCP5E6ORI9H0QuM74oVHUl+a0F/vNbAQWYghqkTiw=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=o0Cl8d5OtFyGWbID3Itc5k09IUgweyjmoHgHND7B0jCFKBIPWUYNZVaxJBTy+0aElA4pYLE4PvlLLr6KTuIifHeyPjncg71s/YQxiTxmeYlHSPlK0E5TiAH8ro1zOQ2Gz0DnIj83OQLPJL5rr/CAuuNk1Muzp9w7GISFvnkg9rI= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org; spf=pass smtp.mailfrom=linaro.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b=w0JhIudh; arc=none smtp.client-ip=209.85.167.52 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linaro.org Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="w0JhIudh" Received: by mail-lf1-f52.google.com with SMTP id 2adb3069b0e04-5450b91da41so31585e87.3 for ; Sat, 08 Feb 2025 21:06:51 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1739077610; x=1739682410; darn=vger.kernel.org; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:from:to:cc:subject:date:message-id :reply-to; bh=nTcdagHfVvJWdpzLDW5hzkEO6YN/7LPqkZiqmOtMZH8=; b=w0JhIudhmULBLKKGr9xFhxltuB1kZTIrqTvMYfwXDtrJzcik+WPA92TTLCiS+vqb9X XMXuD4riEbLT/EH/ZsdydrhH+uFmKx8mKomxyIfAZOhGdqb7pQ91YhlO0FjeXvl9tBri PlwfUXILGrEkNsAAdvBTZEPxtMU1PDgyq8cB1Aabh8GpkvKzCQgfV483qymlVL4Vn5a1 DRSFX72FpMl+Cb3CaDOInb6NNy3d8DrC6efHt3bopcVRQ1w+BpOlBy2tG8wmRYVC5gME NDADXqCpd+6QeULYQfrhT+e4W7fPrRIBcWWqZdK2hrW0WT5AXHXlAzd0xjb3AAnOm6dD icNw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1739077610; x=1739682410; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=nTcdagHfVvJWdpzLDW5hzkEO6YN/7LPqkZiqmOtMZH8=; b=ow+14tii+YcHyZhMsXX5IyQoKz58QB0zAoxGwwedEc2ajx+nVFZIdi3mUbPuz4gQr6 gymT64eaYBQYOSItKwn9tZ6X1nR1DQnjfy37R/CLucJMNJP12Z7/NfaZQHltUSvdMx7o uzWlHUEmkcd+KSKyS3wJOE+bq5peAYOOcRjQ2Sx0HfvtWBNdJpAmJ2SRBBysG2LPOOrP dlh+FUeuC5HmO343iDdbNU7N6JY/a58YlwvfjfB2WbmBJrp2w9o/ecJ2lAbHR75rI+j/ iy8zjAW8gj09eMne5K4SWnGyuDNoYgoAEhiJ/qBdZJzUmwSnolnrntFK7PvdLc+HfOyn lUYQ== X-Forwarded-Encrypted: i=1; AJvYcCVBLfxRjBRk7kkKIE+5url3LrqeV9dMDhF/23RgzMaGjD0/c6l7IFj93qvH/ogqLTcMd4JX2FYF8hIcbP4=@vger.kernel.org X-Gm-Message-State: AOJu0YxHp4zsI7O/wWsjqQDdnvm0aE9C7D+8FtC7RJp42P4HEo4RfRhl lFJKzOia81rcZeYUrvtiIHxPaYMYAxOq0Ei+dCyWD6PE+ZmahN5KfAVlph2uo3w= X-Gm-Gg: ASbGncsti1BxjWMAGweNw/WQ/E11CIJnG/Ygw4o2DRnilPGb5XjsI8WtglYEsEKMhhy HklqOE0TDWB86+1xaf2qhB/FWNLX39fD8wepXomo9/C6a7+HBzgd15WMUFrdv1j9QymVE+gxRLJ 9gBNd+nqd7jdeYIc6Awl2T9BjDwIQRqB1qafkSB69hWD8F8zjZ2V5WAwjQvIHNYgoDNQ5aFsxlg cmaLHSDA/9mB8aImw9ufRHW1iSip3tqS8tzUDTIp3KXdvfWOoj/t2tpIbfKToH+WPJHLMFXPIn6 C4n2X7FZ7QzcBqexwMT3Q/M= X-Google-Smtp-Source: AGHT+IEFXe5K8k+ix/TTKVKq9EFeSW9km/qit2DCh/DLsirowioK0KDRuuwtMc/zx6EiGq/Gs8hrxA== X-Received: by 2002:a05:6512:2205:b0:545:576:cbd2 with SMTP id 2adb3069b0e04-54507bfa112mr584003e87.10.1739077610224; Sat, 08 Feb 2025 21:06:50 -0800 (PST) Received: from umbar.lan ([192.130.178.90]) by smtp.gmail.com with ESMTPSA id 2adb3069b0e04-54506ef1733sm245576e87.1.2025.02.08.21.06.48 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 08 Feb 2025 21:06:49 -0800 (PST) From: Dmitry Baryshkov Date: Sun, 09 Feb 2025 07:04:46 +0200 Subject: [PATCH v4 02/16] dt-bindings: display/msm: hdmi: drop hpd-gpios Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Message-Id: <20250209-fd-hdmi-hpd-v4-2-6224568ed87f@linaro.org> References: <20250209-fd-hdmi-hpd-v4-0-6224568ed87f@linaro.org> In-Reply-To: <20250209-fd-hdmi-hpd-v4-0-6224568ed87f@linaro.org> To: Rob Clark , Abhinav Kumar , Sean Paul , Marijn Suijten , David Airlie , Simona Vetter , Maarten Lankhorst , Maxime Ripard , Thomas Zimmermann , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Bjorn Andersson , Konrad Dybcio , Simona Vetter Cc: linux-arm-msm@vger.kernel.org, dri-devel@lists.freedesktop.org, freedreno@lists.freedesktop.org, linux-kernel@vger.kernel.org, devicetree@vger.kernel.org X-Mailer: b4 0.14.2 X-Developer-Signature: v=1; a=openpgp-sha256; l=1438; i=dmitry.baryshkov@linaro.org; h=from:subject:message-id; bh=NLSCP5E6ORI9H0QuM74oVHUl+a0F/vNbAQWYghqkTiw=; b=owEBbQGS/pANAwAKAYs8ij4CKSjVAcsmYgBnqDfhYclpOw8R2du6T24MrpOm7QjiPhE/g7GXP i/M4vlXimmJATMEAAEKAB0WIQRMcISVXLJjVvC4lX+LPIo+Aiko1QUCZ6g34QAKCRCLPIo+Aiko 1bNlCACw8jnIu5ritWEfsFqRqlft4maCais+D8f7xJZLStAU3zaKpA81oDi+4en7jDRNdsZKwTR gggCP29ILVZoZGLRsfYrFUbdVnSjGejPVwCyXS/x4+tby9pkAeheeDOhHxx3F1+XL4FWqUv2sdR RS/kMmNkTQI//eK08wp5ld2x+RDs66f/J21yrExwXeahWL9KacJuD1P1PRPUTIQCzsNw834YPny exHq0VzE1nH4db6YwrCrf4+h1hoz2IIXXh2LAIjesZE1cT2n426Kv5wR96kCUi0Ovzz++zkiiGR uwA7gar7slMJunZwgXtK5+AflEVpxjcM8yBfnXpM4OSqNowq X-Developer-Key: i=dmitry.baryshkov@linaro.org; a=openpgp; fpr=8F88381DD5C873E4AE487DA5199BF1243632046A Supporting simultaneous check of native HPD and the external GPIO proved to be less stable than just native HPD. Drop the hpd-gpios from the bindings. This is not a breaking change, since the HDMI block has been using both GPIO _and_ internal HPD anyway. In case the native HPD doesn't work users are urged to switch to specifying the hpd-gpios property to the hdmi-connector device. Signed-off-by: Dmitry Baryshkov --- Documentation/devicetree/bindings/display/msm/hdmi.yaml | 5 ----- 1 file changed, 5 deletions(-) diff --git a/Documentation/devicetree/bindings/display/msm/hdmi.yaml b/Docu= mentation/devicetree/bindings/display/msm/hdmi.yaml index 7e6f776a047a00851e3e1e27fec3dabeed5242fd..a5ff7045a14be3b8106b3edf003= 3a8028a684529 100644 --- a/Documentation/devicetree/bindings/display/msm/hdmi.yaml +++ b/Documentation/devicetree/bindings/display/msm/hdmi.yaml @@ -62,10 +62,6 @@ properties: core-vcc-supply: description: phandle to VCC supply regulator =20 - hpd-gpios: - maxItems: 1 - description: hpd pin - '#sound-dai-cells': const: 1 =20 @@ -178,7 +174,6 @@ examples: clocks =3D <&clk 61>, <&clk 72>, <&clk 98>; - hpd-gpios =3D <&msmgpio 72 GPIO_ACTIVE_HIGH>; core-vdda-supply =3D <&pm8921_hdmi_mvs>; hdmi-mux-supply =3D <&ext_3p3v>; pinctrl-names =3D "default", "sleep"; --=20 2.39.5 From nobody Fri Dec 19 06:34:31 2025 Received: from mail-lf1-f48.google.com (mail-lf1-f48.google.com [209.85.167.48]) (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 762F513DDB9 for ; Sun, 9 Feb 2025 05:06:54 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.167.48 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1739077616; cv=none; b=KFun67ZOlOIChsLSUCyY6WjU4uXLCO+tUJgBWdq9qnaOGCgfPS7r9jLrBjiVh8b/vyTN4FKuol+WMvgsTmODhbXemAB0+eeLmMKySAElqT9+udspngymB6+Qwt5WCcJSZ9tKZeZzDJoHqBVpKDdhESXo1tWYbk32w6uGSm5CbRI= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1739077616; c=relaxed/simple; bh=V2+u0bC4oPjC0u3tfxjS0BIJRTLcQO+x+kAXxGzeCl4=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=hoix5hZipCFS+/Dn6VW98IgZ5ZXBc6xB2czo74sgY6RJNRpGhQO8HdXs+pUVv5DKJS3FMHx1pl6DY1uunP74abmzF55JAZ8Bx2+N4cEvzqpdclzKTxXsjoyvd/l2atGGsWvoptnM0/ULKngu8Mrv1d2BMwQrbW5JQ55E6+a72Uo= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org; spf=pass smtp.mailfrom=linaro.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b=gELAjhaZ; arc=none smtp.client-ip=209.85.167.48 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linaro.org Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="gELAjhaZ" Received: by mail-lf1-f48.google.com with SMTP id 2adb3069b0e04-54505191cdcso894721e87.2 for ; Sat, 08 Feb 2025 21:06:54 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1739077613; x=1739682413; darn=vger.kernel.org; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:from:to:cc:subject:date:message-id :reply-to; bh=B1i3ljPbx6n5V5EZfIVWiBHAB9nww5tkVOh9CuEMj1M=; b=gELAjhaZ2YiKFSkDHFiEjeLvW9eXDJ1KGvZbbbEc/X7osJxkhKtAXTKYKwnzIE39y7 VA5wiKSGuhch+CFYn0hFVAsv75zGYoPo/vkadj6eW6JvenizcGMTNeOeo/tomFiFrhea 5NLAKbL11tYoZ8aAg7omNKgAO2TSafSaMcnFOEuXjPcMj0FM7J40qhbZhL2nY2Ug31og CCXVNA0QbkVLDMcRsQBTQqUMP+KcNdLtSCgx7QFKVGdPXtwMDNg0iLCjPml/+rIG7535 RZKr6/DFeIdM0RGbQgfxR6D5yyhRKhZ2DGS5iwASsKvW2zsY2UaFrQ9lwhj/K0nJdVAm BE5w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1739077613; x=1739682413; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=B1i3ljPbx6n5V5EZfIVWiBHAB9nww5tkVOh9CuEMj1M=; b=Y8YocwhirNc1VvFONeZqRZr4UfhtC8qTk4gzOpkbjCRUxC81EBd6rGx1+aL+uCrMf5 tjKBtWSaJNNYfAmAw1901QQStKjASkqJHF79+51NzxUpzX4dK5O5SH2lRReGL5Rhx1B8 50WZKkoM5TQZiUH0HQ1Yl9duacByNCd9TNCegwsYeT/hw5vYuBwzP2dRg+xbkAN/KC1J wolsBbpXFUAiSI/59ojlXzntFA9+8/M0dQb/Bi1Sf6ihv/HrKnL5VH4gnnI2qaBiwuhQ dxVdfHNdImHGaQU6HmEN9AhO0ym52SPVu+WyxvfwEgHnHgVSiZBSgNMGiXbjapVhbsax WWGw== X-Forwarded-Encrypted: i=1; AJvYcCUCiGjAnV17YoK/Cnf/L/Gt9H6rBxWobNjni8uf8RTmE/c5Ti3k5vK3wQPHz1eSYzqoiSWyiIwgtgYhYLo=@vger.kernel.org X-Gm-Message-State: AOJu0YydhXotrPbbVitNp0lax/XkobHnLo4bGLovjrts5SYxGXL4YGOD Ux4KtUCNg7akg/su3F7jGnglLRRMAppP4PukbdJWGGTg+Bj9/AvhFz7Q5gmULHE= X-Gm-Gg: ASbGnctRsozHW1HXMbb7+ZQd4qroqJnSwKv+6mkgfCDIm0ta1oE84da5Y8/nsxdrS8M rB4HvvxxME2xSkjAMr1333bPhF40u4SUk8gnOuUyHW6HcYUW2xjcb0vsq2npbZ3AU3UOkMZe5Gc LsvNyNTfskWNAD7Bmytcyzf0uqe6ksmM6cE5jbgiIxiXyuTGJeY1gOmaMusXbeOeCS6govQaAI7 9kbMJg+G1E9Ltn57sFr5rDIa31rT9T6szd6FhAKvz61peZhcQZpsOQ4WUbEDZJtg/C0hTgB6nYN D8KDV8yJ082t7DvsXCqoO2E= X-Google-Smtp-Source: AGHT+IHhrPXiDJCWG6hpdLlaVYwDxoqtPiYGeBTQzAk5uMXShtQkmyqWTzBa2iy7/Jghy3XHQJdKLg== X-Received: by 2002:a05:6512:6c6:b0:545:a2a:589 with SMTP id 2adb3069b0e04-5450a2a07f5mr166047e87.52.1739077612585; Sat, 08 Feb 2025 21:06:52 -0800 (PST) Received: from umbar.lan ([192.130.178.90]) by smtp.gmail.com with ESMTPSA id 2adb3069b0e04-54506ef1733sm245576e87.1.2025.02.08.21.06.50 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 08 Feb 2025 21:06:51 -0800 (PST) From: Dmitry Baryshkov Date: Sun, 09 Feb 2025 07:04:47 +0200 Subject: [PATCH v4 03/16] drm/msm/hdmi: convert clock and regulator arrays to const arrays Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Message-Id: <20250209-fd-hdmi-hpd-v4-3-6224568ed87f@linaro.org> References: <20250209-fd-hdmi-hpd-v4-0-6224568ed87f@linaro.org> In-Reply-To: <20250209-fd-hdmi-hpd-v4-0-6224568ed87f@linaro.org> To: Rob Clark , Abhinav Kumar , Sean Paul , Marijn Suijten , David Airlie , Simona Vetter , Maarten Lankhorst , Maxime Ripard , Thomas Zimmermann , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Bjorn Andersson , Konrad Dybcio , Simona Vetter Cc: linux-arm-msm@vger.kernel.org, dri-devel@lists.freedesktop.org, freedreno@lists.freedesktop.org, linux-kernel@vger.kernel.org, devicetree@vger.kernel.org X-Mailer: b4 0.14.2 X-Developer-Signature: v=1; a=openpgp-sha256; l=2818; i=dmitry.baryshkov@linaro.org; h=from:subject:message-id; bh=V2+u0bC4oPjC0u3tfxjS0BIJRTLcQO+x+kAXxGzeCl4=; b=owEBbQGS/pANAwAKAYs8ij4CKSjVAcsmYgBnqDfh2U+hzoadQ+a4byMFO75tIEaeUu43yMPSa iC0d4FmLmCJATMEAAEKAB0WIQRMcISVXLJjVvC4lX+LPIo+Aiko1QUCZ6g34QAKCRCLPIo+Aiko 1T1FB/9pRpx/pOBOFh/T4LCyxNxh51SDyyHMf7w5RwtVQUYYvUl6RPPtKbYZX6F7YFIczn7O7M3 1gfOvnRH65inkTaEF2DZBWuCJipdG1GEYIWjC88ltJxAm99olN1LBL7YLMiJzWzhDG8j4cNGDS/ 127blgDqZ452VTRN+ZtNGgTaRGermUVSGfSpF2solm3/zCP8DsgEIGbke6BpZQAE2Gm2VWOYPlS /atMVixdLSgxMBdaayyA9p1ngVbm2hYara+DNebVlfi5L+RDAoBsRKWgydKADOnz/hmZDtW52EC WDo18zCKmEjFb8BKbS/IpcYJMxaCpqA9nUlKPpj4e7vV3SCP X-Developer-Key: i=dmitry.baryshkov@linaro.org; a=openpgp; fpr=8F88381DD5C873E4AE487DA5199BF1243632046A As a preparation to the next patches convert 'static const char *' arrays to 'static const char * const', as required by the checkpatch.pl Signed-off-by: Dmitry Baryshkov Reviewed-by: Jessica Zhang --- drivers/gpu/drm/msm/hdmi/hdmi.c | 10 +++++----- drivers/gpu/drm/msm/hdmi/hdmi.h | 8 ++++---- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/drivers/gpu/drm/msm/hdmi/hdmi.c b/drivers/gpu/drm/msm/hdmi/hdm= i.c index 248541ff449204c72cd444458dadb9ae4a0a53d1..9e9900882687fa2ae4a734d5cf1= 0b5bae5af2f87 100644 --- a/drivers/gpu/drm/msm/hdmi/hdmi.c +++ b/drivers/gpu/drm/msm/hdmi/hdmi.c @@ -224,17 +224,17 @@ int msm_hdmi_modeset_init(struct hdmi *hdmi, .item ## _names =3D item ##_names_ ## entry, \ .item ## _cnt =3D ARRAY_SIZE(item ## _names_ ## entry) =20 -static const char *hpd_reg_names_8960[] =3D {"core-vdda"}; -static const char *hpd_clk_names_8960[] =3D {"core", "master_iface", "slav= e_iface"}; +static const char * const hpd_reg_names_8960[] =3D {"core-vdda"}; +static const char * const hpd_clk_names_8960[] =3D {"core", "master_iface"= , "slave_iface"}; =20 static const struct hdmi_platform_config hdmi_tx_8960_config =3D { HDMI_CFG(hpd_reg, 8960), HDMI_CFG(hpd_clk, 8960), }; =20 -static const char *pwr_reg_names_8x74[] =3D {"core-vdda", "core-vcc"}; -static const char *pwr_clk_names_8x74[] =3D {"extp", "alt_iface"}; -static const char *hpd_clk_names_8x74[] =3D {"iface", "core", "mdp_core"}; +static const char * const pwr_reg_names_8x74[] =3D {"core-vdda", "core-vcc= "}; +static const char * const pwr_clk_names_8x74[] =3D {"extp", "alt_iface"}; +static const char * const hpd_clk_names_8x74[] =3D {"iface", "core", "mdp_= core"}; static unsigned long hpd_clk_freq_8x74[] =3D {0, 19200000, 0}; =20 static const struct hdmi_platform_config hdmi_tx_8974_config =3D { diff --git a/drivers/gpu/drm/msm/hdmi/hdmi.h b/drivers/gpu/drm/msm/hdmi/hdm= i.h index a5f481c39277631b7a19d294b086d6208be26511..381f957b34305494cb4da0b7dcc= b73b6ac3a1377 100644 --- a/drivers/gpu/drm/msm/hdmi/hdmi.h +++ b/drivers/gpu/drm/msm/hdmi/hdmi.h @@ -84,20 +84,20 @@ struct hdmi { /* platform config data (ie. from DT, or pdata) */ struct hdmi_platform_config { /* regulators that need to be on for hpd: */ - const char **hpd_reg_names; + const char * const *hpd_reg_names; int hpd_reg_cnt; =20 /* regulators that need to be on for screen pwr: */ - const char **pwr_reg_names; + const char * const *pwr_reg_names; int pwr_reg_cnt; =20 /* clks that need to be on for hpd: */ - const char **hpd_clk_names; + const char * const *hpd_clk_names; const long unsigned *hpd_freq; int hpd_clk_cnt; =20 /* clks that need to be on for screen pwr (ie pixel clk): */ - const char **pwr_clk_names; + const char * const *pwr_clk_names; int pwr_clk_cnt; }; =20 --=20 2.39.5 From nobody Fri Dec 19 06:34:31 2025 Received: from mail-lf1-f53.google.com (mail-lf1-f53.google.com [209.85.167.53]) (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 D859B1487FE for ; Sun, 9 Feb 2025 05:06:56 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.167.53 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1739077618; cv=none; b=m+9RbzMRjybi2PE9xiPMzfQDFfmOBLc/uDwulWSeQdQWgtcE+kjeO+/h7FsV74fLQBm9VUAWeZUh/geK+JxxFjdLUVZk05PYYRwajqM8KNVF6pOR9DlsuHuRDwyef5qgaK8+X9z+oIBZRC4t1jugwBSuA4KsnzXbBMcyEC7YHMM= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1739077618; c=relaxed/simple; bh=OUSREmRh8249bUIyNnvM4Q8G4H+YLOauuOGWEq+Beno=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=rZPljdP2HAkcUi7HqD9rnd53lDJYY3wqGc/3sfQeipXptyM0aCHuby51uAgDSmb/KN/aAlGqzqr4rI25+PbETqc1X/JXXIDwcglbvZSdVydcaHzkHZqzVItz4HP1CXsdezYpmjEI8QsdDpEjhqJPid6YDIuq3iiXo6vd2al/LkY= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org; spf=pass smtp.mailfrom=linaro.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b=a9wAmLdl; arc=none smtp.client-ip=209.85.167.53 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linaro.org Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="a9wAmLdl" Received: by mail-lf1-f53.google.com with SMTP id 2adb3069b0e04-543e4bbcd86so3828012e87.1 for ; Sat, 08 Feb 2025 21:06:56 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1739077615; x=1739682415; darn=vger.kernel.org; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:from:to:cc:subject:date:message-id :reply-to; bh=1AAeD9frqy9MnpNfuI3r6PeuD8rDrjcizDGW4I0IbQs=; b=a9wAmLdlODoVf7ankI6NPYcgu2dYf4M/Ra2dhuwghfTNKSmzYhrYDEYJ5mj0IHycdJ /S+IWoFEXZyltu3WHC6bPF+PzGNRxTjr+fj74lTK808LrkT2kUrxUglV61zTmoQfrM8N sMA1sjwn0w3iLTpfQU5L7LodFVjz1M/w80NITnAZVIw9FSFh8UIDU+gvw1TeJKtTVWmo MABiee2mdnnvaXblVzdiz2Ey40HGQGX71thQYAWdki8/a5zZq5Vxpe0NYe7yxCwj8OCW W9gfBxTWlMiBOYS3moWkJDP97UCvdt83kfIPYHUfHIH+xUxC50CskSVs7myQgBlRqa/c ehmA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1739077615; x=1739682415; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=1AAeD9frqy9MnpNfuI3r6PeuD8rDrjcizDGW4I0IbQs=; b=DUqOQAuUvLc53nnDrOVcM7D1iHjOBRe8SxCC9VQXFFXOQtPkjJlKN2laF38+nMYNVo rAU8SxciIPiuP629K0/yvOWpuehGcLg3HqYi4qmxV/KV1U8g+0ioMNKJaj+Gli+BrxhR 59FYkgLtE7TScU8gXZY0iwX3RZs1wfvzeRdAoRasxlkjePPDNAA53H6orTbUSRmYJ7/i hqR6W5/a4cdMtnB6VKVbHNsfH84gMhKdOWRADx3GIsI6vwSclpLI1xloV1d+qLmm3VB4 jq1NKocKi7/Ya2waYW6Lb1AcaE2sXHoq8TxwLWhMw2B4bpNhVxlFil9xoAYY6ZgFUElB /7dA== X-Forwarded-Encrypted: i=1; AJvYcCXNHeQhEhNxJOBiTs5h5CPwaBXii+Hm2WXcdw0M9IeF7KzE0HNHASkhqJ9k26BhZZUpAP7daPMam5+8HC0=@vger.kernel.org X-Gm-Message-State: AOJu0YxiZmebCr5i68dQ7ZAAaSeXDdq8TqDbZJ61uPIR3TFiyhWk1Gpw Y7b7iozQlOcg/OBKyt/w0XtQHrazx+ynMQpaauwQjtMHIQuJzfcB/GgVcmjc3yk= X-Gm-Gg: ASbGncu5MZ7597P/Z8/6lSOkFkphk+ncA4NC0oxGxzWmVhX3tHLOrz9QILWi7T2bbd4 yxd552u7CmJtCZDznjvp9lbCj/HZttpqTFQiqi6AqxN3xlSoT0QGgFzJh7xHETU00ub9dxwnL2Q zcPrElJDWriYYQMXe0q7bYLL4wfUC+YGjHi6v7/EPPJz5VciOQD4OBF+OtT9m2PBk6YEglRl2sh yr2XXNh5ovQNHXwqxlvGoXvZYlg/F9ttvATSxznXYPUqDtvlkc8ymIFxWnbCmaGDoNO6PzjjwXD PjkdEmLG+54uz1whMpA6Rmw= X-Google-Smtp-Source: AGHT+IHoMxcCBB3/q2EUvXQ2y3klvPHcidMt7fEpaXFDlyTHpWqmGJ7+95RCxDEc3CZ4CHzL5p6Auw== X-Received: by 2002:ac2:4bc8:0:b0:545:a2f:22b4 with SMTP id 2adb3069b0e04-5450a2f235cmr130427e87.40.1739077615007; Sat, 08 Feb 2025 21:06:55 -0800 (PST) Received: from umbar.lan ([192.130.178.90]) by smtp.gmail.com with ESMTPSA id 2adb3069b0e04-54506ef1733sm245576e87.1.2025.02.08.21.06.52 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 08 Feb 2025 21:06:53 -0800 (PST) From: Dmitry Baryshkov Date: Sun, 09 Feb 2025 07:04:48 +0200 Subject: [PATCH v4 04/16] drm/msm/hdmi: move the alt_iface clock to the hpd list Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Message-Id: <20250209-fd-hdmi-hpd-v4-4-6224568ed87f@linaro.org> References: <20250209-fd-hdmi-hpd-v4-0-6224568ed87f@linaro.org> In-Reply-To: <20250209-fd-hdmi-hpd-v4-0-6224568ed87f@linaro.org> To: Rob Clark , Abhinav Kumar , Sean Paul , Marijn Suijten , David Airlie , Simona Vetter , Maarten Lankhorst , Maxime Ripard , Thomas Zimmermann , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Bjorn Andersson , Konrad Dybcio , Simona Vetter Cc: linux-arm-msm@vger.kernel.org, dri-devel@lists.freedesktop.org, freedreno@lists.freedesktop.org, linux-kernel@vger.kernel.org, devicetree@vger.kernel.org, Jessica Zhang , Konrad Dybcio X-Mailer: b4 0.14.2 X-Developer-Signature: v=1; a=openpgp-sha256; l=1513; i=dmitry.baryshkov@linaro.org; h=from:subject:message-id; bh=OUSREmRh8249bUIyNnvM4Q8G4H+YLOauuOGWEq+Beno=; b=owEBbQGS/pANAwAKAYs8ij4CKSjVAcsmYgBnqDfhWz/CrQ1d/HHvst2lncBwAPX4lxjbBGU1H wXo139WGVKJATMEAAEKAB0WIQRMcISVXLJjVvC4lX+LPIo+Aiko1QUCZ6g34QAKCRCLPIo+Aiko 1WjnCAChqMBfU9rKnaYHnLee7/bL11OLC8o/zUyr3P+zOgN+/97oXVe4pOVffirjbqRLHATL42F mp3/GOvvSMbiUCMFzWAJdIwnoo04JMqkxdtcRy36uAD9bbe9+CSr2hMFOHieDLRfXNWv5iDxKWm wmFhKpeNgShtGZBC8ZP4br6XUjWwzQIStzZjVME2C6843mvq++Ph++Sq7Nyhui5Bgk5CmQbyOVi fnGsteCUmKIG8klFqtxfqqxy7B06KDXRz4sdRNe0j5XAQsZHOt/ZNrNuYjSx2FztvJEx7qPZy6r nbWC+Z2TjZGdPzCgheIg8736D5bkF2IMNJMkkQwTTCHoCpL4 X-Developer-Key: i=dmitry.baryshkov@linaro.org; a=openpgp; fpr=8F88381DD5C873E4AE487DA5199BF1243632046A According to the vendor kernel [1] , the alt_iface clock should be enabled together with the rest of HPD clocks, to make HPD to work properly. [1] https://git.codelinaro.org/clo/la/kernel/msm-3.18/-/commit/e07a5487e521= e57f76083c0a6e2f995414ac6d03 Reviewed-by: Jessica Zhang Reviewed-by: Konrad Dybcio Signed-off-by: Dmitry Baryshkov --- drivers/gpu/drm/msm/hdmi/hdmi.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/gpu/drm/msm/hdmi/hdmi.c b/drivers/gpu/drm/msm/hdmi/hdm= i.c index 9e9900882687fa2ae4a734d5cf10b5bae5af2f87..ebf9d8162c6e5759a3780c74354= b6c159598750f 100644 --- a/drivers/gpu/drm/msm/hdmi/hdmi.c +++ b/drivers/gpu/drm/msm/hdmi/hdmi.c @@ -233,9 +233,9 @@ static const struct hdmi_platform_config hdmi_tx_8960_c= onfig =3D { }; =20 static const char * const pwr_reg_names_8x74[] =3D {"core-vdda", "core-vcc= "}; -static const char * const pwr_clk_names_8x74[] =3D {"extp", "alt_iface"}; -static const char * const hpd_clk_names_8x74[] =3D {"iface", "core", "mdp_= core"}; -static unsigned long hpd_clk_freq_8x74[] =3D {0, 19200000, 0}; +static const char * const pwr_clk_names_8x74[] =3D {"extp"}; +static const char * const hpd_clk_names_8x74[] =3D {"iface", "core", "mdp_= core", "alt_iface"}; +static unsigned long hpd_clk_freq_8x74[] =3D {0, 19200000, 0, 0}; =20 static const struct hdmi_platform_config hdmi_tx_8974_config =3D { HDMI_CFG(pwr_reg, 8x74), --=20 2.39.5 From nobody Fri Dec 19 06:34:31 2025 Received: from mail-lf1-f50.google.com (mail-lf1-f50.google.com [209.85.167.50]) (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 5FB9B14EC5B for ; Sun, 9 Feb 2025 05:06:59 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.167.50 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1739077621; cv=none; b=kbcMNYB90RQWlbNCKEI0hNF7RpVnGjnHPGn2ST4mifHvnMUZrJzPShZrznfNnmaGAvPu+61WuIvOB7mQ1KCV4m429papIe8+SgS6jbYSmu9lMZM9foGpydyqaTXTsyh6QgFkYKz2D+3atXlreRpC8j3L65qrnhS+8nq8EFBuGaM= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1739077621; c=relaxed/simple; bh=lyckA7kqwdCOpoWzdS9geiJQOjeKrHmmotNRUjdCT80=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=ZvhzR7//jPpxJSdgcSMfxNs9InwE5FVeNlVZ5pDHeHWgHteqcN6A5GlxCFpwMT1Snl1b6xHGmNk4oROexzPYXAH+iUhZrb0z9rmsvCFTvSUdQ5RDGIL/zd86TwB6b8zMB/ilAnLwQ0i69ihGSlsi4bFDUerXThTqGslG+QZAg54= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org; spf=pass smtp.mailfrom=linaro.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b=n5Yp1s2x; arc=none smtp.client-ip=209.85.167.50 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linaro.org Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="n5Yp1s2x" Received: by mail-lf1-f50.google.com with SMTP id 2adb3069b0e04-540215984f0so3541656e87.1 for ; Sat, 08 Feb 2025 21:06:59 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1739077617; x=1739682417; darn=vger.kernel.org; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:from:to:cc:subject:date:message-id :reply-to; bh=x7qjil7rgOn7oZkjNx8dve7sM36ikTyiP8M9F9/koAE=; b=n5Yp1s2xHrkovJ57xbCMrxu/XtTW+TZCOwKW3fkDqPQ+ohywNZBh6wJNEQX7OjIzj0 m2m1GgzBCe/+jbFqAkDCSoaK0YlwbfCJZYl033geksVCLz5V6vKkl+I9u90f+icd/uSx TsFegWyuyn+D41StXFDKCgStv+04R26jAQG2rf+MVjuzeW7UGzWuVecKBfeYwBEd0KgB Uf7LtQWoMxmI8pgHEPxe2wps7dlO6aARoRz9eoEqYCtyP27bEa8FMNRc8I2zVXULnF4P Z2sKDa38hbfE2hWr2YhWPlDBBXGzejL5HYaEmR8sxmiOGIG4b4ZizhPalTCqMg4H+gjc LBqw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1739077617; x=1739682417; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=x7qjil7rgOn7oZkjNx8dve7sM36ikTyiP8M9F9/koAE=; b=EzKVzlo5b0TZ4M/lPAgUDmSp25/nsgn2piUbrxDxe1zcToa7+mriOR64cfYhphNYOQ xS43kyKZn55fTjKmaX1yZxvIHJBglkKfqk+oJUCfcTsoL1R+oj0WFGkco9/3mAlCoGbp VZN0ygA4fgnBRthsTRCZmie9yBwNtfYS8T9iCeXsu+Jjg+qb9C28bZbtER4e3dB+Dam2 WvxR1rhzkpVb9J07UUI4upp6Ji/b2imNJ5SXmO0gen1rL1hRlWDocNgPl3lGgb7shQ4x DlKKTDRDPf8cCJ+6L17KiesIlk8jDMl9wXCfqakbmqQtbjeJ5uYTw2beyzXexpsk/uC8 of4g== X-Forwarded-Encrypted: i=1; AJvYcCXgyY9Te17M7+SsNBtIrRmeDsFscFRsJDC2zknHL7tthPuOU2+J7cY4Eb0h5heXcedu7vIuv/mURBcOsKI=@vger.kernel.org X-Gm-Message-State: AOJu0YzofVykl5TSvnJAre0OzBkiyjSW1fcRZGhzpigzwPiNQvbEOHrh 26Amxj9BCtkxne0vI4IuKYjjB7KON/lj5CIMbDDKeRFtyGBcq+XsaQnNnrZPWCU= X-Gm-Gg: ASbGnctKG0LM28AaJk/MhLCAka6XXunrDF2ZeHzYAtTQMAQ7P6Cf1SFcr03aCsxcARJ 4FFJWJ5MoIMWDlfZTS+dq5Lk7OiW5DH6GZEA1aoBUv9nKvb5rtT5308GG9DilxDaOkxQj5CPfpb VEg86FUrH2NQmbconRlosKwYZfVLtkM9rMrfPVJCXoio4fitUsaU+WInbcTxjEzJVlPHNCyArIr Kyad6S+0rZTnFru620OT1xLWwa739PEJk60Bf3tNEdbTvDXIMpBBESwyyxsCrLjBsxlTbgOHY7R jalfS3+zPM2b+MktnOll4eA= X-Google-Smtp-Source: AGHT+IEEPtccdcT7Ef99Ozj8sRrzPnEhuDX5DsEvKNMxHN8EYfEuGMpD8u3GrL9fY/zkbjdrM/Gavw== X-Received: by 2002:a05:6512:3ca8:b0:545:61b:c84b with SMTP id 2adb3069b0e04-545061bc89bmr1187558e87.32.1739077617449; Sat, 08 Feb 2025 21:06:57 -0800 (PST) Received: from umbar.lan ([192.130.178.90]) by smtp.gmail.com with ESMTPSA id 2adb3069b0e04-54506ef1733sm245576e87.1.2025.02.08.21.06.55 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 08 Feb 2025 21:06:56 -0800 (PST) From: Dmitry Baryshkov Date: Sun, 09 Feb 2025 07:04:49 +0200 Subject: [PATCH v4 05/16] drm/msm/hdmi: simplify extp clock handling Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Message-Id: <20250209-fd-hdmi-hpd-v4-5-6224568ed87f@linaro.org> References: <20250209-fd-hdmi-hpd-v4-0-6224568ed87f@linaro.org> In-Reply-To: <20250209-fd-hdmi-hpd-v4-0-6224568ed87f@linaro.org> To: Rob Clark , Abhinav Kumar , Sean Paul , Marijn Suijten , David Airlie , Simona Vetter , Maarten Lankhorst , Maxime Ripard , Thomas Zimmermann , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Bjorn Andersson , Konrad Dybcio , Simona Vetter Cc: linux-arm-msm@vger.kernel.org, dri-devel@lists.freedesktop.org, freedreno@lists.freedesktop.org, linux-kernel@vger.kernel.org, devicetree@vger.kernel.org, Jessica Zhang X-Mailer: b4 0.14.2 X-Developer-Signature: v=1; a=openpgp-sha256; l=6078; i=dmitry.baryshkov@linaro.org; h=from:subject:message-id; bh=lyckA7kqwdCOpoWzdS9geiJQOjeKrHmmotNRUjdCT80=; b=owEBbQGS/pANAwAKAYs8ij4CKSjVAcsmYgBnqDfizFk1uavvJWAFXSYAkhVRCeSV2smGIPdAS xifAYnKnS+JATMEAAEKAB0WIQRMcISVXLJjVvC4lX+LPIo+Aiko1QUCZ6g34gAKCRCLPIo+Aiko 1cQeCACZnTX0v4MU2UK606g1ONwoIjgtOtw2Ht6fyCis/KdSnzhP9NrZKnzvgJm7ZKC9eFbuYPi A7+aSFhNNE3RWmhPwrrKJHbUQXYwxA545Y5FcGjC4Mhz9OFoKrviim6zmyluduG9ZzQTfvcmC5x s1hzibUL1V+mzH/Pc7kV5q1cYjD8ZgQz3M9w2+Ubh8+BikGjJ+2vUYAaqCVNQicCfwtMA5BKprN BIB40PxkKAN2br08i+l/8REMhbhwupsTqJNyco2brXZgy/JYssUbb6NakX8MeHCns2ybGRjqfU3 /n/ny5R6jB1Ko2LHYGOV3uXC6fWgxotUJyqH1fJG+yat7rNV X-Developer-Key: i=dmitry.baryshkov@linaro.org; a=openpgp; fpr=8F88381DD5C873E4AE487DA5199BF1243632046A With the extp being the only "power" clock left, remove the surrounding loops and handle the extp clock directly. Reviewed-by: Jessica Zhang Signed-off-by: Dmitry Baryshkov --- drivers/gpu/drm/msm/hdmi/hdmi.c | 24 ++++-------------------- drivers/gpu/drm/msm/hdmi/hdmi.h | 6 +----- drivers/gpu/drm/msm/hdmi/hdmi_bridge.c | 33 +++++++++++++-----------------= --- 3 files changed, 18 insertions(+), 45 deletions(-) diff --git a/drivers/gpu/drm/msm/hdmi/hdmi.c b/drivers/gpu/drm/msm/hdmi/hdm= i.c index ebf9d8162c6e5759a3780c74354b6c159598750f..104f9cefa14834d04fb957eb487= 77e605d1e29a5 100644 --- a/drivers/gpu/drm/msm/hdmi/hdmi.c +++ b/drivers/gpu/drm/msm/hdmi/hdmi.c @@ -233,13 +233,11 @@ static const struct hdmi_platform_config hdmi_tx_8960= _config =3D { }; =20 static const char * const pwr_reg_names_8x74[] =3D {"core-vdda", "core-vcc= "}; -static const char * const pwr_clk_names_8x74[] =3D {"extp"}; static const char * const hpd_clk_names_8x74[] =3D {"iface", "core", "mdp_= core", "alt_iface"}; static unsigned long hpd_clk_freq_8x74[] =3D {0, 19200000, 0, 0}; =20 static const struct hdmi_platform_config hdmi_tx_8974_config =3D { HDMI_CFG(pwr_reg, 8x74), - HDMI_CFG(pwr_clk, 8x74), HDMI_CFG(hpd_clk, 8x74), .hpd_freq =3D hpd_clk_freq_8x74, }; @@ -369,24 +367,10 @@ static int msm_hdmi_dev_probe(struct platform_device = *pdev) hdmi->hpd_clks[i] =3D clk; } =20 - hdmi->pwr_clks =3D devm_kcalloc(&pdev->dev, - config->pwr_clk_cnt, - sizeof(hdmi->pwr_clks[0]), - GFP_KERNEL); - if (!hdmi->pwr_clks) - return -ENOMEM; - - for (i =3D 0; i < config->pwr_clk_cnt; i++) { - struct clk *clk; - - clk =3D msm_clk_get(pdev, config->pwr_clk_names[i]); - if (IS_ERR(clk)) - return dev_err_probe(dev, PTR_ERR(clk), - "failed to get pwr clk: %s\n", - config->pwr_clk_names[i]); - - hdmi->pwr_clks[i] =3D clk; - } + hdmi->extp_clk =3D devm_clk_get_optional(&pdev->dev, "extp"); + if (IS_ERR(hdmi->extp_clk)) + return dev_err_probe(dev, PTR_ERR(hdmi->extp_clk), + "failed to get extp clock\n"); =20 hdmi->hpd_gpiod =3D devm_gpiod_get_optional(&pdev->dev, "hpd", GPIOD_IN); /* This will catch e.g. -EPROBE_DEFER */ diff --git a/drivers/gpu/drm/msm/hdmi/hdmi.h b/drivers/gpu/drm/msm/hdmi/hdm= i.h index 381f957b34305494cb4da0b7dccb73b6ac3a1377..3314bb8a09d6bea7e34ad905097= 0bf43c64d1558 100644 --- a/drivers/gpu/drm/msm/hdmi/hdmi.h +++ b/drivers/gpu/drm/msm/hdmi/hdmi.h @@ -50,7 +50,7 @@ struct hdmi { struct regulator_bulk_data *hpd_regs; struct regulator_bulk_data *pwr_regs; struct clk **hpd_clks; - struct clk **pwr_clks; + struct clk *extp_clk; =20 struct gpio_desc *hpd_gpiod; =20 @@ -95,10 +95,6 @@ struct hdmi_platform_config { const char * const *hpd_clk_names; const long unsigned *hpd_freq; int hpd_clk_cnt; - - /* clks that need to be on for screen pwr (ie pixel clk): */ - const char * const *pwr_clk_names; - int pwr_clk_cnt; }; =20 struct hdmi_bridge { diff --git a/drivers/gpu/drm/msm/hdmi/hdmi_bridge.c b/drivers/gpu/drm/msm/h= dmi/hdmi_bridge.c index c6659e62594558b3c0c25de36aa8c459aa253834..6c5bbd772700b0362f884a73759= 8d7bf419adf9b 100644 --- a/drivers/gpu/drm/msm/hdmi/hdmi_bridge.c +++ b/drivers/gpu/drm/msm/hdmi/hdmi_bridge.c @@ -19,7 +19,7 @@ static void msm_hdmi_power_on(struct drm_bridge *bridge) struct hdmi_bridge *hdmi_bridge =3D to_hdmi_bridge(bridge); struct hdmi *hdmi =3D hdmi_bridge->hdmi; const struct hdmi_platform_config *config =3D hdmi->config; - int i, ret; + int ret; =20 pm_runtime_get_sync(&hdmi->pdev->dev); =20 @@ -27,21 +27,15 @@ static void msm_hdmi_power_on(struct drm_bridge *bridge) if (ret) DRM_DEV_ERROR(dev->dev, "failed to enable pwr regulator: %d\n", ret); =20 - if (config->pwr_clk_cnt > 0) { + if (hdmi->extp_clk) { DBG("pixclock: %lu", hdmi->pixclock); - ret =3D clk_set_rate(hdmi->pwr_clks[0], hdmi->pixclock); - if (ret) { - DRM_DEV_ERROR(dev->dev, "failed to set pixel clk: %s (%d)\n", - config->pwr_clk_names[0], ret); - } - } + ret =3D clk_set_rate(hdmi->extp_clk, hdmi->pixclock); + if (ret) + DRM_DEV_ERROR(dev->dev, "failed to set extp clk rate: %d\n", ret); =20 - for (i =3D 0; i < config->pwr_clk_cnt; i++) { - ret =3D clk_prepare_enable(hdmi->pwr_clks[i]); - if (ret) { - DRM_DEV_ERROR(dev->dev, "failed to enable pwr clk: %s (%d)\n", - config->pwr_clk_names[i], ret); - } + ret =3D clk_prepare_enable(hdmi->extp_clk); + if (ret) + DRM_DEV_ERROR(dev->dev, "failed to enable extp clk: %d\n", ret); } } =20 @@ -51,15 +45,15 @@ static void power_off(struct drm_bridge *bridge) struct hdmi_bridge *hdmi_bridge =3D to_hdmi_bridge(bridge); struct hdmi *hdmi =3D hdmi_bridge->hdmi; const struct hdmi_platform_config *config =3D hdmi->config; - int i, ret; + int ret; =20 /* TODO do we need to wait for final vblank somewhere before * cutting the clocks? */ mdelay(16 + 4); =20 - for (i =3D 0; i < config->pwr_clk_cnt; i++) - clk_disable_unprepare(hdmi->pwr_clks[i]); + if (hdmi->extp_clk) + clk_disable_unprepare(hdmi->extp_clk); =20 ret =3D regulator_bulk_disable(config->pwr_reg_cnt, hdmi->pwr_regs); if (ret) @@ -441,7 +435,6 @@ static enum drm_mode_status msm_hdmi_bridge_tmds_char_r= ate_valid(const struct dr { struct hdmi_bridge *hdmi_bridge =3D to_hdmi_bridge(bridge); struct hdmi *hdmi =3D hdmi_bridge->hdmi; - const struct hdmi_platform_config *config =3D hdmi->config; struct msm_drm_private *priv =3D bridge->dev->dev_private; struct msm_kms *kms =3D priv->kms; long actual; @@ -454,8 +447,8 @@ static enum drm_mode_status msm_hdmi_bridge_tmds_char_r= ate_valid(const struct dr actual =3D kms->funcs->round_pixclk(kms, tmds_rate, hdmi_bridge->hdmi->encoder); - else if (config->pwr_clk_cnt > 0) - actual =3D clk_round_rate(hdmi->pwr_clks[0], tmds_rate); + else if (hdmi->extp_clk) + actual =3D clk_round_rate(hdmi->extp_clk, tmds_rate); else actual =3D tmds_rate; =20 --=20 2.39.5 From nobody Fri Dec 19 06:34:31 2025 Received: from mail-lf1-f44.google.com (mail-lf1-f44.google.com [209.85.167.44]) (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 C8F90154BEA for ; Sun, 9 Feb 2025 05:07:01 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.167.44 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1739077623; cv=none; b=TCos7Fcre5G7uS9qCyhOOXoXZPKPhd4ANVQ5J0Di/KdWOLRCoXI734TfT6642ee2840xAH/aeAT1dOjey7HCqVKqDmeMlPGX7Kdq4EQbjUim13aJOYcZQ95cRjnzl8l0jDHvsD/EjGQ9VPzD1nE5GlU/LtwiKXbyLavFCuBNLCE= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1739077623; c=relaxed/simple; bh=WW4ls3rpXG1GIIqJFaRsd5YlkFmkvDhOcZwn0x64Row=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=X6ks03R0prmcE53hoamhsUhUCb9Lkt1Bvkp3L+sj8VYAM66BpkETc7MOB/EpnPGathD0eJ0aU9gugwVaVEB2aj3zvdRXJQf3GTuaBy7OuoeaabCRDLVkReFXmB8fJvDF/utmjFigymPNBt2OyCYJuj20qHViHx9RMyr+lJrPwM0= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org; spf=pass smtp.mailfrom=linaro.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b=nKLBodXZ; arc=none smtp.client-ip=209.85.167.44 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linaro.org Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="nKLBodXZ" Received: by mail-lf1-f44.google.com with SMTP id 2adb3069b0e04-54298ec925bso4174685e87.3 for ; Sat, 08 Feb 2025 21:07:01 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1739077620; x=1739682420; darn=vger.kernel.org; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:from:to:cc:subject:date:message-id :reply-to; bh=MgMGbXHWLKVnTij1NafnBiRAE4dpvWazdfcr2GGjsj0=; b=nKLBodXZIA9THby8zc+M2ajq8kuF1uR37VexjXeE5H1zK6rmOe49sg5Nv9oO3AoAdF xnRFWUBh45NVRzs42ULvqnxWTbQVJNFnG6f75xsHiCRG9zTKNDE1N1ysC5+udGBa+oyZ 7TTxVyhKGUHCJ48XmzMKqqnlUMNAIVZ0RDTije5vvNXMI2mD1neUeO0i9SuW7Wr1riGb CC/6nKDtvNXaLbjtB3UdYcdM7ROzNCpuFuvXe1ghfx4IVVlb3hFrUiRj3Iamd/fVjM97 RpDEK05THX3+tnnz1CKTVUpIG2A9gtfQkObECm5Yj5A1APnBsvau/XDcfvIl3Hc7DGTJ wtOg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1739077620; x=1739682420; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=MgMGbXHWLKVnTij1NafnBiRAE4dpvWazdfcr2GGjsj0=; b=nnB6y3HbDe+ggs0QZlF3oqts4afaj0Jt7U09t/K8JcmraWRTtyzuG+tabCZnLcfHVp N2Kf/kah9iXT8LBO74EweUxbzpI/IJcynS5d+3psssl1ITPYJKMX8vRIZVm6ZGlBh31t iGcQr5lGeKNI1/V9UxPhOwnI9O4T+cByf8NLEeS8UMsaiZ+IB4xYIYbxPqsfGdvsQI74 C8Nr0DoiyndgzXZUD+Uga5ID1F5vpDrraSijfhhMe4AItRgV/YA3kXhHguNy6svtBpcQ /gYDR8SQJrpNFyHnwmIu5pN0pPUcaVhYDNlhAlKXWYvy+6mKqrveSPv+ioUWUKt4XM/Q PDQA== X-Forwarded-Encrypted: i=1; AJvYcCXD/o83xQsKwGeOOi9k25VGkattqrs5yLKPWOG6UFGCvHD7Qbj/9036+yMKVVxzwLQ77wm9VpwK3R/xXgs=@vger.kernel.org X-Gm-Message-State: AOJu0Yz9wslcJuj1rafMz+f4PrCV2E8gTHYqfpzFxKnDJoB91+79DWed 50DwNJ+2xBGlm5fjxMG0EmOAXtM3rFfjixb5MZYrx/KeVfs9kDsdHM8ZawI6OwPOBQUAJkLW6RG Jh8g= X-Gm-Gg: ASbGncswSBXXujBjXfPJ29NweCPQkjjNlrLauiVZ6J5L4fnC1dPtrYTtoT0tCzyqq1u OmLsbnT0ZuK6ekMZWm1a0v+kXoRFYOtSXMMqV7+trbmvhiGGujbTBzht3KspZkWlZz/8wghiA7Q EVTGWDradqVNkLCWk327KfnMUA8zRnsPF+vSy6srJwzBLF5scwRdNZCtFX7P/cnoXNQ/Qps5CgF oSoqLmTsagO45SgL69Lm9fkWQozkdzO1GLGNuYHFBawgt1jHbzueqJCD34QPPy3VFqHLEsASBmY pLhVExKthh5Jr14Ib/U+rMM= X-Google-Smtp-Source: AGHT+IFx+DmPcZu3/NRsEkP+OG1M4uAJloebIpWaEr4zUGH3IBWnTxGpoo5HkK+ek1VL2il6g5ZnVg== X-Received: by 2002:a05:6512:ad5:b0:542:98e9:63a9 with SMTP id 2adb3069b0e04-54414b0b605mr2844776e87.44.1739077619881; Sat, 08 Feb 2025 21:06:59 -0800 (PST) Received: from umbar.lan ([192.130.178.90]) by smtp.gmail.com with ESMTPSA id 2adb3069b0e04-54506ef1733sm245576e87.1.2025.02.08.21.06.57 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 08 Feb 2025 21:06:58 -0800 (PST) From: Dmitry Baryshkov Date: Sun, 09 Feb 2025 07:04:50 +0200 Subject: [PATCH v4 06/16] drm/msm/hdmi: drop clock frequency assignment Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Message-Id: <20250209-fd-hdmi-hpd-v4-6-6224568ed87f@linaro.org> References: <20250209-fd-hdmi-hpd-v4-0-6224568ed87f@linaro.org> In-Reply-To: <20250209-fd-hdmi-hpd-v4-0-6224568ed87f@linaro.org> To: Rob Clark , Abhinav Kumar , Sean Paul , Marijn Suijten , David Airlie , Simona Vetter , Maarten Lankhorst , Maxime Ripard , Thomas Zimmermann , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Bjorn Andersson , Konrad Dybcio , Simona Vetter Cc: linux-arm-msm@vger.kernel.org, dri-devel@lists.freedesktop.org, freedreno@lists.freedesktop.org, linux-kernel@vger.kernel.org, devicetree@vger.kernel.org, Jessica Zhang X-Mailer: b4 0.14.2 X-Developer-Signature: v=1; a=openpgp-sha256; l=2616; i=dmitry.baryshkov@linaro.org; h=from:subject:message-id; bh=WW4ls3rpXG1GIIqJFaRsd5YlkFmkvDhOcZwn0x64Row=; b=owEBbQGS/pANAwAKAYs8ij4CKSjVAcsmYgBnqDfi33wWbfpM6mTVM/ftWIImACMnz11kBEOqC blNTd+M/5+JATMEAAEKAB0WIQRMcISVXLJjVvC4lX+LPIo+Aiko1QUCZ6g34gAKCRCLPIo+Aiko 1dSWB/40THgJWOFA7FwOHcFPelVVnpKYNOhfQuyUuXJy0WLW2cSHshnroZRXNnjokUNm0oly+fA dPJtLOBh52GIUcac13awR+mTeDNkso9fhOR8aONIaah9ZyYwZixqaImkB+Pya9N4Pp8S0FMZEmQ AuQrEaRpREWdNEYbEBavp5mnhNQsYK84xs/boE5VkJUrAn1c4uHVymlQxMc4H6beLXKwVlBrfGi 4E8BJJzCTBIoNOAMJ/HeRM3gNw6N+RfKoG6FD4IrrD9R56rPo/c9ePXfvC7edCfmsBiCOXDC2rM b29yFFfR6iQHceT0T/LBylCiPZIO/Arm1BEWDWfhs7v6DikV X-Developer-Key: i=dmitry.baryshkov@linaro.org; a=openpgp; fpr=8F88381DD5C873E4AE487DA5199BF1243632046A The only clock which has frequency being set through hpd_freqs is the "core" aka MDSS_HDMI_CLK clock. It always has the specified frequency, so we can drop corresponding clk_set_rate() call together with the hpd_freq infrastructure. Reviewed-by: Jessica Zhang Signed-off-by: Dmitry Baryshkov --- drivers/gpu/drm/msm/hdmi/hdmi.c | 2 -- drivers/gpu/drm/msm/hdmi/hdmi.h | 1 - drivers/gpu/drm/msm/hdmi/hdmi_hpd.c | 9 --------- 3 files changed, 12 deletions(-) diff --git a/drivers/gpu/drm/msm/hdmi/hdmi.c b/drivers/gpu/drm/msm/hdmi/hdm= i.c index 104f9cefa14834d04fb957eb48777e605d1e29a5..6f09920c58190a9c195de0407e4= c2dcc3d58b30f 100644 --- a/drivers/gpu/drm/msm/hdmi/hdmi.c +++ b/drivers/gpu/drm/msm/hdmi/hdmi.c @@ -234,12 +234,10 @@ static const struct hdmi_platform_config hdmi_tx_8960= _config =3D { =20 static const char * const pwr_reg_names_8x74[] =3D {"core-vdda", "core-vcc= "}; static const char * const hpd_clk_names_8x74[] =3D {"iface", "core", "mdp_= core", "alt_iface"}; -static unsigned long hpd_clk_freq_8x74[] =3D {0, 19200000, 0, 0}; =20 static const struct hdmi_platform_config hdmi_tx_8974_config =3D { HDMI_CFG(pwr_reg, 8x74), HDMI_CFG(hpd_clk, 8x74), - .hpd_freq =3D hpd_clk_freq_8x74, }; =20 static int msm_hdmi_bind(struct device *dev, struct device *master, void *= data) diff --git a/drivers/gpu/drm/msm/hdmi/hdmi.h b/drivers/gpu/drm/msm/hdmi/hdm= i.h index 3314bb8a09d6bea7e34ad9050970bf43c64d1558..e93d49d9e86936cb6c1f852a958= 398de2e134ad4 100644 --- a/drivers/gpu/drm/msm/hdmi/hdmi.h +++ b/drivers/gpu/drm/msm/hdmi/hdmi.h @@ -93,7 +93,6 @@ struct hdmi_platform_config { =20 /* clks that need to be on for hpd: */ const char * const *hpd_clk_names; - const long unsigned *hpd_freq; int hpd_clk_cnt; }; =20 diff --git a/drivers/gpu/drm/msm/hdmi/hdmi_hpd.c b/drivers/gpu/drm/msm/hdmi= /hdmi_hpd.c index 9ce0ffa3541795a076b433566a3cafe156120b15..7ae69b14e953f0ee6deea8a216b= fa9d3616b09af 100644 --- a/drivers/gpu/drm/msm/hdmi/hdmi_hpd.c +++ b/drivers/gpu/drm/msm/hdmi/hdmi_hpd.c @@ -68,15 +68,6 @@ static void enable_hpd_clocks(struct hdmi *hdmi, bool en= able) =20 if (enable) { for (i =3D 0; i < config->hpd_clk_cnt; i++) { - if (config->hpd_freq && config->hpd_freq[i]) { - ret =3D clk_set_rate(hdmi->hpd_clks[i], - config->hpd_freq[i]); - if (ret) - dev_warn(dev, - "failed to set clk %s (%d)\n", - config->hpd_clk_names[i], ret); - } - ret =3D clk_prepare_enable(hdmi->hpd_clks[i]); if (ret) { DRM_DEV_ERROR(dev, --=20 2.39.5 From nobody Fri Dec 19 06:34:31 2025 Received: from mail-lf1-f44.google.com (mail-lf1-f44.google.com [209.85.167.44]) (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 11873156F4A for ; Sun, 9 Feb 2025 05:07:03 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.167.44 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1739077625; cv=none; b=o1QVeZiio2kcdD4JJz2t08tkFTlt1oV4yXfyDFj3pLlXSZMN5MAiCRGkLZJUkxDxXKFml3a+NRRQO1ShPDD9cx2pCLx58BEhL3vo1zekn6iAUVbaG+m/9GA/NK0IFE1OX1kQHan0lBSfvrLVNNpiKW4E2vcTPAvcBScGRql6/I0= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1739077625; c=relaxed/simple; bh=cNUywERI8hGQBw9l50SO0xvsuUis2RpMcSyOPQXrk1Y=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=L5szS2OP2JU2EvlTTTfJyz7O+xmPcH7T3m0gLCxygYtmZKxQY56MZZ+1qXF/R/XlDYquYyJH1fMXdYOs7v2vM/Hbi4nmgzeFy33obCZeawJtsSHEfNNgvyB6+QNd/ErbE7XF3f/mCJkDD8k5Ms7/aljKkNlCeirY1stzx0tAixI= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org; spf=pass smtp.mailfrom=linaro.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b=PizxI8QS; arc=none smtp.client-ip=209.85.167.44 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linaro.org Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="PizxI8QS" Received: by mail-lf1-f44.google.com with SMTP id 2adb3069b0e04-543d8badc30so3776149e87.0 for ; Sat, 08 Feb 2025 21:07:03 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1739077622; x=1739682422; darn=vger.kernel.org; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:from:to:cc:subject:date:message-id :reply-to; bh=3rGXodl7UY6Xisbn+xeFyyE0+oLCJlfYiSTPpiZkjaU=; b=PizxI8QSY/d7iqZgen1cj8kTffdcLfqskQoCxBfXRCkjhAbCTBZ/LfpsKfStC1H5yq NWjySvrVrHUZ7sQuDGQw3Dohy3SEaZOuVgpnYhcjag1+0qD8mCPdQHtIA97T6B+2JZef +3oM+FxAAKs/vMjfSkbZnx9L77Dzd5CoM+0BOsJhNpT9FrMsFnUHXJvNMZz4CG66ye/F WeqiChTNCmu+ieoEl3Nm33q2ceSp1sqaKsw/6eHAIOcjPfnNtz3Bx15jlkHlK7YsL5ax vpFjB3yXIpfaIjn/4ZmffQDXJGSPH6q/icksABgscWqrfzyE5OMkKfXrwDkn1QZ9qkJa hgfg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1739077622; x=1739682422; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=3rGXodl7UY6Xisbn+xeFyyE0+oLCJlfYiSTPpiZkjaU=; b=KAsq32lY3rF9m3mxUD9zov7NuGhxxVMRA62e+5v95gH/YszyhAgD9/7Av5oXAtV9NI ybtJHYQlPJeuNK2JvaN43InfAaE6e4Nx9uaY+pi3XE1GwfdQTs+NSLJ73Fythtli7uGZ RIKoV+bXDP2P3ykywyz7xPTNf9TUo/PHET9dBchWXWKMG0QT5m3pUU1ApI6DoKr0KkFx ozA+kfPUVL67TqZS5DJUl7NUgvCw28bIRuJsnK1Cj7IWC6X2nLNWVS+NUNJ1KwVDjayb 3yZwVlQlaBVrELPyfyqstxExGxdC6Of/x8Aj1ZK570oPq4F7YxDuyRfdyOe55uwWaohX /1Mw== X-Forwarded-Encrypted: i=1; AJvYcCVdMNYK/g0eE6a4xbHK6uTcu41iZiAZZ/TQBsgksTtZJud93G6ZQbFyuHxGEcWM/nwlMtR5+5cJT5nu+uM=@vger.kernel.org X-Gm-Message-State: AOJu0YwPVmT8jgwGcAh2XjtnM457qWoZ8X/TcyFN2VAaOCL5hsF2CgTC gTu4Khm+uXD/y9XaTNleXW2R72n4tMKVa3LbdEJih+X6kb5/ohPhS4d2xm5Tq8E= X-Gm-Gg: ASbGncuIDOZEM2rlcy3I5PahJFxMvpFvnNd/CXGWJ7/A7xhCbOswgDWq02jgKY77EJ8 o7RMJuDRsuDW5rt34XvWDAv9AXFqP94pE2PX8xtT9y0mthdMu1XpcytStJ33dTVQ5LfZbUlPbX1 7i0h1tUIWmc4c/n+BByjXww69jfK8UnmT9FjDWvfqnIylKiQXlrNM5gMckfedNgKDiNBxjVqPRG TmOQ5lVK2Hy1a3ACsxhxPb6n/bY919Y3KyZ+Ue65GvIjqqVjtr+effrSGW/0ef5Cm5qmaoJp4gw Y8GUssSogOL2rupgQhwMWzI= X-Google-Smtp-Source: AGHT+IECHEx5wXU3DMO4GB2MoLvqoEOcXJmE/ykw6Obq3xv/T+mDtoQLue2OeXH2anuyCE0mx+aqFQ== X-Received: by 2002:a05:6512:3288:b0:545:5d:a5c3 with SMTP id 2adb3069b0e04-545005da7eemr1544729e87.4.1739077622154; Sat, 08 Feb 2025 21:07:02 -0800 (PST) Received: from umbar.lan ([192.130.178.90]) by smtp.gmail.com with ESMTPSA id 2adb3069b0e04-54506ef1733sm245576e87.1.2025.02.08.21.06.59 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 08 Feb 2025 21:07:01 -0800 (PST) From: Dmitry Baryshkov Date: Sun, 09 Feb 2025 07:04:51 +0200 Subject: [PATCH v4 07/16] drm/msm/hdmi: switch to clk_bulk API Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Message-Id: <20250209-fd-hdmi-hpd-v4-7-6224568ed87f@linaro.org> References: <20250209-fd-hdmi-hpd-v4-0-6224568ed87f@linaro.org> In-Reply-To: <20250209-fd-hdmi-hpd-v4-0-6224568ed87f@linaro.org> To: Rob Clark , Abhinav Kumar , Sean Paul , Marijn Suijten , David Airlie , Simona Vetter , Maarten Lankhorst , Maxime Ripard , Thomas Zimmermann , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Bjorn Andersson , Konrad Dybcio , Simona Vetter Cc: linux-arm-msm@vger.kernel.org, dri-devel@lists.freedesktop.org, freedreno@lists.freedesktop.org, linux-kernel@vger.kernel.org, devicetree@vger.kernel.org, Jessica Zhang X-Mailer: b4 0.14.2 X-Developer-Signature: v=1; a=openpgp-sha256; l=4477; i=dmitry.baryshkov@linaro.org; h=from:subject:message-id; bh=cNUywERI8hGQBw9l50SO0xvsuUis2RpMcSyOPQXrk1Y=; b=owEBbQGS/pANAwAKAYs8ij4CKSjVAcsmYgBnqDfirTeg+xg3ns1vJT9Om7aF9A1HlE9Ki2qvq Wcj5oDl6S+JATMEAAEKAB0WIQRMcISVXLJjVvC4lX+LPIo+Aiko1QUCZ6g34gAKCRCLPIo+Aiko 1QwlCACPy8ChP+BZLQp5Xs97+XIJG4ERSgqmkT99waymkQsollnei9VfA03mFzmQJkW2a608nqr L5hf1Hocdm6VaP5m0DmgdQL1SSEIAvYNgKVI0226bwTODULT1WmwqVSbJs91U/BNxmAksLvZ1W9 LCJ+NZR8NcpybuMAHMqSLaM/kOnySq6cz4sxXtHi6bmng0esJFC8qkTZoFxj6g9XbyMOPsm/r3S wuWZgR2/S7Iz8AEjzCQeGT0JegDCja7uP4kSz1sY2mV53hZuFrogOsq9Wdh/Ox9bsjirav/Z+Or 1elUQHYLq/3ap0Jnsb8mgqSKXCqOm3AHtoGGePqGhVqz878w X-Developer-Key: i=dmitry.baryshkov@linaro.org; a=openpgp; fpr=8F88381DD5C873E4AE487DA5199BF1243632046A The last platform using legacy clock names for HDMI block (APQ8064) switched to new clock names in 5.16. It's time to stop caring about old DT, drop hand-coded helpers and switch to clk_bulk_* API. Reviewed-by: Jessica Zhang Signed-off-by: Dmitry Baryshkov --- drivers/gpu/drm/msm/hdmi/hdmi.c | 15 +++++--------- drivers/gpu/drm/msm/hdmi/hdmi.h | 2 +- drivers/gpu/drm/msm/hdmi/hdmi_hpd.c | 39 +++++++++++++--------------------= ---- 3 files changed, 19 insertions(+), 37 deletions(-) diff --git a/drivers/gpu/drm/msm/hdmi/hdmi.c b/drivers/gpu/drm/msm/hdmi/hdm= i.c index 6f09920c58190a9c195de0407e4c2dcc3d58b30f..69e337d551799b4d35c8c8c7ecb= 5c4680b9a9e5f 100644 --- a/drivers/gpu/drm/msm/hdmi/hdmi.c +++ b/drivers/gpu/drm/msm/hdmi/hdmi.c @@ -353,17 +353,12 @@ static int msm_hdmi_dev_probe(struct platform_device = *pdev) if (!hdmi->hpd_clks) return -ENOMEM; =20 - for (i =3D 0; i < config->hpd_clk_cnt; i++) { - struct clk *clk; + for (i =3D 0; i < config->hpd_clk_cnt; i++) + hdmi->hpd_clks[i].id =3D config->hpd_clk_names[i]; =20 - clk =3D msm_clk_get(pdev, config->hpd_clk_names[i]); - if (IS_ERR(clk)) - return dev_err_probe(dev, PTR_ERR(clk), - "failed to get hpd clk: %s\n", - config->hpd_clk_names[i]); - - hdmi->hpd_clks[i] =3D clk; - } + ret =3D devm_clk_bulk_get(&pdev->dev, config->hpd_clk_cnt, hdmi->hpd_clks= ); + if (ret) + return ret; =20 hdmi->extp_clk =3D devm_clk_get_optional(&pdev->dev, "extp"); if (IS_ERR(hdmi->extp_clk)) diff --git a/drivers/gpu/drm/msm/hdmi/hdmi.h b/drivers/gpu/drm/msm/hdmi/hdm= i.h index e93d49d9e86936cb6c1f852a958398de2e134ad4..3f87535bcf43e20f0618d301630= 7fe1642d7baf9 100644 --- a/drivers/gpu/drm/msm/hdmi/hdmi.h +++ b/drivers/gpu/drm/msm/hdmi/hdmi.h @@ -49,7 +49,7 @@ struct hdmi { =20 struct regulator_bulk_data *hpd_regs; struct regulator_bulk_data *pwr_regs; - struct clk **hpd_clks; + struct clk_bulk_data *hpd_clks; struct clk *extp_clk; =20 struct gpio_desc *hpd_gpiod; diff --git a/drivers/gpu/drm/msm/hdmi/hdmi_hpd.c b/drivers/gpu/drm/msm/hdmi= /hdmi_hpd.c index 7ae69b14e953f0ee6deea8a216bfa9d3616b09af..e253c1408dd1c6dcd7e94506f0b= 8edcfd4a9a159 100644 --- a/drivers/gpu/drm/msm/hdmi/hdmi_hpd.c +++ b/drivers/gpu/drm/msm/hdmi/hdmi_hpd.c @@ -60,27 +60,6 @@ static void msm_hdmi_phy_reset(struct hdmi *hdmi) } } =20 -static void enable_hpd_clocks(struct hdmi *hdmi, bool enable) -{ - const struct hdmi_platform_config *config =3D hdmi->config; - struct device *dev =3D &hdmi->pdev->dev; - int i, ret; - - if (enable) { - for (i =3D 0; i < config->hpd_clk_cnt; i++) { - ret =3D clk_prepare_enable(hdmi->hpd_clks[i]); - if (ret) { - DRM_DEV_ERROR(dev, - "failed to enable hpd clk: %s (%d)\n", - config->hpd_clk_names[i], ret); - } - } - } else { - for (i =3D config->hpd_clk_cnt - 1; i >=3D 0; i--) - clk_disable_unprepare(hdmi->hpd_clks[i]); - } -} - int msm_hdmi_hpd_enable(struct drm_bridge *bridge) { struct hdmi_bridge *hdmi_bridge =3D to_hdmi_bridge(bridge); @@ -107,7 +86,9 @@ int msm_hdmi_hpd_enable(struct drm_bridge *bridge) gpiod_set_value_cansleep(hdmi->hpd_gpiod, 1); =20 pm_runtime_get_sync(dev); - enable_hpd_clocks(hdmi, true); + ret =3D clk_bulk_prepare_enable(config->hpd_clk_cnt, hdmi->hpd_clks); + if (ret) + goto fail; =20 msm_hdmi_set_mode(hdmi, false); msm_hdmi_phy_reset(hdmi); @@ -149,7 +130,7 @@ void msm_hdmi_hpd_disable(struct hdmi *hdmi) =20 msm_hdmi_set_mode(hdmi, false); =20 - enable_hpd_clocks(hdmi, false); + clk_bulk_disable_unprepare(config->hpd_clk_cnt, hdmi->hpd_clks); pm_runtime_put(dev); =20 ret =3D pinctrl_pm_select_sleep_state(dev); @@ -193,14 +174,20 @@ void msm_hdmi_hpd_irq(struct drm_bridge *bridge) =20 static enum drm_connector_status detect_reg(struct hdmi *hdmi) { - uint32_t hpd_int_status; + const struct hdmi_platform_config *config =3D hdmi->config; + u32 hpd_int_status =3D 0; + int ret; =20 pm_runtime_get_sync(&hdmi->pdev->dev); - enable_hpd_clocks(hdmi, true); + ret =3D clk_bulk_prepare_enable(config->hpd_clk_cnt, hdmi->hpd_clks); + if (ret) + goto out; =20 hpd_int_status =3D hdmi_read(hdmi, REG_HDMI_HPD_INT_STATUS); =20 - enable_hpd_clocks(hdmi, false); + clk_bulk_disable_unprepare(config->hpd_clk_cnt, hdmi->hpd_clks); + +out: pm_runtime_put(&hdmi->pdev->dev); =20 return (hpd_int_status & HDMI_HPD_INT_STATUS_CABLE_DETECTED) ? --=20 2.39.5 From nobody Fri Dec 19 06:34:31 2025 Received: from mail-lf1-f45.google.com (mail-lf1-f45.google.com [209.85.167.45]) (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 7DB041684AC for ; Sun, 9 Feb 2025 05:07:06 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.167.45 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1739077628; cv=none; b=U4dKT7RG0XPwCnIzSquy5Qs2UrFoQsZISxSaQZdrhVwoD9STIkMCP8ua+1eW78HgGBDVoMMQUgZlhDHwopg1DFY9o6k4U4ocPbW0c4bu89dmvJghjuQDrJg0YQlkCIqwY+V/ZauorJ5FfvR8Iv57SKSk++SdDVqW0F6eB7yyoYI= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1739077628; c=relaxed/simple; bh=8ggrOHMoONGuV72hshgJDWyRmMWrabWT+tktxkICLQM=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=K8E4Q6QOAb/6wxHPikZ/iMzitiHhEKRTOn/rjKGXKbr6Iih0ZxOMjm1KBUP/Cjs9suvJPmOg4Fpfpca9T8BCJG1h2UkHWaMATUJt5siGoFh5joznEQElLX8FtXRTDhVAi0h1NdZqwpN5Me3jtVOC0Qvoq2K+F7A5PXU5hoRAiA4= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org; spf=pass smtp.mailfrom=linaro.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b=Q7xvaELA; arc=none smtp.client-ip=209.85.167.45 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linaro.org Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="Q7xvaELA" Received: by mail-lf1-f45.google.com with SMTP id 2adb3069b0e04-5401e6efffcso3399519e87.3 for ; Sat, 08 Feb 2025 21:07:06 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1739077625; x=1739682425; darn=vger.kernel.org; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:from:to:cc:subject:date:message-id :reply-to; bh=R0fvdO4R1nURbqAvtpU5cS7Y2T0kdgB8Gv4vtNNxca0=; b=Q7xvaELAby4Q02l8gA5uHh0iUpfnG1Wj/TIbAuSHxsMY5xg26aiG9/dXJ2fLtb+BKe Cz27+Lb/TfhZTebyfXYyq/3K4rAriiK0ThKB4L8h3ZaYhs4PQb2tvoSe1GAe5sywsHga 6SAGDey/rsR1CCm9j33IUqohH7vOek/97zasuopxJTRaQkHJaM8QJ72IaV9/9Wp4/D/9 cOhGESYfuk7IXqZNdSmcVZxpwuxBJF7ZxcMnhDlX3RM/WYdKevMx091s/YPKPSxygcGp 2mNHHa2S4oAjQws06SAUWuneLFJ+luZg5uAg5zkGW2J6Py6SB7X/CgsVEqtXTt8/zcMF SLug== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1739077625; x=1739682425; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=R0fvdO4R1nURbqAvtpU5cS7Y2T0kdgB8Gv4vtNNxca0=; b=C+UaJqyNhxPj0yzR7tvPZFKl14bULrRtrG2NkB2YtZqCUncZnIiOYlRbAJdSyWmcpn 8t5S9889xIF03T/aM00thq8n8nMyxsEYHTmvrWxj05MWHZOHseRGy46QwqJKW5rp4H8i SHohPXgey1Zt9d4b9Ua3FJ6zk03xOSANdK/NYQtYERB0DEiJwg1q8gekT1s7zSwsJPv8 kbpDItf9T179Z/jYK49DHhfNpWsxcRhpyMQbkWOmXr6sC6sV0WX23OrbKGAOqGqYamMB LQ0cLVilEidx7knUt7UgpeR5XQPr9vtbYWWAl4bGlt0hj7tRmbd7xswH6rqmcyh59oK9 kKHw== X-Forwarded-Encrypted: i=1; AJvYcCXPnO8lMkS0dpnhc5nNovUtsXHm2LH/9n7xgLYtk9QZMoBYMG2Qymn8pJqwsdYwLwoFIY+e1whtbEYiiwI=@vger.kernel.org X-Gm-Message-State: AOJu0YzVzsLpSeAhrgKCYNWoJREd4WjOuSRzYZTAS9ia2hWRK2UXlwuN scy9qxc0wcUxvMBzl3raI+eOuz4xaaHOJ3ns/9Jbr1iIWalU+vC5Ac3s9dR6YnM= X-Gm-Gg: ASbGncvaIVnPaM96abYlBlKDUijRLjgpIzHZM63rgEcqYqSvYwaK7yVF9RiML1eSjXZ cql5JgulTikTxLjvKrcu3aULq+OXFd7lvRMsF3ES1JpMsUOHjCbV+EEgqV8cZRYTgX8apXpfM2l zvi4GOzewMpTri1m66tky/2GdKMvsHibd2/1lkh8GleIaA5gULjbfztwuqPYPbquIVgpsrdU2gt 2oUDjg2DooX631uZLX++NzCOPx/lsUplasd9CzBVBcLLwe2lBUkgrVq+0evF0yl2QPz8rwbJ2yx noUPGYTQtV9uM4E+ydKGHvQ= X-Google-Smtp-Source: AGHT+IHvHK9pE/lJ1sbvSikM6yxevJJhOW+toCBmWw7PDK+wzGYcNkAt2K57E9sTUMAV9Ze/PJqhag== X-Received: by 2002:a05:6512:2821:b0:545:6a2:e52 with SMTP id 2adb3069b0e04-54506a20ff4mr841140e87.13.1739077624656; Sat, 08 Feb 2025 21:07:04 -0800 (PST) Received: from umbar.lan ([192.130.178.90]) by smtp.gmail.com with ESMTPSA id 2adb3069b0e04-54506ef1733sm245576e87.1.2025.02.08.21.07.02 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 08 Feb 2025 21:07:03 -0800 (PST) From: Dmitry Baryshkov Date: Sun, 09 Feb 2025 07:04:52 +0200 Subject: [PATCH v4 08/16] drm/msm/hdmi: switch to pm_runtime_resume_and_get() Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Message-Id: <20250209-fd-hdmi-hpd-v4-8-6224568ed87f@linaro.org> References: <20250209-fd-hdmi-hpd-v4-0-6224568ed87f@linaro.org> In-Reply-To: <20250209-fd-hdmi-hpd-v4-0-6224568ed87f@linaro.org> To: Rob Clark , Abhinav Kumar , Sean Paul , Marijn Suijten , David Airlie , Simona Vetter , Maarten Lankhorst , Maxime Ripard , Thomas Zimmermann , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Bjorn Andersson , Konrad Dybcio , Simona Vetter Cc: linux-arm-msm@vger.kernel.org, dri-devel@lists.freedesktop.org, freedreno@lists.freedesktop.org, linux-kernel@vger.kernel.org, devicetree@vger.kernel.org, Jessica Zhang X-Mailer: b4 0.14.2 X-Developer-Signature: v=1; a=openpgp-sha256; l=2832; i=dmitry.baryshkov@linaro.org; h=from:subject:message-id; bh=8ggrOHMoONGuV72hshgJDWyRmMWrabWT+tktxkICLQM=; b=owEBbQGS/pANAwAKAYs8ij4CKSjVAcsmYgBnqDfibvp8G2Mg6U4kntY4TDix+sHhUGkYjpmgS NNb+V0lzKmJATMEAAEKAB0WIQRMcISVXLJjVvC4lX+LPIo+Aiko1QUCZ6g34gAKCRCLPIo+Aiko 1ZOuCACuIdGuV1z9z9UzxMNBCcGvD/1jN1gxNpsw6zo3qtvGjKRkgE29wRh+70PdHygdsSuJJND MQki8GKKIOtm2TMfh+6qLFk75iGLCdaFZeZxBXNCF7DXEBgAgtcHrGCRf8V59wZBCedv3aG+Fjv cXg7zqX6S7kZCGzN1etDHpsvbm9+otPbTE3VJ6zkIpDpBw7N1ufN+sm3I2juhcTvXxEDP1hmjxx o9YPIO/P3wB5ewBaRYJco7WQme9QVlQs3/YzNlYGghVOo21A0xb0tA9h+FqcQDj+rB+MVHq7t+U jSh9lS5oE/Md0BKq6r34Tr65Q/5WqHuA8FJ7DSqmCc1TROtB X-Developer-Key: i=dmitry.baryshkov@linaro.org; a=openpgp; fpr=8F88381DD5C873E4AE487DA5199BF1243632046A The pm_runtime_get_sync() function is a bad choise for runtime power management. Switch HDMI driver to pm_runtime_resume_and_get() and add proper error handling, while we are at it. Reviewed-by: Jessica Zhang Signed-off-by: Dmitry Baryshkov --- drivers/gpu/drm/msm/hdmi/hdmi_bridge.c | 2 +- drivers/gpu/drm/msm/hdmi/hdmi_hpd.c | 12 ++++++++++-- drivers/gpu/drm/msm/hdmi/hdmi_phy.c | 6 +++++- 3 files changed, 16 insertions(+), 4 deletions(-) diff --git a/drivers/gpu/drm/msm/hdmi/hdmi_bridge.c b/drivers/gpu/drm/msm/h= dmi/hdmi_bridge.c index 6c5bbd772700b0362f884a737598d7bf419adf9b..d7d5d3755fb853377aa999e2a83= 0debf54afe984 100644 --- a/drivers/gpu/drm/msm/hdmi/hdmi_bridge.c +++ b/drivers/gpu/drm/msm/hdmi/hdmi_bridge.c @@ -21,7 +21,7 @@ static void msm_hdmi_power_on(struct drm_bridge *bridge) const struct hdmi_platform_config *config =3D hdmi->config; int ret; =20 - pm_runtime_get_sync(&hdmi->pdev->dev); + pm_runtime_resume_and_get(&hdmi->pdev->dev); =20 ret =3D regulator_bulk_enable(config->pwr_reg_cnt, hdmi->pwr_regs); if (ret) diff --git a/drivers/gpu/drm/msm/hdmi/hdmi_hpd.c b/drivers/gpu/drm/msm/hdmi= /hdmi_hpd.c index e253c1408dd1c6dcd7e94506f0b8edcfd4a9a159..d77c68914c5f525cf12971c1058= b1abc33792b24 100644 --- a/drivers/gpu/drm/msm/hdmi/hdmi_hpd.c +++ b/drivers/gpu/drm/msm/hdmi/hdmi_hpd.c @@ -85,7 +85,12 @@ int msm_hdmi_hpd_enable(struct drm_bridge *bridge) if (hdmi->hpd_gpiod) gpiod_set_value_cansleep(hdmi->hpd_gpiod, 1); =20 - pm_runtime_get_sync(dev); + ret =3D pm_runtime_resume_and_get(dev); + if (ret) { + DRM_DEV_ERROR(dev, "runtime resume failed: %d\n", ret); + goto fail; + } + ret =3D clk_bulk_prepare_enable(config->hpd_clk_cnt, hdmi->hpd_clks); if (ret) goto fail; @@ -178,7 +183,10 @@ static enum drm_connector_status detect_reg(struct hdm= i *hdmi) u32 hpd_int_status =3D 0; int ret; =20 - pm_runtime_get_sync(&hdmi->pdev->dev); + ret =3D pm_runtime_resume_and_get(&hdmi->pdev->dev); + if (ret) + goto out; + ret =3D clk_bulk_prepare_enable(config->hpd_clk_cnt, hdmi->hpd_clks); if (ret) goto out; diff --git a/drivers/gpu/drm/msm/hdmi/hdmi_phy.c b/drivers/gpu/drm/msm/hdmi= /hdmi_phy.c index 03120c54ced686dcd2ddfe809dd9c9011f608235..667573f1db7c6bfef6c75828b5c= 581c147a86d0d 100644 --- a/drivers/gpu/drm/msm/hdmi/hdmi_phy.c +++ b/drivers/gpu/drm/msm/hdmi/hdmi_phy.c @@ -58,7 +58,11 @@ int msm_hdmi_phy_resource_enable(struct hdmi_phy *phy) struct device *dev =3D &phy->pdev->dev; int i, ret =3D 0; =20 - pm_runtime_get_sync(dev); + ret =3D pm_runtime_resume_and_get(dev); + if (ret) { + DRM_DEV_ERROR(dev, "runtime resume failed: %d\n", ret); + return ret; + } =20 ret =3D regulator_bulk_enable(cfg->num_regs, phy->regs); if (ret) { --=20 2.39.5 From nobody Fri Dec 19 06:34:31 2025 Received: from mail-lj1-f182.google.com (mail-lj1-f182.google.com [209.85.208.182]) (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 0033B1779B8 for ; Sun, 9 Feb 2025 05:07:08 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.208.182 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1739077630; cv=none; b=TAn7AtoS5Q1mGVd1FrETxHScR+F1HmSCKZNdkvLpu/VqOH8+vuYghRk7pFoKEmxSp+XQERhIuaq8rfOepFTT0bd6WZaZAGZDyCTUF3dJTJQ3AiOQRoRUEa3wxDAW9h2A3r1ipfZG7FNhAMW+mzYIhvJhcYrW7xqrEFWnYOcP3IY= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1739077630; c=relaxed/simple; bh=iRrggYdOsfyNRF7mD9CF5dLKTnVLk9gbl2tlKLOnDn8=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=gegKWrmNRDoouzc2h7fmYBaUCeS5lN5k6M8fTfqhoKDLqC0+rSikt2lSz1mikQ8C1Vn86culBYTlhme3IwQMXLAcGhOqKDM1mNEs9o5Cz/ACfnXFQzX6Gt/5VaUPRnE5jM+gmjkzAS79WVXBALxCMhiJR6I2LLT8HoGS5EUL/ns= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org; spf=pass smtp.mailfrom=linaro.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b=NWp1lagO; arc=none smtp.client-ip=209.85.208.182 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linaro.org Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="NWp1lagO" Received: by mail-lj1-f182.google.com with SMTP id 38308e7fff4ca-30762598511so33474291fa.0 for ; Sat, 08 Feb 2025 21:07:08 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1739077627; x=1739682427; darn=vger.kernel.org; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:from:to:cc:subject:date:message-id :reply-to; bh=dPGyQgNZ0aCBKHZLfiK3AEZ4dYrfnGwELgJGxdZANgU=; b=NWp1lagOzJzEIocLjc6k4VYsfHIur/Bl4zZ1FS3pK84/246B9GAKKO9ZTd1xSSHMP9 42xTcaIVK0fHgkhu+VXKUF35mBjolt6BX/ZOKX5rfxZ3mPu+IpJCpHhU4rEstWUemK4e aKFq5k/TPxN0XbqAdPqYbu029ukH6si+pTfD0hOdDTcdEidjkFNFBXfjAioSyQwoqma3 FpNKyTcHWFTuAMyZcIocYPyt1P3ximUPQq1pMN6KKVIYX22hQbIzq13JAym0sYTLm5/H FQ7RybMj+ds84Bxc4FAIyUZC33DJrxAFc2qUplAulzvV68nQTvL9TaQ8tH1Y6aeSbbU3 vtKw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1739077627; x=1739682427; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=dPGyQgNZ0aCBKHZLfiK3AEZ4dYrfnGwELgJGxdZANgU=; b=CrK+LfcFdu5Kw5+D1jEqCCGBVc1nBxCWJAoJwVX5nKK6zlfp120ueGVfUSb5zZPptR 9JtKxD3cn7SFmE9OwoNhw6w5iKm0Vpy/my3T1zyYU8oQz6kqjlHRiBSEyNksKxa8eR5c opcMWYeb4sScLSy13jc+hXWVh7mYVXS+fJT8e4shAGtJcYAQme2zEeLE86jKld7a8IHD WzZwdfqB81xxwJiC+3tgRckC24GLPoZzUA2LCzC8QkYOkYbSQAD750o5takst4I6qb9z eOfCwI6y3ziM4s2sXpUzOLk6f4My8gP5n3HPCfsumxGCNPWATuVIYbQ2YnTYF4Ib/2f2 JdkA== X-Forwarded-Encrypted: i=1; AJvYcCUnzkaBWS2necYP4vil27D2CwFBJNeJQZFaC6y8HepmSDCx1HDsGtzHKdxpRlmxucqV18qCz17b6UBrS0U=@vger.kernel.org X-Gm-Message-State: AOJu0Yy7LuSSj5trFnJI0/EEW+XUkr1Lpsk+ioILaw3PPKsbxloD+eoS IVkqbtzS+bT9DwNecx30Jhkmtc0WqXfmAc9Hj6t5EWsfCRAxxqTqb+JKFDEfFzk= X-Gm-Gg: ASbGncvUL7vqyH+PIOd7H80AyXutsmCKxawXXistqb4UN0LXUOX5FUFKRNbZDivM3lj ehQMYx+5JaZ5KDHSycxXkLb2VeTRb7IsfjBYFoOuSShKz2hCDD3nkxZuvhiMdKjRp7100SynJhm wHfDrSQ9nQzrIFRdu3DnCpSu5FwtIfMa4m1YoPlJ5M73y9M/OP1syrzkERdPU2t05Tql61rgY4C cPQ9WTjUhBZJkhyFHrU1j/uq1t0q4DK0G8bfaRZ/YjdeJVh1YZKAsq8JXQ1v5j9zUTFeectJn1N koRktmZKmWZDhbdDQ7bSSg4= X-Google-Smtp-Source: AGHT+IHOgcR2Z0Kqo6vnivPTHmH/O6i7EBOYINI+rp89KZLNIblSE2CYospkx5vQksFw/e13bAf1pg== X-Received: by 2002:a05:6512:3fc:b0:542:98bb:5674 with SMTP id 2adb3069b0e04-54414ae0732mr2345723e87.33.1739077627095; Sat, 08 Feb 2025 21:07:07 -0800 (PST) Received: from umbar.lan ([192.130.178.90]) by smtp.gmail.com with ESMTPSA id 2adb3069b0e04-54506ef1733sm245576e87.1.2025.02.08.21.07.04 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 08 Feb 2025 21:07:05 -0800 (PST) From: Dmitry Baryshkov Date: Sun, 09 Feb 2025 07:04:53 +0200 Subject: [PATCH v4 09/16] drm/msm/hdmi: add runtime PM calls to DDC transfer function Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Message-Id: <20250209-fd-hdmi-hpd-v4-9-6224568ed87f@linaro.org> References: <20250209-fd-hdmi-hpd-v4-0-6224568ed87f@linaro.org> In-Reply-To: <20250209-fd-hdmi-hpd-v4-0-6224568ed87f@linaro.org> To: Rob Clark , Abhinav Kumar , Sean Paul , Marijn Suijten , David Airlie , Simona Vetter , Maarten Lankhorst , Maxime Ripard , Thomas Zimmermann , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Bjorn Andersson , Konrad Dybcio , Simona Vetter Cc: linux-arm-msm@vger.kernel.org, dri-devel@lists.freedesktop.org, freedreno@lists.freedesktop.org, linux-kernel@vger.kernel.org, devicetree@vger.kernel.org, Jessica Zhang X-Mailer: b4 0.14.2 X-Developer-Signature: v=1; a=openpgp-sha256; l=1630; i=dmitry.baryshkov@linaro.org; h=from:subject:message-id; bh=iRrggYdOsfyNRF7mD9CF5dLKTnVLk9gbl2tlKLOnDn8=; b=owEBbQGS/pANAwAKAYs8ij4CKSjVAcsmYgBnqDfia7EBbrd6GV3tmBxCrKU999OvEGr1JbtMF Mdzz6fu9ISJATMEAAEKAB0WIQRMcISVXLJjVvC4lX+LPIo+Aiko1QUCZ6g34gAKCRCLPIo+Aiko 1QrVB/92GfoPb+KtYU7kLhhmf8FYFyhFLKMmj7oEBLJB/Vecg7K+hhR0Emve+xmn01ZP2Hue125 fGhKF5HYwmbu/ANhmsEmvcebBvFD2gQEoQ4Lwt1jRlMBU1ZFsK/jPKRhArWSRPJvb2h7bvze98Z iSvNIGpCe6hy46XwhA3JyWsuiCmD5Ixjr+qjSYBazwM3NoF4Tub4SccSG9YC6Rm+A5csfhytRvp 3Eo7gCWZfST2ZoSjTu3D0TM8xROiS0KPlCgMCL1RHg8fqk6VX6brvVQaw+ho8zcJ/kSrIzbi3P9 PWmdaxYOgzgmWMYcjBaHqX14VY8iFOCzpKD4as4jMTXz2bWo X-Developer-Key: i=dmitry.baryshkov@linaro.org; a=openpgp; fpr=8F88381DD5C873E4AE487DA5199BF1243632046A We must be sure that the HDMI controller is powered on, while performing the DDC transfer. Add corresponding runtime PM calls to msm_hdmi_i2c_xfer(). Reviewed-by: Jessica Zhang Signed-off-by: Dmitry Baryshkov --- drivers/gpu/drm/msm/hdmi/hdmi_i2c.c | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/drivers/gpu/drm/msm/hdmi/hdmi_i2c.c b/drivers/gpu/drm/msm/hdmi= /hdmi_i2c.c index 7aa500d24240ff3ed6694c469eafc4388c982346..ebefea4fb40855745001ed97367= d571bde28f413 100644 --- a/drivers/gpu/drm/msm/hdmi/hdmi_i2c.c +++ b/drivers/gpu/drm/msm/hdmi/hdmi_i2c.c @@ -107,11 +107,15 @@ static int msm_hdmi_i2c_xfer(struct i2c_adapter *i2c, if (num =3D=3D 0) return num; =20 + ret =3D pm_runtime_resume_and_get(&hdmi->pdev->dev); + if (ret) + return ret; + init_ddc(hdmi_i2c); =20 ret =3D ddc_clear_irq(hdmi_i2c); if (ret) - return ret; + goto fail; =20 for (i =3D 0; i < num; i++) { struct i2c_msg *p =3D &msgs[i]; @@ -169,7 +173,7 @@ static int msm_hdmi_i2c_xfer(struct i2c_adapter *i2c, hdmi_read(hdmi, REG_HDMI_DDC_SW_STATUS), hdmi_read(hdmi, REG_HDMI_DDC_HW_STATUS), hdmi_read(hdmi, REG_HDMI_DDC_INT_CTRL)); - return ret; + goto fail; } =20 ddc_status =3D hdmi_read(hdmi, REG_HDMI_DDC_SW_STATUS); @@ -202,7 +206,13 @@ static int msm_hdmi_i2c_xfer(struct i2c_adapter *i2c, } } =20 + pm_runtime_put(&hdmi->pdev->dev); + return i; + +fail: + pm_runtime_put(&hdmi->pdev->dev); + return ret; } =20 static u32 msm_hdmi_i2c_func(struct i2c_adapter *adapter) --=20 2.39.5 From nobody Fri Dec 19 06:34:31 2025 Received: from mail-lf1-f50.google.com (mail-lf1-f50.google.com [209.85.167.50]) (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 66A3818A6DB for ; Sun, 9 Feb 2025 05:07:11 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.167.50 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1739077633; cv=none; b=DZEIN6vIaHJzhURt38rAftcIxck1zayKcni6OvmsuRPhH11g25oNTsxd+YST6tA8bn586RN/Endf1781+ompOK8W5IwfAQ2wqx6wbgJSfSZmjkwJhk2OMb3PXqn/E34B9TeYVFcJnzn1moLFQYS8gOHgo7ieW5SHi+GJmAQsFbY= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1739077633; c=relaxed/simple; bh=FbKaceGiAg6TBff1fmSfXG39SERi268oL7jMv4TIAIc=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=FIQfY1ijC9+M3bOJGz5F61OsQQIyeieQacjWHJCp005KBwogRonxMIkyvLUG9E4gazx/Xcs+ZXFl4Yoo0Z8H4U6/v0ZucJdO87Z2mIaUwoLGU5Ex5Zd32FSBLba+0D9j49BY/2QvpzDoVSc0jOBGEYO8uQDuiYhtgARYNbIP63M= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org; spf=pass smtp.mailfrom=linaro.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b=Nmg/tW1O; arc=none smtp.client-ip=209.85.167.50 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linaro.org Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="Nmg/tW1O" Received: by mail-lf1-f50.google.com with SMTP id 2adb3069b0e04-5440d5aae5cso3565346e87.0 for ; Sat, 08 Feb 2025 21:07:11 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1739077629; x=1739682429; darn=vger.kernel.org; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:from:to:cc:subject:date:message-id :reply-to; bh=J6Gr4uu/kJErVl7WJZNEAVi18tX3meOvk7rKvqbRQDw=; b=Nmg/tW1OjVz4ls3lbpAek0UpcHrd5tlcwGN4rRlrzeLCP5gdPBhFGkSEfY6UANrz58 +til2AzhuWwnMwnQzGmx7y/fRFVYQs7esbVDso+Nv1Y8OoCjwB9nXbXqerKdAbyHnRdr Ymktlo2a2+7FYUtASc1mNRoJJHdBxa9UbuLb59qU6mkyGeC1p1XBz7qrj7t3wkxotKlf RHbMN6ObRV6TqIZVStGvugStN0NQVDREQNgeWkTluIqpce4pEiMYuLWzfFNKX4KCzX7W O+sWIqFO1kOM+Cu4kcxZuOTPFxGpeRQkctJJU/FGRizeKNcBmfUd/89+DzqsW53ODNhS kf/w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1739077629; x=1739682429; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=J6Gr4uu/kJErVl7WJZNEAVi18tX3meOvk7rKvqbRQDw=; b=I0tnnZck5jF0Vat5BAJ86gaPFEvFTZcoGYoahE8kA+D810Ie1PE2VDBGr7s4UY3+cU rsNdQrOMRn6b1AAJkhKzjcRhDwrc0sxo0ik21JTMl/uskmvpv1muvVNFOa6dxB1tSdDX XI5+9EFaACk/X7cWp4pJrd7SToNjXO4q9stfFUe0z9/2QVcY6iAThxR+TZuCCTShfiRH XcX+5AqabjONjFXpJbH3qJbKYiZxp/X7bCnkiA7rdPx1vGWPW7JPLCnpv7u0qIh0EunF l6YPPlnIGj+FTCiPLPjuLW+oFaWfIEOuOh3hSy+jcZq6MiU4iDwd3xmoP796PnfuJHoR b6tQ== X-Forwarded-Encrypted: i=1; AJvYcCXdnrGSCXJxTPIFNilM6w2r4NLsFX5U+L4wkFPVDARANn790Gw87ocGaBGNPks5Olx5oO9gFqF2dB7fYVw=@vger.kernel.org X-Gm-Message-State: AOJu0YysHqPAdyaiHlm0pYpRSe83a9YQIHzQEkV76HDrlchDR7kgZQsl KNFJqCYWg0KWDn2lodMj+cwQfohO+BbQ4flRKeGvQVT0eWxwnUqoWtFl71fILns= X-Gm-Gg: ASbGncsxbVwYawqDTZQ0N1B6T8EeCIv7GEBXkVnJJQM+0b37TInTcrwm7XuUWwWQv4Y xgjj/T5i9esqVPI+EEiqfVPfWEvNOghLx1ArR723yVudHu7CITdHyxuVcwkOUdD4yUca7B5+Jss Il1dykmISlyiOWrJgFksyeMXd3Sqo5LKCYEh19Gw84a5/sS7yZOeDCurVzEmw4zORGSsQMFpHWq /ft9itgYB7MBKYVWfA8kjX54PGUtzxB/n3xXsGnfcDGR2CK+N7pEAoQaAdpKqdEXs2znd57anf7 HdlGcbe5/cT8GQONsaEXpjA= X-Google-Smtp-Source: AGHT+IEMz171/a3noyaNikNrBmsJ647KN8DT8QdriymS4YuVWPZiFxBKdSK++uLEoZfsKV6SZuZqLg== X-Received: by 2002:a05:6512:3d88:b0:544:1201:c0b3 with SMTP id 2adb3069b0e04-54414aae119mr2881240e87.11.1739077629496; Sat, 08 Feb 2025 21:07:09 -0800 (PST) Received: from umbar.lan ([192.130.178.90]) by smtp.gmail.com with ESMTPSA id 2adb3069b0e04-54506ef1733sm245576e87.1.2025.02.08.21.07.07 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 08 Feb 2025 21:07:08 -0800 (PST) From: Dmitry Baryshkov Date: Sun, 09 Feb 2025 07:04:54 +0200 Subject: [PATCH v4 10/16] drm/msm/hdmi: implement proper runtime PM handling Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Message-Id: <20250209-fd-hdmi-hpd-v4-10-6224568ed87f@linaro.org> References: <20250209-fd-hdmi-hpd-v4-0-6224568ed87f@linaro.org> In-Reply-To: <20250209-fd-hdmi-hpd-v4-0-6224568ed87f@linaro.org> To: Rob Clark , Abhinav Kumar , Sean Paul , Marijn Suijten , David Airlie , Simona Vetter , Maarten Lankhorst , Maxime Ripard , Thomas Zimmermann , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Bjorn Andersson , Konrad Dybcio , Simona Vetter Cc: linux-arm-msm@vger.kernel.org, dri-devel@lists.freedesktop.org, freedreno@lists.freedesktop.org, linux-kernel@vger.kernel.org, devicetree@vger.kernel.org, Jessica Zhang X-Mailer: b4 0.14.2 X-Developer-Signature: v=1; a=openpgp-sha256; l=9382; i=dmitry.baryshkov@linaro.org; h=from:subject:message-id; bh=FbKaceGiAg6TBff1fmSfXG39SERi268oL7jMv4TIAIc=; b=owEBbQGS/pANAwAKAYs8ij4CKSjVAcsmYgBnqDfjekR3ytdRsJ2xgXSruu+wiySdVD2A3OkWc romIolnABOJATMEAAEKAB0WIQRMcISVXLJjVvC4lX+LPIo+Aiko1QUCZ6g34wAKCRCLPIo+Aiko 1XBuB/43scQI8R13SZNUxuwJaZ+IhCr2eB31ophSF7KOoPzKejIQNs5xaV0bXzsvCxandCU2u4N 0w4pwZn2clkCyNLaYCdZQ3r59CpECFNxgtzyvws4Ur0BWqk9uPZf4e4wXTfytrlB6tS8//SKlWv T1eOB9bDsHcqmVDABaFA4uI4askTW1Iu9Aw+ag0GG68vqZctsgy/40llnAOOLTTIQZ6MAjspMWJ ZbyEmfEQzCHkYQVd6fZnOSc/uu1WiVYP5q5grf7ciFTHFAdmpQotKh7am9DIbcq2qo21OEl/K9L Z1pOUTRRVNHjnYxfTa7Mv2yCS+gtyXcGyyxkMXeFAZ/DP1Pu X-Developer-Key: i=dmitry.baryshkov@linaro.org; a=openpgp; fpr=8F88381DD5C873E4AE487DA5199BF1243632046A It is completely not obvious, but the so-called 'hpd' clocks and regulators are required for the HDMI host to function properly. Merge pwr and hpd regulators. Use regulators, clocks and pinctrl to implement proper runtime PM callbacks. Reviewed-by: Jessica Zhang Signed-off-by: Dmitry Baryshkov --- drivers/gpu/drm/msm/hdmi/hdmi.c | 62 +++++++++++++++++++++++++-----= ---- drivers/gpu/drm/msm/hdmi/hdmi.h | 5 --- drivers/gpu/drm/msm/hdmi/hdmi_bridge.c | 12 ------- drivers/gpu/drm/msm/hdmi/hdmi_hpd.c | 42 +---------------------- 4 files changed, 47 insertions(+), 74 deletions(-) diff --git a/drivers/gpu/drm/msm/hdmi/hdmi.c b/drivers/gpu/drm/msm/hdmi/hdm= i.c index 69e337d551799b4d35c8c8c7ecb5c4680b9a9e5f..ded20176aa805db98b0599e617e= b6ea9bce122d8 100644 --- a/drivers/gpu/drm/msm/hdmi/hdmi.c +++ b/drivers/gpu/drm/msm/hdmi/hdmi.c @@ -8,6 +8,7 @@ #include #include #include +#include #include =20 #include @@ -224,11 +225,11 @@ int msm_hdmi_modeset_init(struct hdmi *hdmi, .item ## _names =3D item ##_names_ ## entry, \ .item ## _cnt =3D ARRAY_SIZE(item ## _names_ ## entry) =20 -static const char * const hpd_reg_names_8960[] =3D {"core-vdda"}; +static const char * const pwr_reg_names_8960[] =3D {"core-vdda"}; static const char * const hpd_clk_names_8960[] =3D {"core", "master_iface"= , "slave_iface"}; =20 static const struct hdmi_platform_config hdmi_tx_8960_config =3D { - HDMI_CFG(hpd_reg, 8960), + HDMI_CFG(pwr_reg, 8960), HDMI_CFG(hpd_clk, 8960), }; =20 @@ -318,20 +319,6 @@ static int msm_hdmi_dev_probe(struct platform_device *= pdev) if (hdmi->irq < 0) return hdmi->irq; =20 - hdmi->hpd_regs =3D devm_kcalloc(&pdev->dev, - config->hpd_reg_cnt, - sizeof(hdmi->hpd_regs[0]), - GFP_KERNEL); - if (!hdmi->hpd_regs) - return -ENOMEM; - - for (i =3D 0; i < config->hpd_reg_cnt; i++) - hdmi->hpd_regs[i].supply =3D config->hpd_reg_names[i]; - - ret =3D devm_regulator_bulk_get(&pdev->dev, config->hpd_reg_cnt, hdmi->hp= d_regs); - if (ret) - return dev_err_probe(dev, ret, "failed to get hpd regulators\n"); - hdmi->pwr_regs =3D devm_kcalloc(&pdev->dev, config->pwr_reg_cnt, sizeof(hdmi->pwr_regs[0]), @@ -409,6 +396,48 @@ static void msm_hdmi_dev_remove(struct platform_device= *pdev) msm_hdmi_put_phy(hdmi); } =20 +static int msm_hdmi_runtime_suspend(struct device *dev) +{ + struct hdmi *hdmi =3D dev_get_drvdata(dev); + const struct hdmi_platform_config *config =3D hdmi->config; + + clk_bulk_disable_unprepare(config->hpd_clk_cnt, hdmi->hpd_clks); + + pinctrl_pm_select_sleep_state(dev); + + regulator_bulk_disable(config->pwr_reg_cnt, hdmi->pwr_regs); + + return 0; +} + +static int msm_hdmi_runtime_resume(struct device *dev) +{ + struct hdmi *hdmi =3D dev_get_drvdata(dev); + const struct hdmi_platform_config *config =3D hdmi->config; + int ret; + + ret =3D regulator_bulk_enable(config->pwr_reg_cnt, hdmi->pwr_regs); + if (ret) + return ret; + + ret =3D pinctrl_pm_select_default_state(dev); + if (ret) + goto fail; + + ret =3D clk_bulk_prepare_enable(config->hpd_clk_cnt, hdmi->hpd_clks); + if (ret) + goto fail; + + return 0; + +fail: + pinctrl_pm_select_sleep_state(dev); + + return ret; +} + +DEFINE_RUNTIME_DEV_PM_OPS(msm_hdmi_pm_ops, msm_hdmi_runtime_suspend, msm_h= dmi_runtime_resume, NULL); + static const struct of_device_id msm_hdmi_dt_match[] =3D { { .compatible =3D "qcom,hdmi-tx-8998", .data =3D &hdmi_tx_8974_config }, { .compatible =3D "qcom,hdmi-tx-8996", .data =3D &hdmi_tx_8974_config }, @@ -426,6 +455,7 @@ static struct platform_driver msm_hdmi_driver =3D { .driver =3D { .name =3D "hdmi_msm", .of_match_table =3D msm_hdmi_dt_match, + .pm =3D &msm_hdmi_pm_ops, }, }; =20 diff --git a/drivers/gpu/drm/msm/hdmi/hdmi.h b/drivers/gpu/drm/msm/hdmi/hdm= i.h index 3f87535bcf43e20f0618d3016307fe1642d7baf9..7e3c035cf913d713ed63379a843= 897fad96b23ab 100644 --- a/drivers/gpu/drm/msm/hdmi/hdmi.h +++ b/drivers/gpu/drm/msm/hdmi/hdmi.h @@ -47,7 +47,6 @@ struct hdmi { void __iomem *qfprom_mmio; phys_addr_t mmio_phy_addr; =20 - struct regulator_bulk_data *hpd_regs; struct regulator_bulk_data *pwr_regs; struct clk_bulk_data *hpd_clks; struct clk *extp_clk; @@ -83,10 +82,6 @@ struct hdmi { =20 /* platform config data (ie. from DT, or pdata) */ struct hdmi_platform_config { - /* regulators that need to be on for hpd: */ - const char * const *hpd_reg_names; - int hpd_reg_cnt; - /* regulators that need to be on for screen pwr: */ const char * const *pwr_reg_names; int pwr_reg_cnt; diff --git a/drivers/gpu/drm/msm/hdmi/hdmi_bridge.c b/drivers/gpu/drm/msm/h= dmi/hdmi_bridge.c index d7d5d3755fb853377aa999e2a830debf54afe984..fedcefbf53d1d8d53a4882a5454= 27f5ce6570a76 100644 --- a/drivers/gpu/drm/msm/hdmi/hdmi_bridge.c +++ b/drivers/gpu/drm/msm/hdmi/hdmi_bridge.c @@ -18,15 +18,10 @@ static void msm_hdmi_power_on(struct drm_bridge *bridge) struct drm_device *dev =3D bridge->dev; struct hdmi_bridge *hdmi_bridge =3D to_hdmi_bridge(bridge); struct hdmi *hdmi =3D hdmi_bridge->hdmi; - const struct hdmi_platform_config *config =3D hdmi->config; int ret; =20 pm_runtime_resume_and_get(&hdmi->pdev->dev); =20 - ret =3D regulator_bulk_enable(config->pwr_reg_cnt, hdmi->pwr_regs); - if (ret) - DRM_DEV_ERROR(dev->dev, "failed to enable pwr regulator: %d\n", ret); - if (hdmi->extp_clk) { DBG("pixclock: %lu", hdmi->pixclock); ret =3D clk_set_rate(hdmi->extp_clk, hdmi->pixclock); @@ -41,11 +36,8 @@ static void msm_hdmi_power_on(struct drm_bridge *bridge) =20 static void power_off(struct drm_bridge *bridge) { - struct drm_device *dev =3D bridge->dev; struct hdmi_bridge *hdmi_bridge =3D to_hdmi_bridge(bridge); struct hdmi *hdmi =3D hdmi_bridge->hdmi; - const struct hdmi_platform_config *config =3D hdmi->config; - int ret; =20 /* TODO do we need to wait for final vblank somewhere before * cutting the clocks? @@ -55,10 +47,6 @@ static void power_off(struct drm_bridge *bridge) if (hdmi->extp_clk) clk_disable_unprepare(hdmi->extp_clk); =20 - ret =3D regulator_bulk_disable(config->pwr_reg_cnt, hdmi->pwr_regs); - if (ret) - DRM_DEV_ERROR(dev->dev, "failed to disable pwr regulator: %d\n", ret); - pm_runtime_put(&hdmi->pdev->dev); } =20 diff --git a/drivers/gpu/drm/msm/hdmi/hdmi_hpd.c b/drivers/gpu/drm/msm/hdmi= /hdmi_hpd.c index d77c68914c5f525cf12971c1058b1abc33792b24..a42ed26a5b7c7d916d543aa2920= 754347903062a 100644 --- a/drivers/gpu/drm/msm/hdmi/hdmi_hpd.c +++ b/drivers/gpu/drm/msm/hdmi/hdmi_hpd.c @@ -64,36 +64,17 @@ int msm_hdmi_hpd_enable(struct drm_bridge *bridge) { struct hdmi_bridge *hdmi_bridge =3D to_hdmi_bridge(bridge); struct hdmi *hdmi =3D hdmi_bridge->hdmi; - const struct hdmi_platform_config *config =3D hdmi->config; struct device *dev =3D &hdmi->pdev->dev; uint32_t hpd_ctrl; int ret; unsigned long flags; =20 - ret =3D regulator_bulk_enable(config->hpd_reg_cnt, hdmi->hpd_regs); - if (ret) { - DRM_DEV_ERROR(dev, "failed to enable hpd regulators: %d\n", ret); - goto fail; - } - - ret =3D pinctrl_pm_select_default_state(dev); - if (ret) { - DRM_DEV_ERROR(dev, "pinctrl state chg failed: %d\n", ret); - goto fail; - } - if (hdmi->hpd_gpiod) gpiod_set_value_cansleep(hdmi->hpd_gpiod, 1); =20 ret =3D pm_runtime_resume_and_get(dev); - if (ret) { - DRM_DEV_ERROR(dev, "runtime resume failed: %d\n", ret); - goto fail; - } - - ret =3D clk_bulk_prepare_enable(config->hpd_clk_cnt, hdmi->hpd_clks); if (ret) - goto fail; + return ret; =20 msm_hdmi_set_mode(hdmi, false); msm_hdmi_phy_reset(hdmi); @@ -119,32 +100,18 @@ int msm_hdmi_hpd_enable(struct drm_bridge *bridge) spin_unlock_irqrestore(&hdmi->reg_lock, flags); =20 return 0; - -fail: - return ret; } =20 void msm_hdmi_hpd_disable(struct hdmi *hdmi) { - const struct hdmi_platform_config *config =3D hdmi->config; struct device *dev =3D &hdmi->pdev->dev; - int ret; =20 /* Disable HPD interrupt */ hdmi_write(hdmi, REG_HDMI_HPD_INT_CTRL, 0); =20 msm_hdmi_set_mode(hdmi, false); =20 - clk_bulk_disable_unprepare(config->hpd_clk_cnt, hdmi->hpd_clks); pm_runtime_put(dev); - - ret =3D pinctrl_pm_select_sleep_state(dev); - if (ret) - dev_warn(dev, "pinctrl state chg failed: %d\n", ret); - - ret =3D regulator_bulk_disable(config->hpd_reg_cnt, hdmi->hpd_regs); - if (ret) - dev_warn(dev, "failed to disable hpd regulator: %d\n", ret); } =20 void msm_hdmi_hpd_irq(struct drm_bridge *bridge) @@ -179,7 +146,6 @@ void msm_hdmi_hpd_irq(struct drm_bridge *bridge) =20 static enum drm_connector_status detect_reg(struct hdmi *hdmi) { - const struct hdmi_platform_config *config =3D hdmi->config; u32 hpd_int_status =3D 0; int ret; =20 @@ -187,14 +153,8 @@ static enum drm_connector_status detect_reg(struct hdm= i *hdmi) if (ret) goto out; =20 - ret =3D clk_bulk_prepare_enable(config->hpd_clk_cnt, hdmi->hpd_clks); - if (ret) - goto out; - hpd_int_status =3D hdmi_read(hdmi, REG_HDMI_HPD_INT_STATUS); =20 - clk_bulk_disable_unprepare(config->hpd_clk_cnt, hdmi->hpd_clks); - out: pm_runtime_put(&hdmi->pdev->dev); =20 --=20 2.39.5 From nobody Fri Dec 19 06:34:31 2025 Received: from mail-lf1-f49.google.com (mail-lf1-f49.google.com [209.85.167.49]) (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 D38A8192B84 for ; Sun, 9 Feb 2025 05:07:13 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.167.49 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1739077635; cv=none; b=q/c5XDZ7oSpeFbZtGSuGZrsE/vpuSSP3tl9VgHsLxQwl70kzkuSvWfwrTeq0dgSM4RZsLd1NZnIVKV3PhhcaHwYJv2Q2Cx8U2jAw4XvRsN7+SRrZ0TEh39gpCYPFJZ7PT5S4De6oTxoQbDdHhNqxjlpVozi0pDsiPm8zT1z/Kko= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1739077635; c=relaxed/simple; bh=+WpYll0ay0xnF4O7o5nyBXY9cEIfu8gX+WDGXWRK1Mc=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=MF0CXJhi4GFlMZ8/G/67FAojxMuQybJcwb8PnFMaiuvY7t3YAefr3VDAV5PPYXMmcGGKqhYYcHCk0lI9IaEGg18TodMnpw+vLAQsQl4KgVN5o9YLjdGNjHy4/huyXgbxaPmr7ciPNG+iTo0lJh058FRithWLgtXefjkjxbIy9as= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org; spf=pass smtp.mailfrom=linaro.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b=jayohbsV; arc=none smtp.client-ip=209.85.167.49 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linaro.org Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="jayohbsV" Received: by mail-lf1-f49.google.com with SMTP id 2adb3069b0e04-545074b88aaso562961e87.3 for ; Sat, 08 Feb 2025 21:07:13 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1739077632; x=1739682432; darn=vger.kernel.org; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:from:to:cc:subject:date:message-id :reply-to; bh=rImDBJcwLqN/bA8K9yZBJSkxES6sl/gp3TQ1UcsOkUQ=; b=jayohbsVHQCL1OJoTXhTc7Ji7N3Iw3f0Vq1mKaEXtqHbC5B1R2DwfQzJ4KzaI4pII1 TGoEuwqfyBIpWsO36jInLM1OwfgMZl3Vk00f2CSNXLoUfndIbgQ0TTiH50/i2sUGp5ex XZTLJpHUv0KsmpjHjKDcfu2J6W1xsl9+lQdkyt7kix4VTc/cm69E+WIlqRJNHijAdZog FrpOOsu/jolP6kjFp6mGqgcQxZ6Cmo97w10pkOMWGMDFf9aXAlZwT+KG9eIG/mhj7WpG w9Q/xt6mE86+wQ0aWT9nr3tDzdjblrZ+bdIboA35e1vA/eFKDAaH7juL7+UCHPItUa+V C1Xg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1739077632; x=1739682432; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=rImDBJcwLqN/bA8K9yZBJSkxES6sl/gp3TQ1UcsOkUQ=; b=nFoxIEMYjpqC0tRePYnsPlrooPZlYymJs5o5kc7CW+EGLVKFKzMmksF3st0zOjcTXa jFq3uGWQitHzzOuZ1vW3yRnP7QXRhZuXuOdHJdZhTLTp3uPa49I9QI5sizDJ9NULnugy j1sOiIQ4LgXF73XwiqjpxS2aDTMRPNEiMyuy6IuyXGXUUdCXnhczXNVQenRs5adol0Hl Y80FUCYnrt6KO7KU/dBkVuT6wFhcIjmjSz87pSlWrm7XUzeXZutGqpFZguUs4jAw578Z Y5StvtR24vAHZxzd4qow5SHMZVFpei+JQ3coAYOWOzSrb8alM8TrHS5+8OtMQ3cMaLEm fNUw== X-Forwarded-Encrypted: i=1; AJvYcCXbmulJyGlzJXNdmyDvItRLtA7m4LwqhFXgz4Ek33rbXVXNEPcI+xGEshOc8mgrxKFlElzlc1LoIwHaCwc=@vger.kernel.org X-Gm-Message-State: AOJu0Yx6A4aPGkFt+qsuBi1agct/JWyimzzfCuBJaFjMDR88LdW8oXDp ggQIRbd3KaqZIHFFGnw4jZTHfXOOiLu+e09rBjsX8IRej3EEqRBR3dNAl5gfZ7A= X-Gm-Gg: ASbGncs7NGWfv4TCVaAKM/5M1hWY8C1L/KxNJBYAzhM1zxvDbovyiuw9LnyvvBu2fHc iUYa1VWgel4e7UKQ/W2eSKBUQqFMaBbuqZDwrGZBCH3Dl11bhGfabYuKLAbGeC1MaTyCBJYz6gy BPBtGFlnxdcgwvlHwpLgBwtoZJK6VB0Kpm273zRyEFRbtsdG4xvaPR9EmaoUUsvp3j5TtNA60ZW +lhlJkxmmMpxmBefSng18jsDqnLuQCTI0p0hP1GN8QhwvvkhQsd7GmmIniyFhZxoQ/brOnuFeKu lmpN0/mfmrdAkG+C1emzhNs= X-Google-Smtp-Source: AGHT+IE2QJZGzfLvREQjZ2Yj5CakhCNV2ut93H8ain0VcaXqhSAifxC/qDGCZKxvSJtMnQOIOHh9hQ== X-Received: by 2002:a19:8c55:0:b0:545:441:52d4 with SMTP id 2adb3069b0e04-5450441553dmr1026473e87.26.1739077631945; Sat, 08 Feb 2025 21:07:11 -0800 (PST) Received: from umbar.lan ([192.130.178.90]) by smtp.gmail.com with ESMTPSA id 2adb3069b0e04-54506ef1733sm245576e87.1.2025.02.08.21.07.09 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 08 Feb 2025 21:07:10 -0800 (PST) From: Dmitry Baryshkov Date: Sun, 09 Feb 2025 07:04:55 +0200 Subject: [PATCH v4 11/16] drm/msm/hdmi: rename hpd_clks to pwr_clks Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Message-Id: <20250209-fd-hdmi-hpd-v4-11-6224568ed87f@linaro.org> References: <20250209-fd-hdmi-hpd-v4-0-6224568ed87f@linaro.org> In-Reply-To: <20250209-fd-hdmi-hpd-v4-0-6224568ed87f@linaro.org> To: Rob Clark , Abhinav Kumar , Sean Paul , Marijn Suijten , David Airlie , Simona Vetter , Maarten Lankhorst , Maxime Ripard , Thomas Zimmermann , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Bjorn Andersson , Konrad Dybcio , Simona Vetter Cc: linux-arm-msm@vger.kernel.org, dri-devel@lists.freedesktop.org, freedreno@lists.freedesktop.org, linux-kernel@vger.kernel.org, devicetree@vger.kernel.org, Jessica Zhang X-Mailer: b4 0.14.2 X-Developer-Signature: v=1; a=openpgp-sha256; l=4084; i=dmitry.baryshkov@linaro.org; h=from:subject:message-id; bh=+WpYll0ay0xnF4O7o5nyBXY9cEIfu8gX+WDGXWRK1Mc=; b=owEBbQGS/pANAwAKAYs8ij4CKSjVAcsmYgBnqDfjf8OBc8uSGwCTBq4PbhEA1GDOaqya+TI2F VrQN8it+xKJATMEAAEKAB0WIQRMcISVXLJjVvC4lX+LPIo+Aiko1QUCZ6g34wAKCRCLPIo+Aiko 1WmrCACsjaJLkXpv4v5MNIIXG7ds98d+aS/Ra33MbEb/9rTGuEBP8CIdMTldJfwvQfHRoNnJCMI A/j+3tq2UuhxUrLtxzo9NC2I0hI2BTZ55dOQPgn1ou3bqJiXzwaJ37XA9+vu4hAkpZ6L33xB6DE A119TuMSildDZgGfpg6fmxNmZHOIEa6cg1COY+UcpNKOp/QlQU01BMCzifnmBW441EgV+yPufpL AMB2jTVSlke2qeSPU1QkNyhgnOG5X9RIMGQXfOiXhJ/CKUNiUXFLUITYNiVMdjYof8nnLs5xhOf 4P/QTx1Hq89+lFKvj0L9A3arcHDUkAmQQrlf5dcdJSnr+LWB X-Developer-Key: i=dmitry.baryshkov@linaro.org; a=openpgp; fpr=8F88381DD5C873E4AE487DA5199BF1243632046A As these clocks are now used in the runtime PM callbacks, they have no connection to 'HPD'. Rename corresponding fields to follow clocks purpose, to power up the HDMI controller. Reviewed-by: Jessica Zhang Signed-off-by: Dmitry Baryshkov --- drivers/gpu/drm/msm/hdmi/hdmi.c | 26 +++++++++++++------------- drivers/gpu/drm/msm/hdmi/hdmi.h | 6 +++--- 2 files changed, 16 insertions(+), 16 deletions(-) diff --git a/drivers/gpu/drm/msm/hdmi/hdmi.c b/drivers/gpu/drm/msm/hdmi/hdm= i.c index ded20176aa805db98b0599e617eb6ea9bce122d8..8e6e3e6a04bd2d86bcbd23c110f= 3533f56c17887 100644 --- a/drivers/gpu/drm/msm/hdmi/hdmi.c +++ b/drivers/gpu/drm/msm/hdmi/hdmi.c @@ -226,19 +226,19 @@ int msm_hdmi_modeset_init(struct hdmi *hdmi, .item ## _cnt =3D ARRAY_SIZE(item ## _names_ ## entry) =20 static const char * const pwr_reg_names_8960[] =3D {"core-vdda"}; -static const char * const hpd_clk_names_8960[] =3D {"core", "master_iface"= , "slave_iface"}; +static const char * const pwr_clk_names_8960[] =3D {"core", "master_iface"= , "slave_iface"}; =20 static const struct hdmi_platform_config hdmi_tx_8960_config =3D { HDMI_CFG(pwr_reg, 8960), - HDMI_CFG(hpd_clk, 8960), + HDMI_CFG(pwr_clk, 8960), }; =20 static const char * const pwr_reg_names_8x74[] =3D {"core-vdda", "core-vcc= "}; -static const char * const hpd_clk_names_8x74[] =3D {"iface", "core", "mdp_= core", "alt_iface"}; +static const char * const pwr_clk_names_8x74[] =3D {"iface", "core", "mdp_= core", "alt_iface"}; =20 static const struct hdmi_platform_config hdmi_tx_8974_config =3D { HDMI_CFG(pwr_reg, 8x74), - HDMI_CFG(hpd_clk, 8x74), + HDMI_CFG(pwr_clk, 8x74), }; =20 static int msm_hdmi_bind(struct device *dev, struct device *master, void *= data) @@ -333,17 +333,17 @@ static int msm_hdmi_dev_probe(struct platform_device = *pdev) if (ret) return dev_err_probe(dev, ret, "failed to get pwr regulators\n"); =20 - hdmi->hpd_clks =3D devm_kcalloc(&pdev->dev, - config->hpd_clk_cnt, - sizeof(hdmi->hpd_clks[0]), + hdmi->pwr_clks =3D devm_kcalloc(&pdev->dev, + config->pwr_clk_cnt, + sizeof(hdmi->pwr_clks[0]), GFP_KERNEL); - if (!hdmi->hpd_clks) + if (!hdmi->pwr_clks) return -ENOMEM; =20 - for (i =3D 0; i < config->hpd_clk_cnt; i++) - hdmi->hpd_clks[i].id =3D config->hpd_clk_names[i]; + for (i =3D 0; i < config->pwr_clk_cnt; i++) + hdmi->pwr_clks[i].id =3D config->pwr_clk_names[i]; =20 - ret =3D devm_clk_bulk_get(&pdev->dev, config->hpd_clk_cnt, hdmi->hpd_clks= ); + ret =3D devm_clk_bulk_get(&pdev->dev, config->pwr_clk_cnt, hdmi->pwr_clks= ); if (ret) return ret; =20 @@ -401,7 +401,7 @@ static int msm_hdmi_runtime_suspend(struct device *dev) struct hdmi *hdmi =3D dev_get_drvdata(dev); const struct hdmi_platform_config *config =3D hdmi->config; =20 - clk_bulk_disable_unprepare(config->hpd_clk_cnt, hdmi->hpd_clks); + clk_bulk_disable_unprepare(config->pwr_clk_cnt, hdmi->pwr_clks); =20 pinctrl_pm_select_sleep_state(dev); =20 @@ -424,7 +424,7 @@ static int msm_hdmi_runtime_resume(struct device *dev) if (ret) goto fail; =20 - ret =3D clk_bulk_prepare_enable(config->hpd_clk_cnt, hdmi->hpd_clks); + ret =3D clk_bulk_prepare_enable(config->pwr_clk_cnt, hdmi->pwr_clks); if (ret) goto fail; =20 diff --git a/drivers/gpu/drm/msm/hdmi/hdmi.h b/drivers/gpu/drm/msm/hdmi/hdm= i.h index 7e3c035cf913d713ed63379a843897fad96b23ab..a28437beb1574553c1dc00a0c69= 3b390389353e0 100644 --- a/drivers/gpu/drm/msm/hdmi/hdmi.h +++ b/drivers/gpu/drm/msm/hdmi/hdmi.h @@ -48,7 +48,7 @@ struct hdmi { phys_addr_t mmio_phy_addr; =20 struct regulator_bulk_data *pwr_regs; - struct clk_bulk_data *hpd_clks; + struct clk_bulk_data *pwr_clks; struct clk *extp_clk; =20 struct gpio_desc *hpd_gpiod; @@ -87,8 +87,8 @@ struct hdmi_platform_config { int pwr_reg_cnt; =20 /* clks that need to be on for hpd: */ - const char * const *hpd_clk_names; - int hpd_clk_cnt; + const char * const *pwr_clk_names; + int pwr_clk_cnt; }; =20 struct hdmi_bridge { --=20 2.39.5 From nobody Fri Dec 19 06:34:31 2025 Received: from mail-lf1-f49.google.com (mail-lf1-f49.google.com [209.85.167.49]) (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 507C419D07C for ; Sun, 9 Feb 2025 05:07:16 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.167.49 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1739077640; cv=none; b=VYL2qLPEdKc09bsLRoZGO3g6ESUFSs7dKTsccNU2daOIcAURLbnlWZvI/SRHbqKgISOYAw42nC6krfBEt0gQq3SiN2/TrMVV61vLl4Cp3dtvgu1Qf1OL+A0WdJUV/xhTfqv9rK4t6saRnn21DJO2kF23FmDTF+bG+GS0TjYDn3Y= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1739077640; c=relaxed/simple; bh=7KB7IcHxi0VqX9I5ufq901Xoeq2I7R2imjBgnmx5DoY=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=OBK3v7YJn6XSwGocgvQLq2iWgVucnZ/YPwkcg2WytHEg3VCSOWxpUChOsrO67ZI7qgMjsawxxv4bPEOWRLNeFgWq3v9oUsBuH/z4XLcH3MuxWQlvzbTrCCYKi0Z82xIHs19x2QNULnNKsu5f8tzJq1vI9mQnVk0yjul0Zk1Yb2g= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org; spf=pass smtp.mailfrom=linaro.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b=FThBDY1U; arc=none smtp.client-ip=209.85.167.49 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linaro.org Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="FThBDY1U" Received: by mail-lf1-f49.google.com with SMTP id 2adb3069b0e04-545097ff67cso170973e87.2 for ; Sat, 08 Feb 2025 21:07:15 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1739077634; x=1739682434; darn=vger.kernel.org; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:from:to:cc:subject:date:message-id :reply-to; bh=hlPHSmm8yEMkPCpLMXSlS5GXe/d+EX9J4C1uXL4gVw4=; b=FThBDY1UlKtblGbTSXV9L2F63W7zW2GJ4SilXFOZp6rmJj/D9VBpA8mP2f6aF37XsH t9zvGG4ADp+7v62hTkGple1B6ipxeHrR+hhOp8RQDcTFZZ2rl7mEYuOKEoADOxWG9V0L XfyvM0o0t1wD8E8bQF1Jxrpct8Gke/T15VmEYk+uXwX+xdAXoww7py8zObuB9Bsa6F69 G4dYFAdBSJpCwgZQVSs+X6Y85MFGSrLyTd1Z5fENB/SmTamNdjLzjeO6JqZ4FSFTIYRq /t0DYQ+OUsdiPHOGOnx/aOnnNYRAPHUO7MF4qSOlJEIyEhrL9dlYTlkHjHfrC1XDPZvn Hifg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1739077634; x=1739682434; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=hlPHSmm8yEMkPCpLMXSlS5GXe/d+EX9J4C1uXL4gVw4=; b=rYU6e4zpMpfOWUsnH+owgA1LnhOGIul9uF8tZT1lbndI3/5Kthv13XwN/YpPSwLdUB HWXwUZURJmLKbUp/bZbYI9yg3o/JTgZ6+0utA/IVTL5EtgY34jWhzTXDHOxf4o3qkXmy H4gzZPz3JvaMw4FAk7N0IPXJFfP8UgPY+I3+qfpTMAN8tkiJLYS9Q3nU+xshubCB/z9/ DAEoIWYt5aEG8p3XjkDstvldFAMwfTAxBzxxMsj+X4tFPyHcLnhtyRke3Pq+oRud1SPl 0Ro7RYXHUEAFalH6JJyDx5or6eKwu7C8U3zHbvw/eX+A9vZIgldvWqBZoTAph/BydLss WzfA== X-Forwarded-Encrypted: i=1; AJvYcCUTf1Da1TaTLR/9NefbR9TrvTZqTPRuvIfFM4GIXSoohx986Jr94RI923E9VZKQ0U4/ys1shdljd/Qe9uw=@vger.kernel.org X-Gm-Message-State: AOJu0YxA957HqOOGs3nd4zNN1NfBZLkmfv/CqMJKOUi9FvACwAOSbqCL puYv1qaLlEcGhUZp33WWP1ZgHRtdCFxnoddQgXnfb51JTdynCG5qa33nngJkOQA= X-Gm-Gg: ASbGncvqZa4FLj/mJLELHBwLvc/jNt0b5WCNWjxf6z1xBTuKzLsuh1WfRv3JXLji0OB ENahy9zb0jlolaR4Ql7Kv5Pe5q8wxRACr5Yzmh4w69iS8NOqmPC9U8IJY8WnOV+3m9ak6dFvjCT vJ1rmjRzMgv6m6P92dlW7Lz2ubQ6fcGU/W1rS64taMEPUhQjunOfEXk+LP5003DH6k7px43lOPz oEfSp1oVlOnE0mjXlXcskQKmGOauTBZyTrJWL2lPlz5JUnpdZOnO06RwjubjkAexCDwSjp4Osyo DpcRn4lSCd9//YZ2J1emOxQ= X-Google-Smtp-Source: AGHT+IEd6dicvlKdQV2rRsUxtxE28CChSKCpQgVen389uSlji8/jD6oj/iczUy7fpLXBwrzv/IwjKQ== X-Received: by 2002:a05:6512:2399:b0:544:ee5:87b0 with SMTP id 2adb3069b0e04-54414a96604mr3354167e87.3.1739077634302; Sat, 08 Feb 2025 21:07:14 -0800 (PST) Received: from umbar.lan ([192.130.178.90]) by smtp.gmail.com with ESMTPSA id 2adb3069b0e04-54506ef1733sm245576e87.1.2025.02.08.21.07.12 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 08 Feb 2025 21:07:13 -0800 (PST) From: Dmitry Baryshkov Date: Sun, 09 Feb 2025 07:04:56 +0200 Subject: [PATCH v4 12/16] drm/msm/hdmi: expand the HDMI_CFG macro Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Message-Id: <20250209-fd-hdmi-hpd-v4-12-6224568ed87f@linaro.org> References: <20250209-fd-hdmi-hpd-v4-0-6224568ed87f@linaro.org> In-Reply-To: <20250209-fd-hdmi-hpd-v4-0-6224568ed87f@linaro.org> To: Rob Clark , Abhinav Kumar , Sean Paul , Marijn Suijten , David Airlie , Simona Vetter , Maarten Lankhorst , Maxime Ripard , Thomas Zimmermann , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Bjorn Andersson , Konrad Dybcio , Simona Vetter Cc: linux-arm-msm@vger.kernel.org, dri-devel@lists.freedesktop.org, freedreno@lists.freedesktop.org, linux-kernel@vger.kernel.org, devicetree@vger.kernel.org, Jessica Zhang X-Mailer: b4 0.14.2 X-Developer-Signature: v=1; a=openpgp-sha256; l=2467; i=dmitry.baryshkov@linaro.org; h=from:subject:message-id; bh=7KB7IcHxi0VqX9I5ufq901Xoeq2I7R2imjBgnmx5DoY=; b=owEBbQGS/pANAwAKAYs8ij4CKSjVAcsmYgBnqDfjFlNku8IROPqumZ4E4rIS6xVD6X6WWajZV tgiLp+pqdCJATMEAAEKAB0WIQRMcISVXLJjVvC4lX+LPIo+Aiko1QUCZ6g34wAKCRCLPIo+Aiko 1XtACACmQHPvaloVCRw6WqW1+yRfCCOJWikCAcXTkM4JJ5bJUFfsy1jAtNccjkUo3nJxp/p+GNL Y9hsOLA5Pc2IUQ7X+8EaioPypvW6QelbfocUaIB7nlut86mqKsx7Bk8mB+xRWBgCyUTiUH+i9Gs QzYz9wWCSdM+ZyY6WFc+RD6QNPD+NHQ+eYtbfWr7BLYyH4yZfnYGi6tpnj76ocxpFo1AVHEYPhd B416qy+4Kmw0nFo4RtXec2GOy8UlCuL3msGn0w4yUxM4cVWTN1G+WIbBlql5toxz5913vWTjOMM 2EEO4x9dTVVWOZShs1WwynUZ5ECsFQruxJivyWRpz/iJo2dn X-Developer-Key: i=dmitry.baryshkov@linaro.org; a=openpgp; fpr=8F88381DD5C873E4AE487DA5199BF1243632046A Expand the HDMI_CFG() macro in HDMI config description. It has no added value other than hiding some boilerplate declarations. Reviewed-by: Jessica Zhang Signed-off-by: Dmitry Baryshkov --- drivers/gpu/drm/msm/hdmi/hdmi.c | 16 ++++++++-------- drivers/gpu/drm/msm/hdmi/hdmi.h | 2 +- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/drivers/gpu/drm/msm/hdmi/hdmi.c b/drivers/gpu/drm/msm/hdmi/hdm= i.c index 8e6e3e6a04bd2d86bcbd23c110f3533f56c17887..3d10fe6f8545198365a047b2f56= 52081703101aa 100644 --- a/drivers/gpu/drm/msm/hdmi/hdmi.c +++ b/drivers/gpu/drm/msm/hdmi/hdmi.c @@ -221,24 +221,24 @@ int msm_hdmi_modeset_init(struct hdmi *hdmi, * The hdmi device: */ =20 -#define HDMI_CFG(item, entry) \ - .item ## _names =3D item ##_names_ ## entry, \ - .item ## _cnt =3D ARRAY_SIZE(item ## _names_ ## entry) - static const char * const pwr_reg_names_8960[] =3D {"core-vdda"}; static const char * const pwr_clk_names_8960[] =3D {"core", "master_iface"= , "slave_iface"}; =20 static const struct hdmi_platform_config hdmi_tx_8960_config =3D { - HDMI_CFG(pwr_reg, 8960), - HDMI_CFG(pwr_clk, 8960), + .pwr_reg_names =3D pwr_reg_names_8960, + .pwr_reg_cnt =3D ARRAY_SIZE(pwr_reg_names_8960), + .pwr_clk_names =3D pwr_clk_names_8960, + .pwr_clk_cnt =3D ARRAY_SIZE(pwr_clk_names_8960), }; =20 static const char * const pwr_reg_names_8x74[] =3D {"core-vdda", "core-vcc= "}; static const char * const pwr_clk_names_8x74[] =3D {"iface", "core", "mdp_= core", "alt_iface"}; =20 static const struct hdmi_platform_config hdmi_tx_8974_config =3D { - HDMI_CFG(pwr_reg, 8x74), - HDMI_CFG(pwr_clk, 8x74), + .pwr_reg_names =3D pwr_reg_names_8x74, + .pwr_reg_cnt =3D ARRAY_SIZE(pwr_reg_names_8x74), + .pwr_clk_names =3D pwr_clk_names_8x74, + .pwr_clk_cnt =3D ARRAY_SIZE(pwr_clk_names_8x74), }; =20 static int msm_hdmi_bind(struct device *dev, struct device *master, void *= data) diff --git a/drivers/gpu/drm/msm/hdmi/hdmi.h b/drivers/gpu/drm/msm/hdmi/hdm= i.h index a28437beb1574553c1dc00a0c693b390389353e0..fb64652162b6c5e6e2fe3357b89= c40e2a28aa47e 100644 --- a/drivers/gpu/drm/msm/hdmi/hdmi.h +++ b/drivers/gpu/drm/msm/hdmi/hdmi.h @@ -86,7 +86,7 @@ struct hdmi_platform_config { const char * const *pwr_reg_names; int pwr_reg_cnt; =20 - /* clks that need to be on for hpd: */ + /* clks that need to be on: */ const char * const *pwr_clk_names; int pwr_clk_cnt; }; --=20 2.39.5 From nobody Fri Dec 19 06:34:31 2025 Received: from mail-lf1-f47.google.com (mail-lf1-f47.google.com [209.85.167.47]) (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 9FB961A314B for ; Sun, 9 Feb 2025 05:07:18 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.167.47 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1739077640; cv=none; b=LFpxNNvlLbJhiPhrC19aelQvYJdYz+YawtYarqrTClxc6lwS+F8EBDwUXPrXGw4ClB0gTEh2clhwbPo3W9XJYup9DlKAZ/Rg676AiJ7grX1EowdZ21D257kIVduMCqPRpKGPrEUEjTfd5uQJ6AX+qtUaDsmAmv3G3SxYWd6T06g= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1739077640; c=relaxed/simple; bh=bHZ+8WYzHrJJ+NgSrs9nDogjdV+FFAB38y+PAaB4SrI=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=il7dunjal0/ZpzofkhDqscr3WiPTlRAbVjGjx4b/t0RiGus836yD69kIl/WLU0nCflZaeX9Z1P7l+ZitrilMFhZ2iGCFzn86pf/rMhdbHXoB1fJeuylklA2Hz5+IHcu8wSRCRd/IWwBLm700pb75b0SuUhiQXt9EWIMm304s+Ik= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org; spf=pass smtp.mailfrom=linaro.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b=O9mUo8Yt; arc=none smtp.client-ip=209.85.167.47 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linaro.org Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="O9mUo8Yt" Received: by mail-lf1-f47.google.com with SMTP id 2adb3069b0e04-5450475df18so1029942e87.2 for ; Sat, 08 Feb 2025 21:07:18 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1739077637; x=1739682437; darn=vger.kernel.org; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:from:to:cc:subject:date:message-id :reply-to; bh=wQN0+9Nxsmop3hssFFkRG5gm+YC2hGLzkxVXuFrHYbk=; b=O9mUo8YtLvaQ8oUFOnZuFfyueJjgycDmaeA/Q4mFeAL0ldukJNJ1hs+fYa4QbIhD2k /iz0+0eA+thQPCfq+Lj7Bfpr7mee1w4SXMsJW6wUtplHArR8jlD7ytckmB3RJDke1IGF a30vLy2Ww5b/3fcvwXgfahh9O3nJC18zGJpmnyNFciMaHHNj7pbX21t/I3KNy54kVLmB BeyouoJx8puFJO1Ggj08vtW1xnliWfVYCsylUQ7TV1ay9K0+G3Qu/HMTxAHTFw29bfcJ SPypxHh8zs21MNo7dRO37QSlz6uCahVUqwFkv5P45oeuAp79E1WCAKcd2STtHorpbM73 p+nw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1739077637; x=1739682437; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=wQN0+9Nxsmop3hssFFkRG5gm+YC2hGLzkxVXuFrHYbk=; b=cpepap8+/vQ8uDw/yUg7lRX599YOxi97YxmS3WwPmOb7UrZfhnFEVFU12EMEyET0jQ v4j1FA7XGjbGo69d1ZwbkTt15GylW5EATvBOn9hTYe7OCB90i8I3lLr1ftla1cb693Bj jh5j/Hwdg2tcr7x+xNwkFwhbmubj9V3qyiCiD+6bCuRJui+Op09ezV+f/iqMO7QXlN0q OKQ69CTYdfjHDQ80tNHsBbEYon0PZQMt4U4veovh8XPDXVTC/HhNtIg6dsSdc7d6b7fr PslVcD/N75RmB/M8KqexH5wnvjKdLXqrO/6QA9odTgfk7ofXQ9IPoHnc/aGZaTWCOlvO O22A== X-Forwarded-Encrypted: i=1; AJvYcCUqltCemFZW94K6zdnm+1MVp2ZNLU4pzbvQhuRHuqvqj45qLI0lpYa5dwdaLx0Mkzg/p+M/fKN8RL9nR1U=@vger.kernel.org X-Gm-Message-State: AOJu0YySUumg8ukNGO1Q0pFIlTwWVXAiJNYxf2Bhu2fEjbBI7AP4Dsbo MUc9yQjtE9WzlhKYQL+4+rE/gE2XR9jMPHk0zxNNwsPTfyx3M+KDiTdpL+04WMs= X-Gm-Gg: ASbGncvZGSfHJrlGRRU2tZrIkIuKvPxHf7XevImmpIHRZwxAGr9uiF1Lrue5q5JE70M TbSwmI5Bb5NvKBXa7x0ujvazRUqUJytsLFDmZLIxTaGEmy/1VE5yMFG5jPs6TOq/e8taHBxBtV1 0lWT1kUknehkFhZSZJ0fPNjuMakJsONAe2EuV3u5fq6If63iTIYzvZ/F7JHDxW4ceyLZ1DFrxd+ B3YBGgxYdF6RpgnEddBesNe1x40VfxqHsN9paGc8pmVmQ7tOaah5CqTPrcaMLdXJ1Y2V3QCg3dS ZWGdh6CD6z3qzRyxOeQOFOU= X-Google-Smtp-Source: AGHT+IGp/15rtM4WUZVM/z/LrVJYA8lGK9lfX+FXcNamZzHbk22gzs/jyxYxDerRvXrH1oHxGPPxwg== X-Received: by 2002:a05:6512:a8b:b0:545:ba7:26f5 with SMTP id 2adb3069b0e04-5450ba727f9mr21247e87.46.1739077636734; Sat, 08 Feb 2025 21:07:16 -0800 (PST) Received: from umbar.lan ([192.130.178.90]) by smtp.gmail.com with ESMTPSA id 2adb3069b0e04-54506ef1733sm245576e87.1.2025.02.08.21.07.14 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 08 Feb 2025 21:07:15 -0800 (PST) From: Dmitry Baryshkov Date: Sun, 09 Feb 2025 07:04:57 +0200 Subject: [PATCH v4 13/16] drm/msm/hdmi: drop hpd-gpios support Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Message-Id: <20250209-fd-hdmi-hpd-v4-13-6224568ed87f@linaro.org> References: <20250209-fd-hdmi-hpd-v4-0-6224568ed87f@linaro.org> In-Reply-To: <20250209-fd-hdmi-hpd-v4-0-6224568ed87f@linaro.org> To: Rob Clark , Abhinav Kumar , Sean Paul , Marijn Suijten , David Airlie , Simona Vetter , Maarten Lankhorst , Maxime Ripard , Thomas Zimmermann , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Bjorn Andersson , Konrad Dybcio , Simona Vetter Cc: linux-arm-msm@vger.kernel.org, dri-devel@lists.freedesktop.org, freedreno@lists.freedesktop.org, linux-kernel@vger.kernel.org, devicetree@vger.kernel.org, Jessica Zhang X-Mailer: b4 0.14.2 X-Developer-Signature: v=1; a=openpgp-sha256; l=4525; i=dmitry.baryshkov@linaro.org; h=from:subject:message-id; bh=bHZ+8WYzHrJJ+NgSrs9nDogjdV+FFAB38y+PAaB4SrI=; b=owEBbQGS/pANAwAKAYs8ij4CKSjVAcsmYgBnqDfjEbNj1xGsfjY7qcPtcbZDe1Jbntpt8hWtV hNun8j5xyGJATMEAAEKAB0WIQRMcISVXLJjVvC4lX+LPIo+Aiko1QUCZ6g34wAKCRCLPIo+Aiko 1YBbB/45QpIZuxWXosnWOeO5OFPRAW5AOBQIRXJZ52Pls3macQD9qAauDoCLtSI0iEPZ1daMbp3 1OVi92DXGwz97C4/PmsoKMPx5BQwNffqYcI7dNWDKqHloG4VlYE0s1SJa4iuK3MuKTFo8E2mpsS 1YBn+MHA2vVYBmeRywRkL66hJ8cwM1mnj1198W5nPfmHnEmeaVBnu06JNzphQuZ8m1eoMBHKh8A wyqYM8UFd4zJAflGWp6pGBDvF4W4ksxmxT1PPjRRZ1koPeK8qsOyu+t1pjZtswtWuw7Z5jc8GkY P6r9iHbbQoTA+vCKc9bqisiHcxZc8wU3qXxNJYpWV6VRdLN5 X-Developer-Key: i=dmitry.baryshkov@linaro.org; a=openpgp; fpr=8F88381DD5C873E4AE487DA5199BF1243632046A Supporting simultaneous check of native HPD and the external GPIO proved to be less stable than just native HPD. Drop the hpd-gpios support, leaving just the native HPD support. In case the native HPD doesn't work the user is urged to switch to specifying the HPD property to the hdmi-connector device. Reviewed-by: Jessica Zhang Signed-off-by: Dmitry Baryshkov --- drivers/gpu/drm/msm/hdmi/hdmi.c | 14 +++------- drivers/gpu/drm/msm/hdmi/hdmi.h | 2 -- drivers/gpu/drm/msm/hdmi/hdmi_hpd.c | 52 +++------------------------------= ---- 3 files changed, 6 insertions(+), 62 deletions(-) diff --git a/drivers/gpu/drm/msm/hdmi/hdmi.c b/drivers/gpu/drm/msm/hdmi/hdm= i.c index 3d10fe6f8545198365a047b2f5652081703101aa..abe2c9e1df550a36914ed19f51e= 7b86e5d3d24c0 100644 --- a/drivers/gpu/drm/msm/hdmi/hdmi.c +++ b/drivers/gpu/drm/msm/hdmi/hdmi.c @@ -352,17 +352,9 @@ static int msm_hdmi_dev_probe(struct platform_device *= pdev) return dev_err_probe(dev, PTR_ERR(hdmi->extp_clk), "failed to get extp clock\n"); =20 - hdmi->hpd_gpiod =3D devm_gpiod_get_optional(&pdev->dev, "hpd", GPIOD_IN); - /* This will catch e.g. -EPROBE_DEFER */ - if (IS_ERR(hdmi->hpd_gpiod)) - return dev_err_probe(dev, PTR_ERR(hdmi->hpd_gpiod), - "failed to get hpd gpio\n"); - - if (!hdmi->hpd_gpiod) - DBG("failed to get HPD gpio"); - - if (hdmi->hpd_gpiod) - gpiod_set_consumer_name(hdmi->hpd_gpiod, "HDMI_HPD"); + if (of_find_property(dev->of_node, "hpd-gpios", NULL) || + of_find_property(dev->of_node, "hpd-gpio", NULL)) + dev_warn(dev, "hpd-gpios is not supported anymore, please migrate to the= hdmi-connector\n"); =20 ret =3D msm_hdmi_get_phy(hdmi); if (ret) { diff --git a/drivers/gpu/drm/msm/hdmi/hdmi.h b/drivers/gpu/drm/msm/hdmi/hdm= i.h index fb64652162b6c5e6e2fe3357b89c40e2a28aa47e..a40d69ae328ced8b9f7411cf809= a3fa8641dca33 100644 --- a/drivers/gpu/drm/msm/hdmi/hdmi.h +++ b/drivers/gpu/drm/msm/hdmi/hdmi.h @@ -51,8 +51,6 @@ struct hdmi { struct clk_bulk_data *pwr_clks; struct clk *extp_clk; =20 - struct gpio_desc *hpd_gpiod; - struct hdmi_phy *phy; struct device *phy_dev; =20 diff --git a/drivers/gpu/drm/msm/hdmi/hdmi_hpd.c b/drivers/gpu/drm/msm/hdmi= /hdmi_hpd.c index a42ed26a5b7c7d916d543aa2920754347903062a..d63f0fd96f0c00bbe07a13f8ead= 26f05a5133084 100644 --- a/drivers/gpu/drm/msm/hdmi/hdmi_hpd.c +++ b/drivers/gpu/drm/msm/hdmi/hdmi_hpd.c @@ -69,9 +69,6 @@ int msm_hdmi_hpd_enable(struct drm_bridge *bridge) int ret; unsigned long flags; =20 - if (hdmi->hpd_gpiod) - gpiod_set_value_cansleep(hdmi->hpd_gpiod, 1); - ret =3D pm_runtime_resume_and_get(dev); if (ret) return ret; @@ -144,8 +141,10 @@ void msm_hdmi_hpd_irq(struct drm_bridge *bridge) } } =20 -static enum drm_connector_status detect_reg(struct hdmi *hdmi) +enum drm_connector_status msm_hdmi_bridge_detect(struct drm_bridge *bridge) { + struct hdmi_bridge *hdmi_bridge =3D to_hdmi_bridge(bridge); + struct hdmi *hdmi =3D hdmi_bridge->hdmi; u32 hpd_int_status =3D 0; int ret; =20 @@ -161,48 +160,3 @@ static enum drm_connector_status detect_reg(struct hdm= i *hdmi) return (hpd_int_status & HDMI_HPD_INT_STATUS_CABLE_DETECTED) ? connector_status_connected : connector_status_disconnected; } - -#define HPD_GPIO_INDEX 2 -static enum drm_connector_status detect_gpio(struct hdmi *hdmi) -{ - return gpiod_get_value(hdmi->hpd_gpiod) ? - connector_status_connected : - connector_status_disconnected; -} - -enum drm_connector_status msm_hdmi_bridge_detect( - struct drm_bridge *bridge) -{ - struct hdmi_bridge *hdmi_bridge =3D to_hdmi_bridge(bridge); - struct hdmi *hdmi =3D hdmi_bridge->hdmi; - enum drm_connector_status stat_gpio, stat_reg; - int retry =3D 20; - - /* - * some platforms may not have hpd gpio. Rely only on the status - * provided by REG_HDMI_HPD_INT_STATUS in this case. - */ - if (!hdmi->hpd_gpiod) - return detect_reg(hdmi); - - do { - stat_gpio =3D detect_gpio(hdmi); - stat_reg =3D detect_reg(hdmi); - - if (stat_gpio =3D=3D stat_reg) - break; - - mdelay(10); - } while (--retry); - - /* the status we get from reading gpio seems to be more reliable, - * so trust that one the most if we didn't manage to get hdmi and - * gpio status to agree: - */ - if (stat_gpio !=3D stat_reg) { - DBG("HDMI_HPD_INT_STATUS tells us: %d", stat_reg); - DBG("hpd gpio tells us: %d", stat_gpio); - } - - return stat_gpio; -} --=20 2.39.5 From nobody Fri Dec 19 06:34:31 2025 Received: from mail-lf1-f50.google.com (mail-lf1-f50.google.com [209.85.167.50]) (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 F27B11AA7A6 for ; Sun, 9 Feb 2025 05:07:20 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.167.50 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1739077642; cv=none; b=qf29frqsiNUYub72gGc1CD0E3/GJgqQR3aAdadLgibcRt9L6BNoO8pvOEwYVU+rVk2F1dz7PtrHVENnrZ9daf/Jku65C/GJuAnLJ2VNADuS9M+ZlEUPFX3Et8z6uM6vcq7/bf1yCzlurWOeD6HlKSvNzmDh7scsYlOlrrVUIVKc= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1739077642; c=relaxed/simple; bh=CPzYHspMawaj1ZhasAtWHWKW8kSrzV7QWMnVrxr5HkQ=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=bv2Wr5owWerYbr+UM3zMIsyrdrMKJnic9aFPreldN7odWKwhStcAjLbXVXSjXdveaEXtK2tXfooGKEXNpNINYr5QZnB1a5dzjbmSKMGE8WjpXvdP5d1FwL8fzAoBH3nScTowf9h1OZUYJqhJe+du5J9njmdS7iBKLKpJHxG4NjY= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org; spf=pass smtp.mailfrom=linaro.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b=E6WCK13z; arc=none smtp.client-ip=209.85.167.50 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linaro.org Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="E6WCK13z" Received: by mail-lf1-f50.google.com with SMTP id 2adb3069b0e04-54509f46614so199828e87.0 for ; Sat, 08 Feb 2025 21:07:20 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1739077639; x=1739682439; darn=vger.kernel.org; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:from:to:cc:subject:date:message-id :reply-to; bh=RsjApZDAdahQIG0TxYhGE+9LrTC+9WrAVuHPpJuw1/8=; b=E6WCK13zsWInNrb3Ly3YGJCKWMjwOQOFZ4YXjoDK26iq1EWflYENaGOd55dgEoVpcW c+IOQmreZVHzFeqVBiJa3KmCHLiCp+kMRhsSG3I2xe64ZzOT3A45oztHWyqtGG8dx5RN JNp2sIZa2qHFgmh3UDpdRSgPghnSSb0bKk47vCJ3lptlOXKn4qXtdWcXXXvl89E1HT0Y eOjLfhSBEHuqqQuI4Si2lOWKfQGKkShY1O1OTgbwQ9GREfRVomIVHkw4s/FqsRequ1c7 A/+xgKJfZDbNdopbl2Lg+QgP+ZQ+PJZNqlM2LmzzaPFNwyXR+nd0b/xOAwZkllm8g9KS /Deg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1739077639; x=1739682439; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=RsjApZDAdahQIG0TxYhGE+9LrTC+9WrAVuHPpJuw1/8=; b=LQn4V3s3CUhZYQG/p3EMuqM75iufwakRSmDWOv//SDzs2gNuo2nmh7SmRtoIQRgiGG OpEhVZ3DDdo0W6IKJS/1ZSSonGntuj00MxK7N1UpswHCWgOx2mAoaDjZrOjooy5FGz4Z J82a4WJQG8+87vqn/nHth1kMTz2G70GalYHCa2/eVYBWH6j+KdaBCx1iN+TazXjG+qWb ZQIZDp3yyX6yl2i7p2Xxp9UlOLOX3wkswt9yh5vmZBGUIjrPAPQiw1ntmGFGnf6CwO+X 12vXm9WPc4+KgNk743aepDF0Xp7txel1XYOa6X+FM3SjqM3rBbKidnVRNYZBOoN401LT 8H5A== X-Forwarded-Encrypted: i=1; AJvYcCUUA83Ww0FjKShaPc18Z8OjMh4CAfeuarfV1488qG1MWenD7lrUWcf5ohFEleOuc2keiEBqy96H+WAt+8E=@vger.kernel.org X-Gm-Message-State: AOJu0YxrBgGoV4PC8RY5NYBHuMLBOEuUX3UhkmGixx1Rum3QAf1OmtGy IiuUYEQ/5ton91RFuI/dJPtn9E+Ss8dXxN2N8KhJWZC0DqZqovJkDE8bd6m3Lac= X-Gm-Gg: ASbGncs3jGEs4BC9pLyBYO4RKVfxwHc/L+qQMScH5HsxsZwEa/hiEHJMRLUmnYn7mHT r+tmkWd54JUp+k6bfgwpvaakEouStF5g7Qjd8HWK+mVinjo8sPh53g7GgvkF8tM8GVfc5WX8I0Z N+ofDzhibcnh7cjL5OG3zjJqXPVbXGaVmH68P9GOglR6hm+EGB9TcsydasPv6calIGPH8rq0LZv DVeGNLYbebI4YjnffOJ0vi41zebgmYDtIxM4m0yQtccLB6wmEUuqXnjc7fhUrpBmX8iYU2zbNwy Z+p38gxu7DyruBBovpcBrY4= X-Google-Smtp-Source: AGHT+IEUV6vDEmH6QH2VbLdRGrQZS/nO/l7LtZmxle0OOHyaPvHgIitk9/cYbQnjmRzYjEvCgZ4FQA== X-Received: by 2002:a05:6512:2115:b0:542:2e04:edd1 with SMTP id 2adb3069b0e04-54414b01bb7mr2258617e87.42.1739077639078; Sat, 08 Feb 2025 21:07:19 -0800 (PST) Received: from umbar.lan ([192.130.178.90]) by smtp.gmail.com with ESMTPSA id 2adb3069b0e04-54506ef1733sm245576e87.1.2025.02.08.21.07.16 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 08 Feb 2025 21:07:17 -0800 (PST) From: Dmitry Baryshkov Date: Sun, 09 Feb 2025 07:04:58 +0200 Subject: [PATCH v4 14/16] drm/msm/hdmi: ensure that HDMI is up if HPD is requested Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Message-Id: <20250209-fd-hdmi-hpd-v4-14-6224568ed87f@linaro.org> References: <20250209-fd-hdmi-hpd-v4-0-6224568ed87f@linaro.org> In-Reply-To: <20250209-fd-hdmi-hpd-v4-0-6224568ed87f@linaro.org> To: Rob Clark , Abhinav Kumar , Sean Paul , Marijn Suijten , David Airlie , Simona Vetter , Maarten Lankhorst , Maxime Ripard , Thomas Zimmermann , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Bjorn Andersson , Konrad Dybcio , Simona Vetter Cc: linux-arm-msm@vger.kernel.org, dri-devel@lists.freedesktop.org, freedreno@lists.freedesktop.org, linux-kernel@vger.kernel.org, devicetree@vger.kernel.org, Jessica Zhang X-Mailer: b4 0.14.2 X-Developer-Signature: v=1; a=openpgp-sha256; l=4128; i=dmitry.baryshkov@linaro.org; h=from:subject:message-id; bh=CPzYHspMawaj1ZhasAtWHWKW8kSrzV7QWMnVrxr5HkQ=; b=owGbwMvMwMXYbdNlx6SpcZXxtFoSQ/oK88eSHpk7Ql93ub9mUjtem3PTN2W+9P4EDjuxyxEqX +bYhPR0MhqzMDByMciKKbL4FLRMjdmUHPZhx9R6mEGsTCBTGLg4BWAiE9aw/4/PtS84291Soe+z JvviPv2qby0/Luqc3hj7+L+VeHOBcv5UN74TNmd4Ph17GM6u+CFPYnLEgZg/UjkMvnJ7A9hOGPX s45B8KNFVy6krcLj4W57jyeCTj3osVZddLD+VfDJWfJrUs0sXDi6R+1npeb+Iq/zNv9jS69Uboy L2SRuFL1TbzDlz5WbWe6KmWytnnAg/XiB0sMTq8Fd+hy2vd6w+ezfPVb3CIr3/q/3HFsMvPmFxf CWsUyfd1ci4sbnLvq1LRzP6oFa6we1rWfcumWcHnQz7H5L0U108tny3hNXPvVt9FwSU8LZM2m3X oCJbUKbPv630nPPjnsttZ9MsXj0qCPihJ852Zu2sRn45AA== X-Developer-Key: i=dmitry.baryshkov@linaro.org; a=openpgp; fpr=8F88381DD5C873E4AE487DA5199BF1243632046A The HDMI block needs to be enabled to properly generate HPD events. Make sure it is not turned off in the disable paths if HPD delivery is enabled. Reviewed-by: Jessica Zhang Signed-off-by: Dmitry Baryshkov --- drivers/gpu/drm/msm/hdmi/hdmi.c | 1 + drivers/gpu/drm/msm/hdmi/hdmi.h | 2 ++ drivers/gpu/drm/msm/hdmi/hdmi_bridge.c | 8 +++++++- drivers/gpu/drm/msm/hdmi/hdmi_hpd.c | 9 ++++++++- 4 files changed, 18 insertions(+), 2 deletions(-) diff --git a/drivers/gpu/drm/msm/hdmi/hdmi.c b/drivers/gpu/drm/msm/hdmi/hdm= i.c index abe2c9e1df550a36914ed19f51e7b86e5d3d24c0..b0292750265082c47093ed5cf50= bbcba9e67c955 100644 --- a/drivers/gpu/drm/msm/hdmi/hdmi.c +++ b/drivers/gpu/drm/msm/hdmi/hdmi.c @@ -293,6 +293,7 @@ static int msm_hdmi_dev_probe(struct platform_device *p= dev) hdmi->pdev =3D pdev; hdmi->config =3D config; spin_lock_init(&hdmi->reg_lock); + mutex_init(&hdmi->state_mutex); =20 ret =3D drm_of_find_panel_or_bridge(pdev->dev.of_node, 1, 0, NULL, &hdmi-= >next_bridge); if (ret && ret !=3D -ENODEV) diff --git a/drivers/gpu/drm/msm/hdmi/hdmi.h b/drivers/gpu/drm/msm/hdmi/hdm= i.h index a40d69ae328ced8b9f7411cf809a3fa8641dca33..39adc8929bd601d4846f75b35c0= 87de93c3df6be 100644 --- a/drivers/gpu/drm/msm/hdmi/hdmi.h +++ b/drivers/gpu/drm/msm/hdmi/hdmi.h @@ -41,6 +41,8 @@ struct hdmi { =20 /* video state: */ bool power_on; + bool hpd_enabled; + struct mutex state_mutex; /* protects two booleans */ unsigned long int pixclock; =20 void __iomem *mmio; diff --git a/drivers/gpu/drm/msm/hdmi/hdmi_bridge.c b/drivers/gpu/drm/msm/h= dmi/hdmi_bridge.c index fedcefbf53d1d8d53a4882a545427f5ce6570a76..f97f8b104f93bcca20e5f81f928= d9b23c14fbe28 100644 --- a/drivers/gpu/drm/msm/hdmi/hdmi_bridge.c +++ b/drivers/gpu/drm/msm/hdmi/hdmi_bridge.c @@ -303,6 +303,7 @@ static void msm_hdmi_bridge_atomic_pre_enable(struct dr= m_bridge *bridge, =20 msm_hdmi_set_timings(hdmi, &crtc_state->adjusted_mode); =20 + mutex_lock(&hdmi->state_mutex); if (!hdmi->power_on) { msm_hdmi_phy_resource_enable(phy); msm_hdmi_power_on(bridge); @@ -310,6 +311,7 @@ static void msm_hdmi_bridge_atomic_pre_enable(struct dr= m_bridge *bridge, if (connector->display_info.is_hdmi) msm_hdmi_audio_update(hdmi); } + mutex_unlock(&hdmi->state_mutex); =20 drm_atomic_helper_connector_hdmi_update_infoframes(connector, state); =20 @@ -332,7 +334,10 @@ static void msm_hdmi_bridge_atomic_post_disable(struct= drm_bridge *bridge, msm_hdmi_hdcp_off(hdmi->hdcp_ctrl); =20 DBG("power down"); - msm_hdmi_set_mode(hdmi, false); + + /* Keep the HDMI enabled if the HPD is enabled */ + mutex_lock(&hdmi->state_mutex); + msm_hdmi_set_mode(hdmi, hdmi->hpd_enabled); =20 msm_hdmi_phy_powerdown(phy); =20 @@ -343,6 +348,7 @@ static void msm_hdmi_bridge_atomic_post_disable(struct = drm_bridge *bridge, msm_hdmi_audio_update(hdmi); msm_hdmi_phy_resource_disable(phy); } + mutex_unlock(&hdmi->state_mutex); } =20 static void msm_hdmi_set_timings(struct hdmi *hdmi, diff --git a/drivers/gpu/drm/msm/hdmi/hdmi_hpd.c b/drivers/gpu/drm/msm/hdmi= /hdmi_hpd.c index d63f0fd96f0c00bbe07a13f8ead26f05a5133084..7726de95be4891e4a821ec4e056= 482263f23ac05 100644 --- a/drivers/gpu/drm/msm/hdmi/hdmi_hpd.c +++ b/drivers/gpu/drm/msm/hdmi/hdmi_hpd.c @@ -73,10 +73,14 @@ int msm_hdmi_hpd_enable(struct drm_bridge *bridge) if (ret) return ret; =20 + mutex_lock(&hdmi->state_mutex); msm_hdmi_set_mode(hdmi, false); msm_hdmi_phy_reset(hdmi); msm_hdmi_set_mode(hdmi, true); =20 + hdmi->hpd_enabled =3D true; + mutex_unlock(&hdmi->state_mutex); + hdmi_write(hdmi, REG_HDMI_USEC_REFTIMER, 0x0001001b); =20 /* enable HPD events: */ @@ -106,7 +110,10 @@ void msm_hdmi_hpd_disable(struct hdmi *hdmi) /* Disable HPD interrupt */ hdmi_write(hdmi, REG_HDMI_HPD_INT_CTRL, 0); =20 - msm_hdmi_set_mode(hdmi, false); + mutex_lock(&hdmi->state_mutex); + hdmi->hpd_enabled =3D false; + msm_hdmi_set_mode(hdmi, hdmi->power_on); + mutex_unlock(&hdmi->state_mutex); =20 pm_runtime_put(dev); } --=20 2.39.5 From nobody Fri Dec 19 06:34:31 2025 Received: from mail-lf1-f52.google.com (mail-lf1-f52.google.com [209.85.167.52]) (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 679B31B0414 for ; Sun, 9 Feb 2025 05:07:23 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.167.52 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1739077645; cv=none; b=lcBUmk0E635xwyQFMwg0XqD3UMIYXhxvoHq0gE8Iw9mve6zxlcfr9HkDYc7+Y6LmQsCUKoqs7ZxWPfJ6yCkxFb22fg7TnKsdlpNEGti1PkSLF3t08DUb7D8kRaqjTewF/VdpZDssVxKLLpKJN5e4AjI8U6lNW3LubdbYct/0Y0A= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1739077645; c=relaxed/simple; bh=vYpQX4Can/9pA++xmzUVsvBmfqVytun4ULSAJD2bgJ8=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=qx+avhPZkKQts+Sz9/kxsB8YJiE82xG2yiT5RoDtLSLRV/JcRbNA4kgcuq0sL/JcVOKXftXSBfLj4S3tnjYT9zOmdJsS0ANiDk95T182X6s6Vy6twjdtk+nUd4MDN0foTb28Qcoury9B6jEUwlgsfU9wL7uJnI6hT27vEKQXZdY= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org; spf=pass smtp.mailfrom=linaro.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b=hNqj4OJ3; arc=none smtp.client-ip=209.85.167.52 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linaro.org Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="hNqj4OJ3" Received: by mail-lf1-f52.google.com with SMTP id 2adb3069b0e04-5450475df18so1029977e87.2 for ; Sat, 08 Feb 2025 21:07:23 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1739077641; x=1739682441; darn=vger.kernel.org; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:from:to:cc:subject:date:message-id :reply-to; bh=1xZToT8Ipw+PUjO7BMQGdecD6LauDPp0cZ9YFUj8vWA=; b=hNqj4OJ3G12BF9zobvSAtCihvt29ip78/FYWd6KLvBCx8k6Q+yK0fwV0Jx2ytrL9OR B7nGfe6hP3KIiNhwRr8k2YN9A/M5aPnSUVdyzBAIYsbdADk1TR1wOKQCbk5OByEdZOcV kCiR1Ln3aejJGvBQESb5WUK1Skd4d3BX56tOTtICBv80dYmkwrXUmMRX0i3s5KC15fb7 jfhjN07OCTUy8TvOwo6E8AmbfA4HBnY59nN7/Q5oofY03/vvHkLpDJU3El9y08EECEaQ TIX3yCsXcx7Kh30TfXLX7f4dHDvR24KJag1eP8iM9h2lg/sLS/gzagtQpfanOH5v1NXm O/tA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1739077641; x=1739682441; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=1xZToT8Ipw+PUjO7BMQGdecD6LauDPp0cZ9YFUj8vWA=; b=DWGYec8Sah2DpYLhkdpXyT0nrFNaevJPp/eybYWklwzhe3Xpi1xD6/FKkD1MjrIRDN qb4ycK3OH9HDkgcQQ5UEwR5UlFG01jJfvFBs1GSiHQe2jA0nxkkh/urwKYQbmUfw51df 7BsXDZAIucm7bR5ve687CNXwqbPHLS2BKST/tP3jiqECFgy5F4CNNaMFBS5UYKWT8EEA v+I3iuggzlfT9+PMlDojMnW2ov+z0QqjoefAdGyGGmN7FinvfUlH6StSPQ3pafuSIKP4 NSu9k8lE3cKn7K0OLPJV/TIA4DWMiKNmYDtH7lmJA6n8rkPzyst/SiPQIIXMjaPcV/1j ynWg== X-Forwarded-Encrypted: i=1; AJvYcCWdkapkSjXa+mgP30i91GiBkrUOElEINg4iQj2a63wL+t+bHQoTnmMMsWaEoiH7JLOmjm9C/1V1IlhHrek=@vger.kernel.org X-Gm-Message-State: AOJu0YxEmm6HynnS2VJAXcHfrtl94ROGUM4EviN7rhVC3u+Rr0QT20Pb zJ3KBG7mochyB9P2xdpIccGGdDWNOrQ8ghCwZkLi8UCOzQRczmtGH4kLk9Weoeo= X-Gm-Gg: ASbGncsItmidVzN+DgGKvztTAENpD+Iq4fVzCD/01EEH8HaVMNwSr5Ka0fryuHpK8Yh IKPuG1mL6Ea0GgIGG8vPWV80fs8FbOCmoYF7eoYYLRbKl/5+IFxE7mmSIBO6VbVJ9j2s5oOmkEi sbX2tWHmhxc8rxpKs3tVVYhbfnt/q02DsB1pn+9Xs7c5yMuAylesw4UXalhuhw9A1qtCZn6yth1 FC/SamtYKSdwg1iwlx6GVJUX8axn75adTdQ8zlAW+NjgP8tI4c2L32hjqqfBVzreezdDxkaG/Uu jZ2srsbXtJ1uysFsuAEvqto= X-Google-Smtp-Source: AGHT+IGUIoNub6sm47xBPrwhQD2mG90ISalcUTKePpFjzxx94Lo1dp3HQT4XawwCjUCjbA6kpfg6Qg== X-Received: by 2002:a05:6512:ba1:b0:53e:df2b:df25 with SMTP id 2adb3069b0e04-54414ab6943mr3253079e87.16.1739077641516; Sat, 08 Feb 2025 21:07:21 -0800 (PST) Received: from umbar.lan ([192.130.178.90]) by smtp.gmail.com with ESMTPSA id 2adb3069b0e04-54506ef1733sm245576e87.1.2025.02.08.21.07.19 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 08 Feb 2025 21:07:20 -0800 (PST) From: Dmitry Baryshkov Date: Sun, 09 Feb 2025 07:04:59 +0200 Subject: [PATCH v4 15/16] drm/msm/hdmi: wire in hpd_enable/hpd_disable bridge ops Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Message-Id: <20250209-fd-hdmi-hpd-v4-15-6224568ed87f@linaro.org> References: <20250209-fd-hdmi-hpd-v4-0-6224568ed87f@linaro.org> In-Reply-To: <20250209-fd-hdmi-hpd-v4-0-6224568ed87f@linaro.org> To: Rob Clark , Abhinav Kumar , Sean Paul , Marijn Suijten , David Airlie , Simona Vetter , Maarten Lankhorst , Maxime Ripard , Thomas Zimmermann , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Bjorn Andersson , Konrad Dybcio , Simona Vetter Cc: linux-arm-msm@vger.kernel.org, dri-devel@lists.freedesktop.org, freedreno@lists.freedesktop.org, linux-kernel@vger.kernel.org, devicetree@vger.kernel.org, Jessica Zhang X-Mailer: b4 0.14.2 X-Developer-Signature: v=1; a=openpgp-sha256; l=4317; i=dmitry.baryshkov@linaro.org; h=from:subject:message-id; bh=vYpQX4Can/9pA++xmzUVsvBmfqVytun4ULSAJD2bgJ8=; b=owEBbQGS/pANAwAKAYs8ij4CKSjVAcsmYgBnqDfktyJ/HyMNRFnPtswfbXaSvIUEhqYROBJ0T mK3ItZNpo6JATMEAAEKAB0WIQRMcISVXLJjVvC4lX+LPIo+Aiko1QUCZ6g35AAKCRCLPIo+Aiko 1Wo4B/9wEko2KqapmTdzdtrGI05PnVyOMHtGr6U0m5DtWqAvsXy8q8aLx+EPLrXuh4d6/X6pN9w BKvU+doQVrevh7GR54HOPGdIdY6o6aThjw6JItlIZOzHnZcfcLtiCrbvACurjF6ttN8ZcdISSbc PLsmnqzXx72u2bvsrnW2pUDgummi4+lKGGICyAM6i9gCJ9ru1ZTxBaxlhpwULRe9YMX+IK3Kj0c Ctb4StyJljvtFV0bij01C6835twtirGRYCnhvwKfLVz05XHsUB9hTizzRFTWKi9IOzwlZABi5bS IDep805qclyL8OJE8++hZ5W0HyuOUtMlAX37Sya3F2PLjEB9 X-Developer-Key: i=dmitry.baryshkov@linaro.org; a=openpgp; fpr=8F88381DD5C873E4AE487DA5199BF1243632046A The HDMI driver already has msm_hdmi_hpd_enable() and msm_hdmi_hpd_disable() functions. Wire them into the msm_hdmi_bridge_funcs, so that HPD can be enabled and disabled dynamically rather than always having HPD events generation enabled. Reviewed-by: Jessica Zhang Signed-off-by: Dmitry Baryshkov --- drivers/gpu/drm/msm/hdmi/hdmi.c | 9 --------- drivers/gpu/drm/msm/hdmi/hdmi.h | 4 ++-- drivers/gpu/drm/msm/hdmi/hdmi_bridge.c | 2 ++ drivers/gpu/drm/msm/hdmi/hdmi_hpd.c | 12 ++++++------ 4 files changed, 10 insertions(+), 17 deletions(-) diff --git a/drivers/gpu/drm/msm/hdmi/hdmi.c b/drivers/gpu/drm/msm/hdmi/hdm= i.c index b0292750265082c47093ed5cf50bbcba9e67c955..f1898d8eed6fa46c47c9b632a90= daeabe74f4359 100644 --- a/drivers/gpu/drm/msm/hdmi/hdmi.c +++ b/drivers/gpu/drm/msm/hdmi/hdmi.c @@ -200,12 +200,6 @@ int msm_hdmi_modeset_init(struct hdmi *hdmi, goto fail; } =20 - ret =3D msm_hdmi_hpd_enable(hdmi->bridge); - if (ret < 0) { - DRM_DEV_ERROR(&hdmi->pdev->dev, "failed to enable HPD: %d\n", ret); - goto fail; - } - return 0; =20 fail: @@ -261,9 +255,6 @@ static void msm_hdmi_unbind(struct device *dev, struct = device *master, struct msm_drm_private *priv =3D dev_get_drvdata(master); =20 if (priv->hdmi) { - if (priv->hdmi->bridge) - msm_hdmi_hpd_disable(priv->hdmi); - msm_hdmi_destroy(priv->hdmi); priv->hdmi =3D NULL; } diff --git a/drivers/gpu/drm/msm/hdmi/hdmi.h b/drivers/gpu/drm/msm/hdmi/hdm= i.h index 39adc8929bd601d4846f75b35c087de93c3df6be..679a2dab762c1333153c97709c9= 9db8cc5a76d1a 100644 --- a/drivers/gpu/drm/msm/hdmi/hdmi.h +++ b/drivers/gpu/drm/msm/hdmi/hdmi.h @@ -214,8 +214,8 @@ int msm_hdmi_bridge_init(struct hdmi *hdmi); void msm_hdmi_hpd_irq(struct drm_bridge *bridge); enum drm_connector_status msm_hdmi_bridge_detect( struct drm_bridge *bridge); -int msm_hdmi_hpd_enable(struct drm_bridge *bridge); -void msm_hdmi_hpd_disable(struct hdmi *hdmi); +void msm_hdmi_hpd_enable(struct drm_bridge *bridge); +void msm_hdmi_hpd_disable(struct drm_bridge *bridge); =20 /* * i2c adapter for ddc: diff --git a/drivers/gpu/drm/msm/hdmi/hdmi_bridge.c b/drivers/gpu/drm/msm/h= dmi/hdmi_bridge.c index f97f8b104f93bcca20e5f81f928d9b23c14fbe28..4de0f9b870a426bca825469195b= 1e3fac7729445 100644 --- a/drivers/gpu/drm/msm/hdmi/hdmi_bridge.c +++ b/drivers/gpu/drm/msm/hdmi/hdmi_bridge.c @@ -462,6 +462,8 @@ static const struct drm_bridge_funcs msm_hdmi_bridge_fu= ncs =3D { .atomic_post_disable =3D msm_hdmi_bridge_atomic_post_disable, .edid_read =3D msm_hdmi_bridge_edid_read, .detect =3D msm_hdmi_bridge_detect, + .hpd_enable =3D msm_hdmi_hpd_enable, + .hpd_disable =3D msm_hdmi_hpd_disable, .hdmi_tmds_char_rate_valid =3D msm_hdmi_bridge_tmds_char_rate_valid, .hdmi_clear_infoframe =3D msm_hdmi_bridge_clear_infoframe, .hdmi_write_infoframe =3D msm_hdmi_bridge_write_infoframe, diff --git a/drivers/gpu/drm/msm/hdmi/hdmi_hpd.c b/drivers/gpu/drm/msm/hdmi= /hdmi_hpd.c index 7726de95be4891e4a821ec4e056482263f23ac05..bd17f63546dd2e3d3484aa9d46b= ae87274001a82 100644 --- a/drivers/gpu/drm/msm/hdmi/hdmi_hpd.c +++ b/drivers/gpu/drm/msm/hdmi/hdmi_hpd.c @@ -60,7 +60,7 @@ static void msm_hdmi_phy_reset(struct hdmi *hdmi) } } =20 -int msm_hdmi_hpd_enable(struct drm_bridge *bridge) +void msm_hdmi_hpd_enable(struct drm_bridge *bridge) { struct hdmi_bridge *hdmi_bridge =3D to_hdmi_bridge(bridge); struct hdmi *hdmi =3D hdmi_bridge->hdmi; @@ -70,8 +70,8 @@ int msm_hdmi_hpd_enable(struct drm_bridge *bridge) unsigned long flags; =20 ret =3D pm_runtime_resume_and_get(dev); - if (ret) - return ret; + if (WARN_ON(ret)) + return; =20 mutex_lock(&hdmi->state_mutex); msm_hdmi_set_mode(hdmi, false); @@ -99,12 +99,12 @@ int msm_hdmi_hpd_enable(struct drm_bridge *bridge) hdmi_write(hdmi, REG_HDMI_HPD_CTRL, HDMI_HPD_CTRL_ENABLE | hpd_ctrl); spin_unlock_irqrestore(&hdmi->reg_lock, flags); - - return 0; } =20 -void msm_hdmi_hpd_disable(struct hdmi *hdmi) +void msm_hdmi_hpd_disable(struct drm_bridge *bridge) { + struct hdmi_bridge *hdmi_bridge =3D to_hdmi_bridge(bridge); + struct hdmi *hdmi =3D hdmi_bridge->hdmi; struct device *dev =3D &hdmi->pdev->dev; =20 /* Disable HPD interrupt */ --=20 2.39.5 From nobody Fri Dec 19 06:34:31 2025 Received: from mail-lf1-f49.google.com (mail-lf1-f49.google.com [209.85.167.49]) (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 BDA9B1B415A for ; Sun, 9 Feb 2025 05:07:25 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.167.49 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1739077647; cv=none; b=TYBhvD2hAeWHK+4YbnbsuuEiUF4GdYSvVVN2P+BseGtMh96mFpHPVTZpNXDsYA6mEVocktLFwQA1uNHICNvqpQ7Y4TzQ92dOaxjjA8tNJXKsM0awqUXjAMK/WB9jzzx3xyyZXGBKI512o/k8qStMicfj4jL8tHWKEcEAy2Yoy6Y= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1739077647; c=relaxed/simple; bh=rBkvGR/qHrfxPlnsg0QzXfiNTIC9RTO2ROzJ5dKz7zg=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=E4h9NxYkfL9Zxqvnn2lZOnji/Me8HvQ7gJRgNVkLKgMru4ZCy7MJGC/yLeKpGR83ai9tth22l0sPOvLVZT2V/NrPXim4pBUmE/qvJXbFekhi/T0urQ3JZdeEbFPkAWBsJsyt3CSncYwMPGbtPv4F98QjMl9FeeP8vNtNoCR3OAc= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org; spf=pass smtp.mailfrom=linaro.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b=aPzqkLMW; arc=none smtp.client-ip=209.85.167.49 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linaro.org Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="aPzqkLMW" Received: by mail-lf1-f49.google.com with SMTP id 2adb3069b0e04-5450622b325so739135e87.1 for ; Sat, 08 Feb 2025 21:07:25 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1739077644; x=1739682444; darn=vger.kernel.org; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:from:to:cc:subject:date:message-id :reply-to; bh=EfNMfzUAvdO5axXrtOPa21BH0I19Ed6M3V+EZ2kcNQY=; b=aPzqkLMWbFX+7NFvOmEk2laOqFOFfeDjqCedQUpe2La/Ysrc9V08RAhrJ8NY22NYbV lgUrp8qss3uZjh2Pqgk+Oni9M7/s6l52Yji1bRmkgP/vTYUtbUJrNl/oPaL+nKlv1Iut 1S92mWsas8hjc2FZpstSHE+iBzKXQiD1WrySs5pavDGsnH0ThULdY76s34TNG9bJzPNd pU1rs0KhY2CTNTVnQMi4kfOcVKk3cY3/niA8QB0s8lRXxoT/5Ug+NXJ08QzWDgDnRJFU zsTUeJqjIic7OxzKq5KdvHwE+7vye+DU4K02KbGZsKopWZuituIy/8fK/fdei9NNR1PO Tuhw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1739077644; x=1739682444; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=EfNMfzUAvdO5axXrtOPa21BH0I19Ed6M3V+EZ2kcNQY=; b=NJtbuwGVE8oo4uTa75zbLFBREwDMYQqmVI8If6j1/xtmZeuOs3u4nCq//4WzOt/Ezs 7tNu44+rFeu3i2/mtq4lNitY2jr6AZkiNrPoJuH3ZQBDG15nLr73ppORoFQe3pkLpG0c jxKEfxVJfjlnw6OcpWt7A2vLpa0ZyNjqQxn6BU3H470b81YVyUG7dfzI1vsQhwZe2/w1 0eDG3RnKNhLuEeR7fUUHd6y7UIcFH7JzPE6n7ObIE25yjZIJDqUeFhBNJ9QYYiIqM2wz 5xW/I8uRCSUqO6ubqTypnnQcjS/e9ugQe8tJTH36pqa42mXsr+1tIwBMJjQSgleMwZg7 QPPA== X-Forwarded-Encrypted: i=1; AJvYcCXU6JdiNBgv3EYa2apSDKx4xt+GFc1SbxKwJvkyqa6L7yVEKL8zQ98Q8HpnN+zaOq89giDL+nu/4sio/c4=@vger.kernel.org X-Gm-Message-State: AOJu0YwxbhdNABacNIQ4yXQEtPzcfG4TEBpbtefs2oPUiXv5mbudcDuu GE1CsYjWQNvRVzKso2q3Z5dS33/s/PSgAxErt3dsRwckUdw5EFHZiGaQG0K5pFU= X-Gm-Gg: ASbGncsTXADOjLEzn3Ck+SOcKaZHD1e5uEu2vk6w6YSGQjY9V58j501+SOtfz64NJnP CIep9YpAbJDb4HHPvCd+XxK7GLe+bdv9KjSYfnNQTMVw1VeMZNrQ2XFkqPGQP5pmInU222EqszN LILPB62AZIFSZL+KJK3jP/ZrnmU0lWwyWtxfSUDsCQ3Ze7+oFMhBns0X9wsNabVy4Ogf8EpM3Y2 5PHAppE5sCYVdV2FzWXf+WHADLNV6TBHoktxARe/4F3MJ56ZT9RRH2R4Wh2xozsxM71+BbpgDDs ymHovekjddbr12gStBPtF+s= X-Google-Smtp-Source: AGHT+IEAJIpGx/KtWJ3FoMRxqCJZCMQixEialyC+rYX1C/PQUXahOHBcURaFNniiUGHQYiTxLHEVSg== X-Received: by 2002:ac2:568e:0:b0:543:e4a3:7c3d with SMTP id 2adb3069b0e04-54414aa8782mr2874988e87.29.1739077643911; Sat, 08 Feb 2025 21:07:23 -0800 (PST) Received: from umbar.lan ([192.130.178.90]) by smtp.gmail.com with ESMTPSA id 2adb3069b0e04-54506ef1733sm245576e87.1.2025.02.08.21.07.21 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 08 Feb 2025 21:07:22 -0800 (PST) From: Dmitry Baryshkov Date: Sun, 09 Feb 2025 07:05:00 +0200 Subject: [PATCH v4 16/16] ARM: dts: qcom: apq8064-ifc6410: drop HDMI HPD GPIO Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Message-Id: <20250209-fd-hdmi-hpd-v4-16-6224568ed87f@linaro.org> References: <20250209-fd-hdmi-hpd-v4-0-6224568ed87f@linaro.org> In-Reply-To: <20250209-fd-hdmi-hpd-v4-0-6224568ed87f@linaro.org> To: Rob Clark , Abhinav Kumar , Sean Paul , Marijn Suijten , David Airlie , Simona Vetter , Maarten Lankhorst , Maxime Ripard , Thomas Zimmermann , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Bjorn Andersson , Konrad Dybcio , Simona Vetter Cc: linux-arm-msm@vger.kernel.org, dri-devel@lists.freedesktop.org, freedreno@lists.freedesktop.org, linux-kernel@vger.kernel.org, devicetree@vger.kernel.org X-Mailer: b4 0.14.2 X-Developer-Signature: v=1; a=openpgp-sha256; l=806; i=dmitry.baryshkov@linaro.org; h=from:subject:message-id; bh=rBkvGR/qHrfxPlnsg0QzXfiNTIC9RTO2ROzJ5dKz7zg=; b=owEBbQGS/pANAwAKAYs8ij4CKSjVAcsmYgBnqDfkPKZGcgzKdMYQrmr8xg29SeVv5ZTbQNhMP Xm71FFkyTSJATMEAAEKAB0WIQRMcISVXLJjVvC4lX+LPIo+Aiko1QUCZ6g35AAKCRCLPIo+Aiko 1UN1B/9p99p14mAy2cJWH8bo5AHu/xitIDMYADBNYVdsUQXslx1MuCaXPHSz/9EQQ9j45ItPAmv EzCEf17MZ//D1/qHLqCjloL9Ltx37KTjBGPz1FUsmmbU8crIut7dokT0vvrXN6tGLdefXI/Hxuc awkE7CsVIlujLKcvm1MIvFQt1sbsJ9STP7ppIKasGV7yZiTxpCfT5SglZtHAbrupQBqNjuOhnWd 3K8IniuWpKDQQBT71UqooHwEvF5Y9+OSbX8IlfDHj0Wp18urN40IFGX3Er+qj4JGg0EX+RWVWF7 5mfvkADq0u6kX/boHk9kXmppgY4vT3pNzviaOXQ+R8XuVeKu X-Developer-Key: i=dmitry.baryshkov@linaro.org; a=openpgp; fpr=8F88381DD5C873E4AE487DA5199BF1243632046A There is no need to specify separate HPD gpio for the HDMI block. Use built-in HPD in order to detect if the monitor is plugged or not. Signed-off-by: Dmitry Baryshkov Reviewed-by: Konrad Dybcio --- arch/arm/boot/dts/qcom/qcom-apq8064-ifc6410.dts | 1 - 1 file changed, 1 deletion(-) diff --git a/arch/arm/boot/dts/qcom/qcom-apq8064-ifc6410.dts b/arch/arm/boo= t/dts/qcom/qcom-apq8064-ifc6410.dts index b3ff8010b14985c55c580e0083a5c8ea23c03962..717bfd74edb75b278eaf5ab3795= 4fcede1f7ffb0 100644 --- a/arch/arm/boot/dts/qcom/qcom-apq8064-ifc6410.dts +++ b/arch/arm/boot/dts/qcom/qcom-apq8064-ifc6410.dts @@ -138,7 +138,6 @@ &gsbi7_serial { =20 &hdmi { core-vdda-supply =3D <&pm8921_hdmi_switch>; - hpd-gpios =3D <&tlmm_pinmux 72 GPIO_ACTIVE_HIGH>; status =3D "okay"; }; =20 --=20 2.39.5