From patchwork Thu Feb 22 13:52:01 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Abel Vesa X-Patchwork-Id: 13567371 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 81D3DC54788 for ; Thu, 22 Feb 2024 13:52:45 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:Cc:To:MIME-Version:Message-Id:Date: Subject:From:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References: List-Owner; bh=YV6KiKLvWM5LW7cRMXlMidpe3wAfTBeLqw232g9Gtmk=; b=G/XeeLkYWkBemH q2bOUMANXwAsCVnTK3MLPrRiI11X5i5/ZYA2fiLPjS5OVbaJZto2uQESSEwOt9g7bvPNzwpMY5riQ 1o40GO143oJ+RFOULIIrK/uXwZfNGVl3lTJKZ39UlMCqXg9N2LyCeMD3n7RQEP7VCXuwR1GsH6eTY nwnLPvl23qw5sPfyPNrRUNtmHFHrvo2zLEzb09r8iV9h+NiI6j+1HQbU8Xth+nhuGdHqvqhEXBB+S 6+EJkWiqJY8gOEY9PAIblI0h2pzaXWZ7dSkZLIFY6660do/5nkmEBh3ASUA7UjkvrwxarBlhlKaO8 gAMJl90F70yEFm9vjCvw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1rd9Ux-000000056t2-0Qx3; Thu, 22 Feb 2024 13:52:27 +0000 Received: from mail-ej1-x634.google.com ([2a00:1450:4864:20::634]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1rd9Us-000000056o2-3qei for linux-arm-kernel@lists.infradead.org; Thu, 22 Feb 2024 13:52:25 +0000 Received: by mail-ej1-x634.google.com with SMTP id a640c23a62f3a-a3ee69976c9so507504966b.0 for ; Thu, 22 Feb 2024 05:52:21 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1708609941; x=1709214741; darn=lists.infradead.org; h=cc:to:content-transfer-encoding:mime-version:message-id:date :subject:from:from:to:cc:subject:date:message-id:reply-to; bh=KkwALuuS9M9PSFBFc5tMoPkB9c/kjBr1oSlzVPQUlEY=; b=sBmgn0UpkIlQfjTHc7DDCpxdbR9ceK9sxDe5c96jxxobJos5u7XrROhwSrEKfXYN8l mXl/U0IvV8kyhw0f2UionrfCvijh/V2PUcp0e0ZzeXOFZvsjTIwMjw9B0R8IBxr8yWqi jFDYtHfbbOBK5FEbWqQqu3DT3j2WBYSzWeFMb0ha0k1cIJV+Zhl3lpa6tmPVTFHjmWW+ mOjgIAW+hT8ePmG4zGUyGl8gXSX9M+MoorvdpEO34NiZ148O6uSLTnRmL3c1nPr9ILvq 4Q75GDV9KXaUYklx2OLOur/vGp2pvR+0v8Fx/IsqhgN1kxMXHYZzCdYuo2ZlO/Bz8pNj pNcQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1708609941; x=1709214741; h=cc:to:content-transfer-encoding:mime-version:message-id:date :subject:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=KkwALuuS9M9PSFBFc5tMoPkB9c/kjBr1oSlzVPQUlEY=; b=Me9XOOdc9VjSTA7+G8ynZmFe7Weel/geR3q8VX0Wfmfyil4Nt1y4pbNjcqSilsIU4K 3zFctVJsOXyCyF5hMd1OnetkvYYeGzP42zKYXtK29NpoAlvQhnshK/sh8WGZqDPd1z9L upDsduXI4FDoBQsI3hQBVEBVhDFQCNGLkRG9WO7AG0j+dkq1V5bCQcar0ZkrEkCAVsKy vN71NV+/yUBZCHAOW0O6ki6uJeFi4shdcNFjPYrZ2/g8xOvzDK2ZgDqNVKqBrI5Yk4W1 48L7lMWYJ5SOFMNBsiR+t6J53W5UDR1/MfnsrsRiioM04+4pbYwZmU+B9bUtU/wMrm8z xS7g== X-Forwarded-Encrypted: i=1; AJvYcCVUsc1IdnENn/f1ES9TNweyPBttAia86CYiIfrW2xLCYPv3TZtZiFQdmdyIyVBAYlVGdDFqLG2ExlPnbaz9VeYctNMDf7/USgIt2qlbU72NPlUfkpY= X-Gm-Message-State: AOJu0Yx4z0yUoxLxS5ABw9CQJVI4ieMm4KLd1RIs4gbP6Rc9bbysrPYZ KbIQyksinrglBgUIKZNNR8AigKajITO07377Axr7mEaswRciYBndg/rAWk6oE00= X-Google-Smtp-Source: AGHT+IEELfLxUsEw/wegIN32tw4xel6QaTJaQ7ZIgjPnVyn4Lso+bKU8EelVOd8FRy1aWXX1guCfWg== X-Received: by 2002:a17:906:69b:b0:a3f:6302:1e61 with SMTP id u27-20020a170906069b00b00a3f63021e61mr2427516ejb.73.1708609940572; Thu, 22 Feb 2024 05:52:20 -0800 (PST) Received: from [127.0.1.1] ([188.24.162.93]) by smtp.gmail.com with ESMTPSA id ot18-20020a170906ccd200b00a3ecdd0ba23sm3382839ejb.52.2024.02.22.05.52.19 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 22 Feb 2024 05:52:20 -0800 (PST) From: Abel Vesa Subject: [PATCH v6 0/5] spmi: pmic-arb: Add support for multiple buses Date: Thu, 22 Feb 2024 15:52:01 +0200 Message-Id: <20240222-spmi-multi-master-support-v6-0-bc34ea9561da@linaro.org> MIME-Version: 1.0 X-B4-Tracking: v=1; b=H4sIAIJR12UC/43OwWrDMAwG4FcpPs9DluzY7WnvMXawHbs1tHGw0 7BR8u5ze8oIhF0Ev+D/pAeroaRQ2enwYCXMqaY8tNC9HZi/2OEceOpbZggoAUHzOt4Sv92vU5u 2TqHweh/HXCZuCK0G6bQ+Otb6Ywkxfb/sz6+WL6lOufy8Ts3iuf2POgsO3AelI4HwOvYf1zTYk t9zObMnO+OKErRHIRfckROAhN0Rug1Fa0ruUdS+AmcDhAgy2rih5IpC2KNko3pvBHmjjbNmQ6k 1JfYo1ShCpbyVgiy4P9SyLL/Uqumg7wEAAA== To: Stephen Boyd , Matthias Brugger , Bjorn Andersson , Konrad Dybcio , Dmitry Baryshkov , Neil Armstrong , AngeloGioacchino Del Regno , Rob Herring , Krzysztof Kozlowski , Conor Dooley Cc: Srini Kandagatla , Johan Hovold , linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-arm-msm@vger.kernel.org, linux-mediatek@lists.infradead.org, devicetree@vger.kernel.org, Abel Vesa X-Mailer: b4 0.13.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=3091; i=abel.vesa@linaro.org; h=from:subject:message-id; bh=9rVzNTAAYXnMs7MfpROp5deA4r6Lb7fRQnEpmwvz2mE=; b=owEBbQKS/ZANAwAKARtfRMkAlRVWAcsmYgBl11GH+c4If4nAE5FyaKTtc/3NCAvH3/McfFiQ0 EdOWR2irGGJAjMEAAEKAB0WIQRO8+4RTnqPKsqn0bgbX0TJAJUVVgUCZddRhwAKCRAbX0TJAJUV ViZ0D/4oKGeePCJ4orbhRWOkHQQ3C76zvhHTi62Jnmh/9BH295YEYcH8MfACfkUgDBlS71WKaEq cWDTuob8hQ4ZlSjTBmMEG9SKPvSYUIwgOKO2RQZcaJnoCtNcT1hIswNSLS9v3PnO4gjX8XWbXpW nGro6zGnkOc+yRDyrBw5I2gG4azgiGVdRPplw9nyj96gnGxBxkE8KFNBA55Kg8C/shBTy9FrYcO JrDzlP1ApPjJcknVOqjen+dvQys5DuWeTYk3W0uiXgD8OTrTCC81mO7RZk9FCOk/Ub1ehu/OGJW iHDUErCFD91TvYnd/hng5/w6jUPqT+Pq9ltSO8W67gpK8XMsRAaYN5EEb7D6mHoZarJdVbFJqGj W+347CHkmCK9OpGTheyBRNVy2+BhGj/kDfeejdR5bqQ6z1mxkswp9/s4HkvOlF6pQgQd4olkul6 WZ9alv9v3yRRqzGcczy3iD+7r+5WS5tn+/qH19ZMKtpboUW/8PY0LEm6aarESXi/pA5n638rN56 wRq8U0cxMV8G3P+v/wdgnnpXRp0u9IF2+Fr2jasXGVua5aky9FhmEdNdYpF2mBPfKKJDJhFsw7O YJ0S/7DfmcAJpR8UcrvdYzX4KXWom6yWz+goyKx9B3GNT/bAAv+eRrs6GnFWN58vFP0QkOpQT3g 7VXgTcLlQ8TTVRw== X-Developer-Key: i=abel.vesa@linaro.org; a=openpgp; fpr=6AFF162D57F4223A8770EF5AF7BF214136F41FAE X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240222_055223_214628_73BC92EC X-CRM114-Status: GOOD ( 14.67 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org This RFC prepares for and adds support for 2 buses, which is supported in HW starting with version 7. Until now, none of the currently supported platforms in upstream have used the second bus. The X1E80100 platform, on the other hand, needs the second bus for the USB2.0 to work as there are 3 SMB2360 PMICs which provide eUSB2 repeaters and they are all found on the second bus. Signed-off-by: Abel Vesa --- Changes in v6: - Changed the compatible to platform specific (X1E80100) along with the schema. Fixed the spmi buses unit addresses and added the empty ranges property. Added missing properties to the spmi buses and the "unevaluatedProperties: false". - Deprecated the "qcom,bus-id" in the legacy schema. - Changed the driver to check for legacy compatible first - Link to v5: https://lore.kernel.org/r/20240221-spmi-multi-master-support-v5-0-3255ca413a0b@linaro.org Changes in v5: - Dropped the RFC as there aren't any concerns about the approach anymore - Dropped the unused dev and res variables from pmic_arb_get_obsrvr_chnls_v2 - Link to v4: https://lore.kernel.org/r/20240220-spmi-multi-master-support-v4-0-dc813c878ba8@linaro.org Changes in v4: - Fixed comment above pmic_arb_init_apid_v7 by dropping the extra "bus" word - Swicthed to devm_platform_ioremap_resource_byname for obsrvr and chnls. The core remains with platform_get_resource_byname as we need the core size. - Dropped comment from probe related to the need of platform_get_resource_byname as it not true anymore. - Dropped the qcom,bus-id optional property. - Link to v3: https://lore.kernel.org/r/20240214-spmi-multi-master-support-v3-0-0bae0ef04faf@linaro.org Changes in v3: - Split the change into 3 separate patches. First 2 patches are moving apid init and core resources into version specific ops. Third one is adding the support for 2 buses and dedicated compatible. - Added separate bindings patch - Link to v2: https://lore.kernel.org/r/20240213-spmi-multi-master-support-v2-1-b3b102326906@linaro.org Changes in v2: - Reworked it so that it registers a spmi controller for each bus rather than relying on the generic framework to pass on the bus (master) id. - Link to v1: https://lore.kernel.org/r/20240207-spmi-multi-master-support-v1-0-ce57f301c7fd@linaro.org --- Abel Vesa (5): dt-bindings: spmi: Add X1E80100 SPMI PMIC ARB schema dt-bindings: spmi: Deprecate qcom,bus-id spmi: pmic-arb: Make the APID init a version operation spmi: pmic-arb: Make core resources acquiring a version operation spmi: pmic-arb: Add multi bus support .../bindings/spmi/qcom,spmi-pmic-arb.yaml | 1 + .../bindings/spmi/qcom,x1e80100-spmi-pmic-arb.yaml | 136 +++ drivers/spmi/spmi-pmic-arb.c | 948 +++++++++++++-------- 3 files changed, 715 insertions(+), 370 deletions(-) --- base-commit: 4893c639cc3659cefaa675bf1e59f4e7571afb5c change-id: 20240207-spmi-multi-master-support-832a704b779b Best regards,