From patchwork Wed Nov 16 10:21:48 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Neil Armstrong X-Patchwork-Id: 20880 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:6687:0:0:0:0:0 with SMTP id l7csp62502wru; Wed, 16 Nov 2022 02:23:33 -0800 (PST) X-Google-Smtp-Source: AA0mqf6VoF3XLDFe2VRW00f4DHgl4veEjey6ykrcIvNePrNhqS1qVJ2zTCgJdfqpLP3PAHCoryqG X-Received: by 2002:a17:906:e210:b0:7ae:eaf1:c9e3 with SMTP id gf16-20020a170906e21000b007aeeaf1c9e3mr12833241ejb.551.1668594213540; Wed, 16 Nov 2022 02:23:33 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1668594213; cv=none; d=google.com; s=arc-20160816; b=0oImbrMIetq7IGuBlP7oy+qn/jnu7jvoayUeTNrPlASwk+DDk180A/F6YNt/zysxoe 4EhEwjb5iF+hW8MedQOXVn6qhKlJ5sl2yRRNXZ5+vdJPsXOnAQWhpt+7/5Dw+4YCUMNH of1lUBLWphDF5oHxt18sS9cEO0JyNgQF+O2oVi+Qu5J3l2QZok0wx17dzmdf8eBzkC5+ XzghhmVQaqpVwSYghCSEfVARWJyFCsyIeAWViB6L5EL9FblT4PdgHZJxk4rQ/ivwKyrZ bKTW9J9xN0N6tWr4kwB4zHrBs0IOavxLXmottfDXEh6y7djO2YDUul1aMIzmgJF/5QPc 9YKw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:in-reply-to:references:message-id :content-transfer-encoding:mime-version:subject:date:from :dkim-signature; bh=HSVWFwlfT1R0XiTLF2nwbR5ZrhzAtrkx1WJmlAjyhZw=; b=kbCnco+7npiAJ4Rcf8PbuIPkvBoC8fP65hdeWyDvckgZ+jcV02gKReGfxKglcEp+fr H6E45H+8XuRYJ+3DdlyzjsarfzP7CJr989MnGAm/R7er4Jc7MOXC9QqiQ0O+6XgDDzGp FpkcC3o6wEXH4BEz5ZrkyfS7/ffwIMusoa917haq3pwdOVe7akT01glD3z6arNZStw23 fPQhVC70Ll2510YtAV4yvug9uLKtWo2Ol+QloL8T1jcsYgoV8E1PxSaVPGzJGG8/aDHQ 8uQM+yLWOwfglsZ0KaF16CWbNl+hMYnvxNBe8Jeq4Yd1d5WMq8+Uj4NlIyQuhxd7tXpW IdXg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b="x8/Nh7PN"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id hg6-20020a1709072cc600b0078c3197bf86si8421426ejc.533.2022.11.16.02.23.10; Wed, 16 Nov 2022 02:23:33 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b="x8/Nh7PN"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S238775AbiKPKWW (ORCPT + 99 others); Wed, 16 Nov 2022 05:22:22 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56956 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233202AbiKPKVw (ORCPT ); Wed, 16 Nov 2022 05:21:52 -0500 Received: from mail-wr1-x42d.google.com (mail-wr1-x42d.google.com [IPv6:2a00:1450:4864:20::42d]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 7D87221252 for ; Wed, 16 Nov 2022 02:21:51 -0800 (PST) Received: by mail-wr1-x42d.google.com with SMTP id g12so28903100wrs.10 for ; Wed, 16 Nov 2022 02:21:51 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; 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=HSVWFwlfT1R0XiTLF2nwbR5ZrhzAtrkx1WJmlAjyhZw=; b=x8/Nh7PNQPl0JPgz1FPnoyB8tVf315HDN4l8JhIQoTrK2o4UrXz0OhldFesWs9j/bk NP4tyinpXGmQXGYivleJC6LvK2b5a5mi880xptmhkedFvOdg+99bt2NqDXT6++hSnRPO YBBsT/zes/4NEx8fQs7yrC2ZPzHGNIPx2ttFitygqDgLSGLMVG+vWnP0h6BoHTlTKrvB IA52vvfCXJm8+rTbIV6LBSSvEObIixFY/TnOO13DZlXT3dGM5UWhNRM02HIHX67TJKYF a7we3OerjfHyvJBlJOT50tPwnKpSxpoBij83jXyTIZVb2SN9c/CJ5o4/kizau7G5L9mc 5dqA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; 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=HSVWFwlfT1R0XiTLF2nwbR5ZrhzAtrkx1WJmlAjyhZw=; b=c4CRgnJPze/0PEFc7D+wyBGIi6YjuovFSeySw3j8A+m5KG04eT65f/90kLeNQ1mCdT +ofTAvyvE3IzRNgBBJxzQ8i6KCuk9CqrLeiNbYsuMGZad+mSbq7OYgw8p3+SXR6zA5Yj NYGDBpew7a38LEiH5zQyLZdBMxMPYlDO7KuetH24CgEi2a2wkp0Kh05aG+OezLHRnVis 0sjoBdyjWmzd14hH0kSc7s6aS9pfonqdoqXIm8K4iDczrUKx/enpDACxC+ZhYYI1Qphm ABDGr4ajK9E2Te/NM9mD59M56C2yqPSQkV5SRbhwuXcwj4ITxPLJmchQffKa2whE/n/b Hztw== X-Gm-Message-State: ANoB5pmN8LD8Xl7NX4WXewFfxUndJ+RC4HFa5nLvBf39GsR5+fH5nMV2 3E6uTCNGDuy7b8nziKtzpuhJiQ== X-Received: by 2002:adf:f6ca:0:b0:236:6e2a:ac12 with SMTP id y10-20020adff6ca000000b002366e2aac12mr12931127wrp.366.1668594110063; Wed, 16 Nov 2022 02:21:50 -0800 (PST) Received: from arrakeen.starnux.net ([2a01:e0a:982:cbb0:52eb:f6ff:feb3:451a]) by smtp.gmail.com with ESMTPSA id o5-20020a05600c510500b003b4ff30e566sm6133615wms.3.2022.11.16.02.21.49 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 16 Nov 2022 02:21:49 -0800 (PST) From: Neil Armstrong Date: Wed, 16 Nov 2022 11:21:48 +0100 Subject: [PATCH 1/6] dt-bindings: qcom: geni-se: document I2C Master Hub wrapper variant MIME-Version: 1.0 Message-Id: <20221114-narmstrong-sm8550-upstream-i2c-master-hub-v1-1-64449106a148@linaro.org> References: <20221114-narmstrong-sm8550-upstream-i2c-master-hub-v1-0-64449106a148@linaro.org> In-Reply-To: <20221114-narmstrong-sm8550-upstream-i2c-master-hub-v1-0-64449106a148@linaro.org> To: Rob Herring , Konrad Dybcio , Andy Gross , Krzysztof Kozlowski , Bjorn Andersson Cc: linux-i2c@vger.kernel.org, linux-arm-msm@vger.kernel.org, linux-kernel@vger.kernel.org, devicetree@vger.kernel.org, Neil Armstrong X-Mailer: b4 0.10.1 X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, SPF_HELO_NONE,SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1749647845959734195?= X-GMAIL-MSGID: =?utf-8?q?1749647845959734195?= The I2C Master Hub is a stripped down version of the GENI Serial Engine QUP Wrapper Controller but only supporting I2C serial engines without DMA support. This documents the variant compatible and forbids UART and SPI sub-nodes, and removes requirement for the Master AHB clock and iommu property. Signed-off-by: Neil Armstrong --- .../devicetree/bindings/soc/qcom/qcom,geni-se.yaml | 43 ++++++++++++++++++---- 1 file changed, 35 insertions(+), 8 deletions(-) diff --git a/Documentation/devicetree/bindings/soc/qcom/qcom,geni-se.yaml b/Documentation/devicetree/bindings/soc/qcom/qcom,geni-se.yaml index 2bf5293fc995..6657e74df629 100644 --- a/Documentation/devicetree/bindings/soc/qcom/qcom,geni-se.yaml +++ b/Documentation/devicetree/bindings/soc/qcom/qcom,geni-se.yaml @@ -21,20 +21,15 @@ properties: compatible: enum: - qcom,geni-se-qup + - qcom,geni-se-i2c-master-hub reg: description: QUP wrapper common register address and length. maxItems: 1 - clock-names: - items: - - const: m-ahb - - const: s-ahb + clock-names: true - clocks: - items: - - description: Master AHB Clock - - description: Slave AHB Clock + clocks: true "#address-cells": const: 2 @@ -81,6 +76,38 @@ patternProperties: description: GENI Serial Engine based UART Controller. $ref: /schemas/serial/qcom,serial-geni-qcom.yaml# +if: + properties: + compatible: + contains: + const: qcom,geni-se-i2c-master-hub +then: + properties: + clock-names: + items: + - const: s-ahb + + clocks: + items: + - description: Slave AHB Clock + + iommus: false + + patternProperties: + "spi@[0-9a-f]+$": false + "serial@[0-9a-f]+$": false +else: + properties: + clock-names: + items: + - const: m-ahb + - const: s-ahb + + clocks: + items: + - description: Master AHB Clock + - description: Slave AHB Clock + additionalProperties: false examples: From patchwork Wed Nov 16 10:21:49 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Neil Armstrong X-Patchwork-Id: 20885 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:6687:0:0:0:0:0 with SMTP id l7csp64522wru; Wed, 16 Nov 2022 02:29:59 -0800 (PST) X-Google-Smtp-Source: AA0mqf6KtP+szlsY7ipsgdeNlKlcYemns/hYA14NHy7b6MKWCNrps9tXBDW5SIFoZQJGr6JbC2f5 X-Received: by 2002:a17:906:3fd4:b0:7ad:95cf:726e with SMTP id k20-20020a1709063fd400b007ad95cf726emr17333450ejj.60.1668594599550; Wed, 16 Nov 2022 02:29:59 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1668594599; cv=none; d=google.com; s=arc-20160816; b=VT9LGUJpHxSI5sq2QlqHl9DjGSpujoI0lpvMw+Rb/FEHRqoRAuIuZ5WpavVBJsrJt4 GD7E8BSF7dcNNjlJtebFMW6wY/4EPbuK1oZez1R4WpVsq291LfqD9lA6x60FmhSvWXfc Xmbrg1hNigzo5Bsp8wkhnRZLHjk32Nk0+FHL6IgMk1sYz0dDB7L3fo8Mfcq5lqQ/OXeU h9S/RrJcOUKByroYYnC76qY17OtCEu1AHJWNVGF7iJ2wQP1Fln9sNZ2vrDkA71itV57p P4kKYFwO76ENlxRP9Bjo3b+MTA9UVjvJBqfDrzJaHMVju+6Mt3V2eUOrKukXooe1/QgG u0tg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:in-reply-to:references:message-id :content-transfer-encoding:mime-version:subject:date:from :dkim-signature; bh=ZzVAeZmGHVgJEk1mN8aP1HtyXLkmqX2nhQXPCT6cTuU=; b=S+Ian8Nr93JthmJlYBm51MDyvevb/rgxEkV6wv66LQF4KGejC0rKFmxfy00o2nojJK 0lkR5a1WVXKwVglcVubLAfYc3XVlDhxaRxm6CLANCgnx4KakwwovqGoHzUvv6i4+HbX2 FX5oDabHBQWzzlPG5JgH9LOnJy6t0nmcyNZPjnEqUWa/9KfljjsDr/WoHUnI689vi4La IOyBE41LeRxGzeLZ21nPThYXlUyKnNe1I6mxjz9J0SdGFMWC+XzQO1rqwHHNZTOgYW34 5demg4z5Y0rx+nfUHV4OJwrk5La88zUp19EvlOro0EsqYjz/Ox76bNybxJ0ucKRcpCl7 QNcQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=PY6DbNBt; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id ga23-20020a1709070c1700b0078e0e850902si13690858ejc.868.2022.11.16.02.29.34; Wed, 16 Nov 2022 02:29:59 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=PY6DbNBt; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S238841AbiKPKW4 (ORCPT + 99 others); Wed, 16 Nov 2022 05:22:56 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:55992 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236891AbiKPKVx (ORCPT ); Wed, 16 Nov 2022 05:21:53 -0500 Received: from mail-wr1-x430.google.com (mail-wr1-x430.google.com [IPv6:2a00:1450:4864:20::430]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 44F19220F1 for ; Wed, 16 Nov 2022 02:21:52 -0800 (PST) Received: by mail-wr1-x430.google.com with SMTP id w14so29109575wru.8 for ; Wed, 16 Nov 2022 02:21:52 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; 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=ZzVAeZmGHVgJEk1mN8aP1HtyXLkmqX2nhQXPCT6cTuU=; b=PY6DbNBtnIrOC0If+NnbwkXi4lEoiLW4JHS2tZW1xdp3TZKdRUhJKKypyDtK9OZ2Ql jNm1YMnQscrg9tVYX+9N0xwnHgYGCv4zKyCqPXcN27CjMF4OO8WM6DkQ8lHuEsfoUVkJ Nu25gyIND2qWn/dPbNj58E8FzyD6/FypBhWB9iboODRFstHEl74Px4ooIRHr1oAgrh8k NiEcB2PJFladkoi2+0swKCfuh4Zi6wO/iJkz6j56e61v/kv0Z2VtYMC51AJZLwj3gA0O kSo8ii5v3eAm0hClrCkB4qnL2XXFF4qjEDYyAXvjsMP82MsiFQ/Usr8igLM9pxjeJklC k+NQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; 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=ZzVAeZmGHVgJEk1mN8aP1HtyXLkmqX2nhQXPCT6cTuU=; b=GgBOX8F0EfXgR7OskU9FdgEFb8eOOTo9Ik2AIbslYOYk4zYoZMwdza52Xh6Xx9iTbM CQcgMBl1DPYfZ1XhR5IBb6PvBKYqRlCFBjx+lURMtLvLRyk0es4ZTmZIU72Z0glFRef5 xBHE35eU0OJycz5WI0n4l4wAyUJucmfIz2OI9CYQFn3zNBr5wQYBCfpErdE/IgnH+Y/J RqR9wDMegKDNS+hXrPoH/mqxX6GALRH5fxwvbwveQoikDat5KTM0fDFfNLs6wbY66DV4 UuFt8oY17KE8s19RRG0FDq4o2O/Ntg7GadCrz9NdP/iBHS6LJKjgd47/fJrTszMLX7+7 U7dg== X-Gm-Message-State: ANoB5plWjbIae6ir4ViLm5IvIIT8+BhSApxjQPeljSxm5BdY3H2OZoyM hzF9nz5sQVLdmUHdBydfmKaRmI2vWEWBdg== X-Received: by 2002:adf:b19d:0:b0:236:6fb2:ff91 with SMTP id q29-20020adfb19d000000b002366fb2ff91mr12948000wra.520.1668594110852; Wed, 16 Nov 2022 02:21:50 -0800 (PST) Received: from arrakeen.starnux.net ([2a01:e0a:982:cbb0:52eb:f6ff:feb3:451a]) by smtp.gmail.com with ESMTPSA id o5-20020a05600c510500b003b4ff30e566sm6133615wms.3.2022.11.16.02.21.50 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 16 Nov 2022 02:21:50 -0800 (PST) From: Neil Armstrong Date: Wed, 16 Nov 2022 11:21:49 +0100 Subject: [PATCH 2/6] dt-bindings: i2c: qcom-geni: document I2C Master Hub serial I2C engine MIME-Version: 1.0 Message-Id: <20221114-narmstrong-sm8550-upstream-i2c-master-hub-v1-2-64449106a148@linaro.org> References: <20221114-narmstrong-sm8550-upstream-i2c-master-hub-v1-0-64449106a148@linaro.org> In-Reply-To: <20221114-narmstrong-sm8550-upstream-i2c-master-hub-v1-0-64449106a148@linaro.org> To: Rob Herring , Konrad Dybcio , Andy Gross , Krzysztof Kozlowski , Bjorn Andersson Cc: linux-i2c@vger.kernel.org, linux-arm-msm@vger.kernel.org, linux-kernel@vger.kernel.org, devicetree@vger.kernel.org, Neil Armstrong X-Mailer: b4 0.10.1 X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1749648250708394139?= X-GMAIL-MSGID: =?utf-8?q?1749648250708394139?= The I2C Master Hub is a stripped down version of the GENI Serial Engine QUP Wrapper Controller but only supporting I2C serial engines without DMA support. This documents the I2C Serial Engine variant used within the I2C Master Hub Wrapper. This serial engine variant lacks DMA support, and requires a core clock, and since DMA support is lacking, the memory interconnect path isn't needed. Signed-off-by: Neil Armstrong --- .../bindings/i2c/qcom,i2c-geni-qcom.yaml | 61 +++++++++++++++++----- 1 file changed, 49 insertions(+), 12 deletions(-) diff --git a/Documentation/devicetree/bindings/i2c/qcom,i2c-geni-qcom.yaml b/Documentation/devicetree/bindings/i2c/qcom,i2c-geni-qcom.yaml index 0e7ed00562e2..ea2c28e70cf5 100644 --- a/Documentation/devicetree/bindings/i2c/qcom,i2c-geni-qcom.yaml +++ b/Documentation/devicetree/bindings/i2c/qcom,i2c-geni-qcom.yaml @@ -15,13 +15,13 @@ allOf: properties: compatible: - const: qcom,geni-i2c + enum: + - qcom,geni-i2c + - qcom,geni-i2c-master-hub - clocks: - maxItems: 1 + clocks: true - clock-names: - const: se + clock-names: true clock-frequency: default: 100000 @@ -34,14 +34,9 @@ properties: - const: tx - const: rx - interconnects: - maxItems: 3 + interconnects: true - interconnect-names: - items: - - const: qup-core - - const: qup-config - - const: qup-memory + interconnect-names: true interrupts: maxItems: 1 @@ -71,6 +66,48 @@ required: - clock-names - reg +if: + properties: + compatible: + contains: + const: qcom,geni-i2c-master-hub +then: + properties: + clock-names: + items: + - const: se + - const: core + + clocks: + maxItems: 2 + + dmas: false + dma-names: false + + interconnects: + maxItems: 2 + + interconnect-names: + items: + - const: qup-core + - const: qup-config +else: + properties: + clocks: + maxItems: 1 + + clock-names: + const: se + + interconnects: + maxItems: 3 + + interconnect-names: + items: + - const: qup-core + - const: qup-config + - const: qup-memory + unevaluatedProperties: false examples: From patchwork Wed Nov 16 10:21:50 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Neil Armstrong X-Patchwork-Id: 20878 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:6687:0:0:0:0:0 with SMTP id l7csp62422wru; Wed, 16 Nov 2022 02:23:19 -0800 (PST) X-Google-Smtp-Source: AA0mqf4oeHWlz6woECy4UMHJc5d7moJTpjIshLj9hrWzrxieQFjpSxJdIPm9a41ILAewuJ+7+dY/ X-Received: by 2002:aa7:d281:0:b0:462:79ec:55eb with SMTP id w1-20020aa7d281000000b0046279ec55ebmr17912077edq.151.1668594198772; Wed, 16 Nov 2022 02:23:18 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1668594198; cv=none; d=google.com; s=arc-20160816; b=xl+odf1lSU3xNExOfLUeooOXtuI6jB9aZGOllVGhG+nBrV1zIdzq0AEZRZDZujNi/p VTX47a3ODLhKLvbOmce0RACKgEsu+rnZ4qZ5G2c+DsoutvyTbWwFuOgQ6Trn4DUxzZ6c g/LGZAZpNvVSirl3YNEhTbztxMOa2bcVykVgeRb4O5p45n4ye675I9GwdXVg+khx7qKL 22goMFwBl8UF4q7AGsFXq9RamrxoqVQAm81CkONHQw8uGTGBvblZlUaJZSevbZEYpZEH JEr6JKx/XwnC+c75yi8w86p/dvi58upZkzv9T7H2ecKdK/p7iZFNq4LK1crN/PmM7d6h bvMg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:in-reply-to:references:message-id :content-transfer-encoding:mime-version:subject:date:from :dkim-signature; bh=GhLipikR7108xt+mQGUUpQ8DfphnyPitqRKsqUFWNfk=; b=iLlJLNWPfao5Q/MOH7ZJDggCUh/lVfjpTJPHr2xMA4/NgDrWHza85H5pB8usoaOTeM nncsk9Zuztp4uYbPkEN5YAhKKvWArne+CjWY9hrA/eSwwcoxTl8bmst+0Z7F6MErt68Q +L2JbykInz2w0sN0x2xjhHKZPoXuycROvJJ+4W0nuGEsc0RroIicbcZ/ElYhAHMUocEY TWkQYMmF9/fcklRrx4y+/Ko9tK2UaE8XoJrd2nYWa+MCgItHOZX5j/K+35hD7t49SELv eqiH3zDnFPpvSMqrNYoQRzP5uN+UufTxxUK/g/KWVy5YvsARaEDVB9Cq0X70qi04+iQM lYjQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=uzGLOFK7; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id b23-20020aa7c917000000b00456e33b69e1si11799847edt.347.2022.11.16.02.22.52; Wed, 16 Nov 2022 02:23:18 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=uzGLOFK7; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S238725AbiKPKWZ (ORCPT + 99 others); Wed, 16 Nov 2022 05:22:25 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56982 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233569AbiKPKVy (ORCPT ); Wed, 16 Nov 2022 05:21:54 -0500 Received: from mail-wr1-x42c.google.com (mail-wr1-x42c.google.com [IPv6:2a00:1450:4864:20::42c]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 167E92314E for ; Wed, 16 Nov 2022 02:21:53 -0800 (PST) Received: by mail-wr1-x42c.google.com with SMTP id cl5so29115553wrb.9 for ; Wed, 16 Nov 2022 02:21:53 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; 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=GhLipikR7108xt+mQGUUpQ8DfphnyPitqRKsqUFWNfk=; b=uzGLOFK7HLGuw5ikgGebxyMvFO/YG/0WPs2EZK7lQL9wOc+ovH2QiL5jyClmZDb++I TgLk9JewfYlZ/tM/I95VAvNpDv96sWTM/cY2ien470qNK+LusJG39CWx7+4JTu3oC5LA d/mcWzx5lhj+coxrVaUMCsjoOor4VX3d5xBRYPj136r65+oAEsXRnznn9Kwg53YgMxmX QKAime4lKE6UtHKOD1dnZZI6mgJ44YCn4BZS9Q4MmnBhg09XTl/sV/8qKkJ3sflK8jHA rm5grcfNAuPXIv3yeGhb8d0r0+GbB0tre0Q5bXNmWygQsSHHkUqG3NM/jDyMd6Z92dCx usiA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; 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=GhLipikR7108xt+mQGUUpQ8DfphnyPitqRKsqUFWNfk=; b=ifw6Gj/KXj6OWGghb9OJlLuJHDKXWEjuwI4XzWAjeBADM90rYN8aL4VaPgSaaLxQAr LwEPkTIKv7A1CKVJvNPQ56knNzZbSTxsEcuPe7OPi+ZIBwYf4oqCNKqDpJWSnQmYqBrN vWZOi6T3vwb5JoPnW4vI9zDP5peHLw2IBJHITRBIL7m+4WpKHavHBSm6RyJfrNkEK4W4 0ZC08VEzaGkEP2CqJL4kOo1SILpJkfif4uVQ+NGd8bwPCziIvYpqiiMObsT68S43uBga Qq4A2jiJ5DN/3xU+KfX15W2sWFsJ4Zq1LZLKbYTsWL+8yWmbM7q2Y4XA66sn6Uxwn2VL mMjw== X-Gm-Message-State: ANoB5pkGuv0zKcvNauya3/lJLTQBB44KKnq5gCpqa7qbmNtf0XljVt+F bE/oeW9Tb3aPLrf5hSVb+6yBUQ== X-Received: by 2002:adf:e2d1:0:b0:236:8638:121a with SMTP id d17-20020adfe2d1000000b002368638121amr12635622wrj.188.1668594111621; Wed, 16 Nov 2022 02:21:51 -0800 (PST) Received: from arrakeen.starnux.net ([2a01:e0a:982:cbb0:52eb:f6ff:feb3:451a]) by smtp.gmail.com with ESMTPSA id o5-20020a05600c510500b003b4ff30e566sm6133615wms.3.2022.11.16.02.21.50 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 16 Nov 2022 02:21:51 -0800 (PST) From: Neil Armstrong Date: Wed, 16 Nov 2022 11:21:50 +0100 Subject: [PATCH 3/6] soc: qcom: geni-se: add desc struct to specify clocks from device match data MIME-Version: 1.0 Message-Id: <20221114-narmstrong-sm8550-upstream-i2c-master-hub-v1-3-64449106a148@linaro.org> References: <20221114-narmstrong-sm8550-upstream-i2c-master-hub-v1-0-64449106a148@linaro.org> In-Reply-To: <20221114-narmstrong-sm8550-upstream-i2c-master-hub-v1-0-64449106a148@linaro.org> To: Rob Herring , Konrad Dybcio , Andy Gross , Krzysztof Kozlowski , Bjorn Andersson Cc: linux-i2c@vger.kernel.org, linux-arm-msm@vger.kernel.org, linux-kernel@vger.kernel.org, devicetree@vger.kernel.org, Neil Armstrong X-Mailer: b4 0.10.1 X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1749647830499450473?= X-GMAIL-MSGID: =?utf-8?q?1749647830499450473?= The I2C Master Hub is a stripped down version of the GENI Serial Engine QUP Wrapper Controller but only supporting I2C serial engines without DMA support. This prepares support for the I2C Master Hub variant, by moving the required clocks list to a new desc struct then passing it through the compatible match data. Signed-off-by: Neil Armstrong Reviewed-by: Konrad Dybcio --- drivers/soc/qcom/qcom-geni-se.c | 57 +++++++++++++++++++++++++++++++---------- 1 file changed, 43 insertions(+), 14 deletions(-) diff --git a/drivers/soc/qcom/qcom-geni-se.c b/drivers/soc/qcom/qcom-geni-se.c index a0ceeede450f..f4f54d92a01a 100644 --- a/drivers/soc/qcom/qcom-geni-se.c +++ b/drivers/soc/qcom/qcom-geni-se.c @@ -81,19 +81,31 @@ */ #define MAX_CLK_PERF_LEVEL 32 -#define NUM_AHB_CLKS 2 +#define MAX_CLKS 2 /** * struct geni_wrapper - Data structure to represent the QUP Wrapper Core * @dev: Device pointer of the QUP wrapper core * @base: Base address of this instance of QUP wrapper core - * @ahb_clks: Handle to the primary & secondary AHB clocks + * @clks: Handle to the primary & optional secondary AHB clocks + * @num_clks: Count of clocks * @to_core: Core ICC path */ struct geni_wrapper { struct device *dev; void __iomem *base; - struct clk_bulk_data ahb_clks[NUM_AHB_CLKS]; + struct clk_bulk_data clks[MAX_CLKS]; + unsigned int num_clks; +}; + +/** + * struct geni_se_desc - Data structure to represent the QUP Wrapper resources + * @clks: Name of the primary & optional secondary AHB clocks + * @num_clks: Count of clock names + */ +struct geni_se_desc { + unsigned int num_clks; + const char * const *clks; }; static const char * const icc_path_names[] = {"qup-core", "qup-config", @@ -496,8 +508,7 @@ static void geni_se_clks_off(struct geni_se *se) struct geni_wrapper *wrapper = se->wrapper; clk_disable_unprepare(se->clk); - clk_bulk_disable_unprepare(ARRAY_SIZE(wrapper->ahb_clks), - wrapper->ahb_clks); + clk_bulk_disable_unprepare(wrapper->num_clks, wrapper->clks); } /** @@ -528,15 +539,13 @@ static int geni_se_clks_on(struct geni_se *se) int ret; struct geni_wrapper *wrapper = se->wrapper; - ret = clk_bulk_prepare_enable(ARRAY_SIZE(wrapper->ahb_clks), - wrapper->ahb_clks); + ret = clk_bulk_prepare_enable(wrapper->num_clks, wrapper->clks); if (ret) return ret; ret = clk_prepare_enable(se->clk); if (ret) - clk_bulk_disable_unprepare(ARRAY_SIZE(wrapper->ahb_clks), - wrapper->ahb_clks); + clk_bulk_disable_unprepare(wrapper->num_clks, wrapper->clks); return ret; } @@ -887,11 +896,21 @@ static int geni_se_probe(struct platform_device *pdev) return PTR_ERR(wrapper->base); if (!has_acpi_companion(&pdev->dev)) { - wrapper->ahb_clks[0].id = "m-ahb"; - wrapper->ahb_clks[1].id = "s-ahb"; - ret = devm_clk_bulk_get(dev, NUM_AHB_CLKS, wrapper->ahb_clks); + const struct geni_se_desc *desc; + int i; + + desc = device_get_match_data(&pdev->dev); + if (!desc) + return -EINVAL; + + wrapper->num_clks = min_t(unsigned int, desc->num_clks, MAX_CLKS); + + for (i = 0; i < wrapper->num_clks; ++i) + wrapper->clks[i].id = desc->clks[i]; + + ret = devm_clk_bulk_get(dev, wrapper->num_clks, wrapper->clks); if (ret) { - dev_err(dev, "Err getting AHB clks %d\n", ret); + dev_err(dev, "Err getting clks %d\n", ret); return ret; } } @@ -901,8 +920,18 @@ static int geni_se_probe(struct platform_device *pdev) return devm_of_platform_populate(dev); } +static const char * const qup_clks[] = { + "m-ahb", + "s-ahb", +}; + +static const struct geni_se_desc qup_desc = { + .clks = qup_clks, + .num_clks = ARRAY_SIZE(qup_clks), +}; + static const struct of_device_id geni_se_dt_match[] = { - { .compatible = "qcom,geni-se-qup", }, + { .compatible = "qcom,geni-se-qup", .data = &qup_desc }, {} }; MODULE_DEVICE_TABLE(of, geni_se_dt_match); From patchwork Wed Nov 16 10:21:51 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Neil Armstrong X-Patchwork-Id: 20881 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:6687:0:0:0:0:0 with SMTP id l7csp62550wru; Wed, 16 Nov 2022 02:23:40 -0800 (PST) X-Google-Smtp-Source: AA0mqf5bmLNFkh5SMYnzUnQs5B5JyWwowYL+OBzXTvBx/X720i6IS7La8MFZuHYHDMR/c4RpFlfJ X-Received: by 2002:aa7:de17:0:b0:468:86cf:1da6 with SMTP id h23-20020aa7de17000000b0046886cf1da6mr1852642edv.427.1668594220279; Wed, 16 Nov 2022 02:23:40 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1668594220; cv=none; d=google.com; s=arc-20160816; b=mX04hKIWeYnY7FxDe6DcBenxpm/K4xuB/fsGqCh1Al2EjyVEPZzDuR3l4UKhRiCp6L 6wsE0ngMTAAtl97lBy4FM76x0g3fNGP8aZ2Xwgk/YhmWI+D2yRn9xidFVml+AdI6kisv pWlkKELqotWvql5oD9sF58YL19vPJkZ6vO9W953OPhuKIUOx0gVjbyeBLmG8ilc78ARF QomnZbeUbezeD/wXVWBlO9jhZk6PmVUQkFZbh8SgjOqeWbk6dkd3VKw7BUCyh67VlHG2 GYfiM0JAPLUbzsXoZPeOs2BkiTtwOcIkb9a2xgBnGTyEuoHuyS1cYkivE3BEnbRHTrWH PUeg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:in-reply-to:references:message-id :content-transfer-encoding:mime-version:subject:date:from :dkim-signature; bh=L9LHd2ehuEfnQ9RNakq0DpdG6JioG/27TAyA40ItIwA=; b=NA7HSNjHXgS3oOO+1idfygpYmEdZom152G336GaPhEGS8uxFE+GiSIP01S1AUFi+/f BFeKG699OoEey0WVHoUTV1lXSrFw8f75g7lHIgAZjL4ETUgonCHYUuwBTwf6BaxVNYUp URZOkJma8pNwrZjNO0+k5T3FQPl2xv9X7u/KnkKU4d+PZuwZ9Y6a79bTSepwqVN7Y0op CO1WyMaqJVEJgOxqzONBksf7wmcK51Wprf9zNoaAU00Mr13IewZOmvAGZ6gY/WavqcVN cRx3Kxz7f6LCSmWpJafHqf3UVdaB/a1EDsJMoweqjYEWE4yUrF7nx7pI/ht1zRTT3lxz w/3w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b="R27/7fCy"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id z4-20020a05640235c400b00458bbd3a0d2si15619245edc.602.2022.11.16.02.23.16; Wed, 16 Nov 2022 02:23:40 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b="R27/7fCy"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S238806AbiKPKWd (ORCPT + 99 others); Wed, 16 Nov 2022 05:22:33 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56984 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S237474AbiKPKVz (ORCPT ); Wed, 16 Nov 2022 05:21:55 -0500 Received: from mail-wr1-x42c.google.com (mail-wr1-x42c.google.com [IPv6:2a00:1450:4864:20::42c]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C9F2D222A8 for ; Wed, 16 Nov 2022 02:21:53 -0800 (PST) Received: by mail-wr1-x42c.google.com with SMTP id bs21so29132593wrb.4 for ; Wed, 16 Nov 2022 02:21:53 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; 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=L9LHd2ehuEfnQ9RNakq0DpdG6JioG/27TAyA40ItIwA=; b=R27/7fCyVH45BDUa4WXg6S3Pgbigv9mlZo33xtIQld+3/A8Vwu0VmEU2jmlsnxkxVH mFz9uSAmWYNulgvSMKc+97yYBL3kkCUaxR4R0BZQpQvHSxMSS9fHqmn/uzbX7hFDLC1U G5XkIteo0N/HotD09px3J2jHasyjq8sUa6OTFWtRZS3mv8jvDi1NenU8pqKluaYj9n9R Bh4QZJr1ch1IqlF0eCi46kclUGX2knoqK8yfB7y060bV1Spwel8y2fM8Q/7UKAsHlWJR hJ+CjW33FxEV/ABoQ6wJDXQT4hfRLASN84JEymLiabtGGcUQAE+6ZHYmhDN49eI9k8qP o4dg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; 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=L9LHd2ehuEfnQ9RNakq0DpdG6JioG/27TAyA40ItIwA=; b=oPaFh3JerQctPXp4fTVKkpd6swE8hM2AqtSvES5pF5oGYz68re54kYQX5MVnXX0fTV Z6azgpOdgJcp/0uvs/ws3X6sBKj2Fzfvz9Ck2SjXtLMW+yMsz8avCtofCntB8+hqEHoj 9juwTB5Zw+6z4YsZCBVSH9gioQzcFzws9wwzgKzvsymlQBgc1VDyMMj6KwiCYhH9GJbP xsldBxGooiqpDSayKJ7Kufxniux57xvcdAwlgxKmlcKZdwkxVefdveviPCsFMU8dqG7K m3rKiMjgXBYpmiFFvsEk9M4PyntdpB/FkYhOjE1kpFzaTSLJFVS3HUU7mJIp+ANJkEYN I+ow== X-Gm-Message-State: ANoB5pmcfmHhcKougxQNAvLKB3ufeq5PVjWmZkgk0YuKe+SDiGvyA1Vj 65Xh57t1cRlQ4oYOyMfXxIT3gg== X-Received: by 2002:a05:6000:3:b0:22f:bf9b:b6b3 with SMTP id h3-20020a056000000300b0022fbf9bb6b3mr13045074wrx.108.1668594112362; Wed, 16 Nov 2022 02:21:52 -0800 (PST) Received: from arrakeen.starnux.net ([2a01:e0a:982:cbb0:52eb:f6ff:feb3:451a]) by smtp.gmail.com with ESMTPSA id o5-20020a05600c510500b003b4ff30e566sm6133615wms.3.2022.11.16.02.21.51 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 16 Nov 2022 02:21:52 -0800 (PST) From: Neil Armstrong Date: Wed, 16 Nov 2022 11:21:51 +0100 Subject: [PATCH 4/6] soc: qcom: geni-se: add support for I2C Master Hub wrapper variant MIME-Version: 1.0 Message-Id: <20221114-narmstrong-sm8550-upstream-i2c-master-hub-v1-4-64449106a148@linaro.org> References: <20221114-narmstrong-sm8550-upstream-i2c-master-hub-v1-0-64449106a148@linaro.org> In-Reply-To: <20221114-narmstrong-sm8550-upstream-i2c-master-hub-v1-0-64449106a148@linaro.org> To: Rob Herring , Konrad Dybcio , Andy Gross , Krzysztof Kozlowski , Bjorn Andersson Cc: linux-i2c@vger.kernel.org, linux-arm-msm@vger.kernel.org, linux-kernel@vger.kernel.org, devicetree@vger.kernel.org, Neil Armstrong X-Mailer: b4 0.10.1 X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, SPF_HELO_NONE,SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1749647852905674069?= X-GMAIL-MSGID: =?utf-8?q?1749647852905674069?= The I2C Master Hub is a stripped down version of the GENI Serial Engine QUP Wrapper Controller but only supporting I2C serial engines without DMA support. This adds the clock list for the I2C Master Hub variant to a new desc struct then passes it through the I2C Master Hub compatible match data. Signed-off-by: Neil Armstrong Reviewed-by: Konrad Dybcio --- drivers/soc/qcom/qcom-geni-se.c | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/drivers/soc/qcom/qcom-geni-se.c b/drivers/soc/qcom/qcom-geni-se.c index f4f54d92a01a..8430a0192bb9 100644 --- a/drivers/soc/qcom/qcom-geni-se.c +++ b/drivers/soc/qcom/qcom-geni-se.c @@ -930,8 +930,18 @@ static const struct geni_se_desc qup_desc = { .num_clks = ARRAY_SIZE(qup_clks), }; +static const char * const i2c_master_hub_clks[] = { + "s-ahb", +}; + +static const struct geni_se_desc i2c_master_hub_desc = { + .clks = i2c_master_hub_clks, + .num_clks = ARRAY_SIZE(i2c_master_hub_clks), +}; + static const struct of_device_id geni_se_dt_match[] = { { .compatible = "qcom,geni-se-qup", .data = &qup_desc }, + { .compatible = "qcom,geni-se-i2c-master-hub", .data = &i2c_master_hub_desc }, {} }; MODULE_DEVICE_TABLE(of, geni_se_dt_match); From patchwork Wed Nov 16 10:21:52 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Neil Armstrong X-Patchwork-Id: 20882 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:6687:0:0:0:0:0 with SMTP id l7csp62579wru; Wed, 16 Nov 2022 02:23:47 -0800 (PST) X-Google-Smtp-Source: AA0mqf7Ql2VBQepfwruFUGry5BijDT21HkcFtD1CoXV3f/GmaBlEFgRN55ESWdnEww7BBTDRroCz X-Received: by 2002:a17:906:2b10:b0:7ae:c1af:a034 with SMTP id a16-20020a1709062b1000b007aec1afa034mr17424186ejg.346.1668594227080; Wed, 16 Nov 2022 02:23:47 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1668594227; cv=none; d=google.com; s=arc-20160816; b=qUtrnTcevfOZdbJtOiDp33sigmDVy+aReNvqfCTjZbOPzaG4UnsN5o1iN1Oos/CRMm JAgO2y4D5nffHOCd2fHYZljCnGiD0MwGHWKARKn8J0381JmTi4wNqbBkD1/wHzXfISiP uEvv8OFZgW33i4YZqLQqQTk3RdFK/XESIxDZRx5mzLwr7u/zr/RQyf2RtDmYayuT79++ vwmVEhcsjwIE9erAondpiDyFGK0S2peMuDSRVPjoEt4cEItQGofedp4U/jCAOkN9VSHX ZKvbxodlIsUC1DGXoizTOFC9+0vH1zmqMMESHlgu/d4SRRNPh9m3q85xUTBb4g/K+pby p1Tw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:in-reply-to:references:message-id :content-transfer-encoding:mime-version:subject:date:from :dkim-signature; bh=QkbrSGkXjUoGGQbQrtygV/yUrGDEgUuitud5fT9j05k=; b=0eU5s2X48g0N+xNK+tGRotiJ6rEt+acF0GnfuGy1dqaob2hZBcvtddgSRa141/rkDq M6ovCewjdlFCdG0buJXve9Neni3eSpOPFP10wuIPOOkIonJ6sHOM/4PaUyZCsCV3G6ch e9/UiegQJxrKcUz5xkcXGA6REdTvvQ9waxY04xljABqNaDnkyArW5051POS5YA+SFU0i MsICR11S9d/ohikklha2TST+MgzxukHlyWIqo942oEAHfW4sTBpXpy29GsbAM+Mhvirv OovRJCdOwwyDA6K6Q6MeX1Hu8PC5a2cbTyGAQQM06D4BV1EcuUFTnge9v5eR+17Z0I/r HaTQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=QaEt+UMq; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id y9-20020a056402440900b00463525e8776si15182344eda.491.2022.11.16.02.23.23; Wed, 16 Nov 2022 02:23:47 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=QaEt+UMq; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S238815AbiKPKWg (ORCPT + 99 others); Wed, 16 Nov 2022 05:22:36 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56720 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S237851AbiKPKV5 (ORCPT ); Wed, 16 Nov 2022 05:21:57 -0500 Received: from mail-wr1-x436.google.com (mail-wr1-x436.google.com [IPv6:2a00:1450:4864:20::436]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C82E922BC6 for ; Wed, 16 Nov 2022 02:21:54 -0800 (PST) Received: by mail-wr1-x436.google.com with SMTP id z14so28963516wrn.7 for ; Wed, 16 Nov 2022 02:21:54 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; 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=QkbrSGkXjUoGGQbQrtygV/yUrGDEgUuitud5fT9j05k=; b=QaEt+UMqmob1rJTuN+76JXEU2jZFvVKHks7j75gSzRAnkaZZRJe5Obt7dzyweq5QoH nRJVJOYjoON0J6xJWPs0WXnK5Khfj1RbhQdGHn/Ua5LO5mbHFCSnuW6RxrfWQq8zMJzL aw8cB/HWvyBLY90pbw2sLWqIBpTGUHXnbh2mgxl0B4VqC4HPQHH0RzjSmYt1SmyL0cZq BT2otJ4g7ty4ROgr0sDBT0AcLrmBPtqa8rKN2bnou18ymluuUji/KlRSau015i7QKzn4 pFC9wfeUHmdmCvm2emBKpfEpVDhgbvmnXlh1U3FJm2vvQe5MrU9hsomK/q6nleA7YLf+ xb3Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; 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=QkbrSGkXjUoGGQbQrtygV/yUrGDEgUuitud5fT9j05k=; b=bO1dIc8CUtQC0U0Qk9Rx3QrJyJViksxFXpv5X0HGwh4r6N1idgwS8dTwv95iAP2p5I C/FSyIdqEKyo7IUgUJaO2gPaJqOINQyjFvI0ioJTlTAUyh02evukian57tc+9l3A7Y/u u/9pN7Wk7slErRG8edzLdB7LNbmKVn0l6TIZUB0lQ4UTYPP9Zh5LYD2AA0/ciRks3llW KV07AVrGpURhTXrbTjmOJ2jPJeIQEQpAHkeYsXFuF+KxaBypeXQmNil2MoT4L2YkFiHI eAcQlJqbvWU9waxyHaChxiMQ71Ie6zd9UYanRKonlUQT1FjvxoOKJyThEwvx0w8EVnbq SNnA== X-Gm-Message-State: ANoB5pmvxuOtJKK6eD7OnwQpY37M3jGtkzVAcTppQdydCl5K1V3Gi+5K Ml4wMQzosYfh2qndC87rdufvwNeia31Jqg== X-Received: by 2002:a5d:5603:0:b0:22e:2ecc:663d with SMTP id l3-20020a5d5603000000b0022e2ecc663dmr14077458wrv.633.1668594113310; Wed, 16 Nov 2022 02:21:53 -0800 (PST) Received: from arrakeen.starnux.net ([2a01:e0a:982:cbb0:52eb:f6ff:feb3:451a]) by smtp.gmail.com with ESMTPSA id o5-20020a05600c510500b003b4ff30e566sm6133615wms.3.2022.11.16.02.21.52 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 16 Nov 2022 02:21:52 -0800 (PST) From: Neil Armstrong Date: Wed, 16 Nov 2022 11:21:52 +0100 Subject: [PATCH 5/6] i2c: qcom-geni: add desc struct to prepare support for I2C Master Hub variant MIME-Version: 1.0 Message-Id: <20221114-narmstrong-sm8550-upstream-i2c-master-hub-v1-5-64449106a148@linaro.org> References: <20221114-narmstrong-sm8550-upstream-i2c-master-hub-v1-0-64449106a148@linaro.org> In-Reply-To: <20221114-narmstrong-sm8550-upstream-i2c-master-hub-v1-0-64449106a148@linaro.org> To: Rob Herring , Konrad Dybcio , Andy Gross , Krzysztof Kozlowski , Bjorn Andersson Cc: linux-i2c@vger.kernel.org, linux-arm-msm@vger.kernel.org, linux-kernel@vger.kernel.org, devicetree@vger.kernel.org, Neil Armstrong X-Mailer: b4 0.10.1 X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, SPF_HELO_NONE,SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1749647860364890533?= X-GMAIL-MSGID: =?utf-8?q?1749647860364890533?= The I2C Master Hub is a stripped down version of the GENI Serial Engine QUP Wrapper Controller but only supporting I2C serial engines without DMA support. Those I2C serial engines variants have some requirements: - a separate "core" clock - doesn't support DMA, thus no memory interconnect path - fixed FIFO size not discoverable in the HW_PARAM_0 register This adds a desc struct specifying all those requirements which will be used in a next change when adding the I2C Master Hub serial engine compatible. Signed-off-by: Neil Armstrong Reviewed-by: Konrad Dybcio --- drivers/i2c/busses/i2c-qcom-geni.c | 50 +++++++++++++++++++++++++++++++++++--- 1 file changed, 47 insertions(+), 3 deletions(-) diff --git a/drivers/i2c/busses/i2c-qcom-geni.c b/drivers/i2c/busses/i2c-qcom-geni.c index 84a77512614d..75dd0718c5a1 100644 --- a/drivers/i2c/busses/i2c-qcom-geni.c +++ b/drivers/i2c/busses/i2c-qcom-geni.c @@ -88,6 +88,7 @@ struct geni_i2c_dev { int cur_wr; int cur_rd; spinlock_t lock; + struct clk *core_clk; u32 clk_freq_out; const struct geni_i2c_clk_fld *clk_fld; int suspended; @@ -100,6 +101,13 @@ struct geni_i2c_dev { bool abort_done; }; +struct geni_i2c_desc { + bool has_core_clk; + char *icc_ddr; + bool no_dma_support; + unsigned int tx_fifo_depth; +}; + struct geni_i2c_err_log { int err; const char *msg; @@ -764,6 +772,7 @@ static int geni_i2c_probe(struct platform_device *pdev) u32 proto, tx_depth, fifo_disable; int ret; struct device *dev = &pdev->dev; + const struct geni_i2c_desc *desc = NULL; gi2c = devm_kzalloc(dev, sizeof(*gi2c), GFP_KERNEL); if (!gi2c) @@ -776,6 +785,14 @@ static int geni_i2c_probe(struct platform_device *pdev) if (IS_ERR(gi2c->se.base)) return PTR_ERR(gi2c->se.base); + desc = device_get_match_data(&pdev->dev); + + if (desc && desc->has_core_clk) { + gi2c->core_clk = devm_clk_get(dev, "core"); + if (IS_ERR(gi2c->core_clk)) + return PTR_ERR(gi2c->core_clk); + } + gi2c->se.clk = devm_clk_get(dev, "se"); if (IS_ERR(gi2c->se.clk) && !has_acpi_companion(dev)) return PTR_ERR(gi2c->se.clk); @@ -819,7 +836,7 @@ static int geni_i2c_probe(struct platform_device *pdev) gi2c->adap.dev.of_node = dev->of_node; strscpy(gi2c->adap.name, "Geni-I2C", sizeof(gi2c->adap.name)); - ret = geni_icc_get(&gi2c->se, "qup-memory"); + ret = geni_icc_get(&gi2c->se, desc ? desc->icc_ddr : "qup-memory"); if (ret) return ret; /* @@ -829,12 +846,17 @@ static int geni_i2c_probe(struct platform_device *pdev) */ gi2c->se.icc_paths[GENI_TO_CORE].avg_bw = GENI_DEFAULT_BW; gi2c->se.icc_paths[CPU_TO_GENI].avg_bw = GENI_DEFAULT_BW; - gi2c->se.icc_paths[GENI_TO_DDR].avg_bw = Bps_to_icc(gi2c->clk_freq_out); + if (!desc || desc->icc_ddr) + gi2c->se.icc_paths[GENI_TO_DDR].avg_bw = Bps_to_icc(gi2c->clk_freq_out); ret = geni_icc_set_bw(&gi2c->se); if (ret) return ret; + ret = clk_prepare_enable(gi2c->core_clk); + if (ret) + return ret; + ret = geni_se_resources_on(&gi2c->se); if (ret) { dev_err(dev, "Error turning on resources %d\n", ret); @@ -844,10 +866,15 @@ static int geni_i2c_probe(struct platform_device *pdev) if (proto != GENI_SE_I2C) { dev_err(dev, "Invalid proto %d\n", proto); geni_se_resources_off(&gi2c->se); + clk_disable_unprepare(gi2c->core_clk); return -ENXIO; } - fifo_disable = readl_relaxed(gi2c->se.base + GENI_IF_DISABLE_RO) & FIFO_IF_DISABLE; + if (desc && desc->no_dma_support) + fifo_disable = false; + else + fifo_disable = readl_relaxed(gi2c->se.base + GENI_IF_DISABLE_RO) & FIFO_IF_DISABLE; + if (fifo_disable) { /* FIFO is disabled, so we can only use GPI DMA */ gi2c->gpi_mode = true; @@ -859,6 +886,16 @@ static int geni_i2c_probe(struct platform_device *pdev) } else { gi2c->gpi_mode = false; tx_depth = geni_se_get_tx_fifo_depth(&gi2c->se); + + /* I2C Master Hub Serial Elements doesn't have the HW_PARAM_0 register */ + if (!tx_depth && desc) + tx_depth = desc->tx_fifo_depth; + + if (!tx_depth) { + dev_err(dev, "Invalid TX FIFO depth\n"); + return -EINVAL; + } + gi2c->tx_wm = tx_depth - 1; geni_se_init(&gi2c->se, gi2c->tx_wm, tx_depth); geni_se_config_packing(&gi2c->se, BITS_PER_BYTE, @@ -867,6 +904,7 @@ static int geni_i2c_probe(struct platform_device *pdev) dev_dbg(dev, "i2c fifo/se-dma mode. fifo depth:%d\n", tx_depth); } + clk_disable_unprepare(gi2c->core_clk); ret = geni_se_resources_off(&gi2c->se); if (ret) { dev_err(dev, "Error turning off resources %d\n", ret); @@ -932,6 +970,8 @@ static int __maybe_unused geni_i2c_runtime_suspend(struct device *dev) gi2c->suspended = 1; } + clk_disable_unprepare(gi2c->core_clk); + return geni_icc_disable(&gi2c->se); } @@ -944,6 +984,10 @@ static int __maybe_unused geni_i2c_runtime_resume(struct device *dev) if (ret) return ret; + ret = clk_prepare_enable(gi2c->core_clk); + if (ret) + return ret; + ret = geni_se_resources_on(&gi2c->se); if (ret) return ret; From patchwork Wed Nov 16 10:21:53 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Neil Armstrong X-Patchwork-Id: 20879 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:6687:0:0:0:0:0 with SMTP id l7csp62429wru; Wed, 16 Nov 2022 02:23:19 -0800 (PST) X-Google-Smtp-Source: AA0mqf7j/gYygTI464Um/kTVVhPnUL8wBy9P6BqmD+vjN0anm/DmkdIP2FoBqFRQ9McaVEzGShQX X-Received: by 2002:a17:90a:f82:b0:213:fbf3:f3 with SMTP id 2-20020a17090a0f8200b00213fbf300f3mr3059179pjz.203.1668594199453; Wed, 16 Nov 2022 02:23:19 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1668594199; cv=none; d=google.com; s=arc-20160816; b=RHkTt7RazbAz7QF39HrDD4eeK9JFpqtqjzg9oT7xx/nqxWViEe3U/rlKhybJTJQ3yh 7zlfN7AqAVTWacIxdI8Wwe3pjbx5P2sExgpgVvT+QEqu1g7k6ztLceN7eK7yG81OzsAS rn7rPwe52UWecfT0stJfu5BwEEfdTgTBdYoUrmDzOZOjby/F17mq/6/K+9Rjjy5/k6jK lN8jI9minkEUXWRZUEDzd5ol4wXV1171J89nHEgthbBRbr+l5WukuyJpaC274pctbxs3 PFJTa8+mjZUXawczvHCE3mHOCdgCfVOdAHdws7Dq23TRgeo/Fs5osIZkQPtMeBa6jLke 8spg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:in-reply-to:references:message-id :content-transfer-encoding:mime-version:subject:date:from :dkim-signature; bh=pv5CcBvM1Y0DmqwfRO50yvVc4LT+eZLqos1FdCMiOYE=; b=KGlF8uM3KjF0i40Futi5iHs/i+Kw/HUMuJkGPnCrAK/fN0yllyqXZoHG/gowcj2LM5 qeQSOIycKNAyN6vhvwFJq2sLcw4Crad+qO0g2ge/MbnMDgjB6sQ5WljxvwJcaF7mKWR2 22HusVo4XWrnM95lf73OxRQasrwxGBEnbP75vIDpP3ykbzTHMQMCe6zrEOAMeCc4/eh5 FU7k7WeFuIRx6EiRsr0pbYQrkNRfSb7Scrm2zneHSakOJ9eRXTB/V3vnqHFbfPkNG36/ R6+j+U/1Ps4NiE2VKTVwsaMi/SWTqd5NgdaO6EhNFsTrEmojat7FtAA0qkuP+mPNGgyq l+zA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=sNX56Yaa; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id 144-20020a630296000000b0045ec918ad31si15193151pgc.544.2022.11.16.02.23.06; Wed, 16 Nov 2022 02:23:19 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=sNX56Yaa; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233298AbiKPKW2 (ORCPT + 99 others); Wed, 16 Nov 2022 05:22:28 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56802 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231310AbiKPKV4 (ORCPT ); Wed, 16 Nov 2022 05:21:56 -0500 Received: from mail-wr1-x433.google.com (mail-wr1-x433.google.com [IPv6:2a00:1450:4864:20::433]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C7D9422299 for ; Wed, 16 Nov 2022 02:21:54 -0800 (PST) Received: by mail-wr1-x433.google.com with SMTP id bs21so29132738wrb.4 for ; Wed, 16 Nov 2022 02:21:54 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; 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=pv5CcBvM1Y0DmqwfRO50yvVc4LT+eZLqos1FdCMiOYE=; b=sNX56Yaa+zhdebatzuNg1q/oOgZqyK47/jJYDv8HGwrlB9RJ5B9k/A+KJAJwj6uWvH kXVMwg5mVJyulez1FN1bzC/VaDWDyQddXHLz8D96l7RgQh08thdIETLdXPUkC1EsZKOt DUkHxF5msJUPlbmPcbPdLyCTsuawKS0+6zmLNEpDvZTyAv06bjmVH/ypRAqhw7SE7+tP Idh9ZydDXdNC06roDDAbmQJNx/OlWkJd6IyQCDvxB0DE/UpX0a2jkBlIehhGCDtWgjSw fjffMyuYYRJv4ioS/LhSCsLavArIdobqXIehzw5QAYYBlJ7SD3MgZBXAOxgbsDBMc4Q2 rkMQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; 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=pv5CcBvM1Y0DmqwfRO50yvVc4LT+eZLqos1FdCMiOYE=; b=vwU5UGnInWVIICAzPjjE7HweQzUKxS6ln86hFHtz2gL90QyVT7uQMN0atuh5NOTwmj god4301AvwWWi/+uMuxBThLlGI0cJncDeOnutFV3l4w33bhBIBvqnElNDF/Nw1V58cTU IwUIdetAc6XDOds/VtLN/+kXR7Sp+SEGUMuYiALnsXRMwZQdEm1wyFB9qhmPO+qTeYYg YeRv+a+/vM3rA3ysZhZaUQ4f27HlzKNKx65vWdCJJoZ+yVg1ND51hm1n7Q1sPzPWynLa ZcUJxvoe3XhHDNkz+i/AKaJBjLNhyE2qdZP2rWHwcVLpcdax/3Ee/myWZsgQsLUc+ncP /sYQ== X-Gm-Message-State: ANoB5plzMZcbjQPEiEGpjGQai15GGAmAsfR2WuVZOBxMHjbO/cvSKbgs u5qS5Ymj+QPHi8R3LbjfxV2yqQ== X-Received: by 2002:adf:fc47:0:b0:22e:4953:9932 with SMTP id e7-20020adffc47000000b0022e49539932mr13484547wrs.486.1668594114246; Wed, 16 Nov 2022 02:21:54 -0800 (PST) Received: from arrakeen.starnux.net ([2a01:e0a:982:cbb0:52eb:f6ff:feb3:451a]) by smtp.gmail.com with ESMTPSA id o5-20020a05600c510500b003b4ff30e566sm6133615wms.3.2022.11.16.02.21.53 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 16 Nov 2022 02:21:53 -0800 (PST) From: Neil Armstrong Date: Wed, 16 Nov 2022 11:21:53 +0100 Subject: [PATCH 6/6] i2c: qcom-geni: add support for I2C Master Hub variant MIME-Version: 1.0 Message-Id: <20221114-narmstrong-sm8550-upstream-i2c-master-hub-v1-6-64449106a148@linaro.org> References: <20221114-narmstrong-sm8550-upstream-i2c-master-hub-v1-0-64449106a148@linaro.org> In-Reply-To: <20221114-narmstrong-sm8550-upstream-i2c-master-hub-v1-0-64449106a148@linaro.org> To: Rob Herring , Konrad Dybcio , Andy Gross , Krzysztof Kozlowski , Bjorn Andersson Cc: linux-i2c@vger.kernel.org, linux-arm-msm@vger.kernel.org, linux-kernel@vger.kernel.org, devicetree@vger.kernel.org, Neil Armstrong X-Mailer: b4 0.10.1 X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1749647831386206776?= X-GMAIL-MSGID: =?utf-8?q?1749647831386206776?= The I2C Master Hub is a stripped down version of the GENI Serial Engine QUP Wrapper Controller but only supporting I2C serial engines without DMA support. This adds the I2C Master Hub serial engine compatible along the specific requirements in a new desc struct passed throug the device match data. Signed-off-by: Neil Armstrong Reviewed-by: Konrad Dybcio --- drivers/i2c/busses/i2c-qcom-geni.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/drivers/i2c/busses/i2c-qcom-geni.c b/drivers/i2c/busses/i2c-qcom-geni.c index 75dd0718c5a1..bfe75038bc14 100644 --- a/drivers/i2c/busses/i2c-qcom-geni.c +++ b/drivers/i2c/busses/i2c-qcom-geni.c @@ -1026,8 +1026,16 @@ static const struct dev_pm_ops geni_i2c_pm_ops = { NULL) }; +const struct geni_i2c_desc i2c_master_hub = { + .has_core_clk = true, + .icc_ddr = NULL, + .no_dma_support = true, + .tx_fifo_depth = 16, +}; + static const struct of_device_id geni_i2c_dt_match[] = { { .compatible = "qcom,geni-i2c" }, + { .compatible = "qcom,geni-i2c-master-hub", .data = &i2c_master_hub }, {} }; MODULE_DEVICE_TABLE(of, geni_i2c_dt_match);