From patchwork Mon Oct 31 16:05:07 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Neil Armstrong X-Patchwork-Id: 13333 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:6687:0:0:0:0:0 with SMTP id l7csp2399171wru; Mon, 31 Oct 2022 09:07:43 -0700 (PDT) X-Google-Smtp-Source: AMsMyM55IJqD9xn4vCJG1hHVFevBY/b3h4Wf4uAM4Tyb40rZETbe+SpJfBe/ZYcHlHFI+AchkOCe X-Received: by 2002:a05:6a00:1391:b0:56d:2b6f:57b3 with SMTP id t17-20020a056a00139100b0056d2b6f57b3mr11742567pfg.56.1667232462960; Mon, 31 Oct 2022 09:07:42 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1667232462; cv=none; d=google.com; s=arc-20160816; b=PXJeKNXf0TzzwiOFmBwoUvPwsAaCPusDEntKMWyAt8VVvhtD6DWf7rH2ApFG5W2PCL 9qcbJNgTSX9Bgu/6hbcSUNRSWXZS2PMvmimnGeQmFC1WJPNjKlyfYIuRlQtraVHRoZsd JDycQBnP6bzpJUvWDZlWHpCs1CBJ6Suwr6j95MqiBIkKSt058qQrCzJIWNkGXjhTFhMl sDYiFVe7N0cXJxZYamNoORHcpk7oxGXDcNk6IS5zdz5yXmtQdxN0ivQPJ/uctJiIdqjw VYCg5cO120EHqgfRT1Wf/+VMgvBsmVo3D0fx4+m2DtpY95x8zCyQ9bfq+UFiCdSStN74 /GMw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:to:message-id:content-transfer-encoding :mime-version:subject:date:from:dkim-signature; bh=vMcMEvm8w0Wh/uUg9tQfpvnyjGSnqr3OvUHb1KDw93o=; b=yJLDeqkggL1S1yDmkYH1JlrPn9FpWCsg8d3ZmC0dvPTPlJXc0+A+Fd1eQQlCxGJSKR 4F4MwosxAyGKHunQUGpseUEV/yAXQv+teSLAYU2oEXOrn//TEbRj2DDeLERmyJ20m7rw 910ASkO6Nvi64faW8cHzBFKBajeYG+/pobBqLTYfqft50TbCfCb3nHwsI5kyRObHbUC+ P3gEulaLiUsSGr2hQNYqMZ2c1lb+lyMm+YI5T06UQq8QqTojcSN006Wy52Kt6zm5jVYp hpU4INfAFaJ+29CKh0eH2AxI182/WyTBU+zfy3mUafxN8buVMvr+KEq8hBQvbx6hrxZ+ gjLg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b="wECf1T/h"; 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 lw16-20020a17090b181000b002137a2faf08si10767516pjb.127.2022.10.31.09.07.28; Mon, 31 Oct 2022 09:07:42 -0700 (PDT) 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="wECf1T/h"; 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 S231556AbiJaQFP (ORCPT + 99 others); Mon, 31 Oct 2022 12:05:15 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:36562 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231134AbiJaQFN (ORCPT ); Mon, 31 Oct 2022 12:05:13 -0400 Received: from mail-wr1-x434.google.com (mail-wr1-x434.google.com [IPv6:2a00:1450:4864:20::434]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 050FDFCA for ; Mon, 31 Oct 2022 09:05:12 -0700 (PDT) Received: by mail-wr1-x434.google.com with SMTP id v1so16620776wrt.11 for ; Mon, 31 Oct 2022 09:05:11 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=to:message-id:content-transfer-encoding:mime-version:subject:date :from:from:to:cc:subject:date:message-id:reply-to; bh=vMcMEvm8w0Wh/uUg9tQfpvnyjGSnqr3OvUHb1KDw93o=; b=wECf1T/hIprOVUIsVIa0UREMNhSTOAIqnqQYSEFB80mGeffnIa89iRuURvIgPdJyld l/SMCaMmg3AwsliTcYeVdiCk90bnMY0lOEeiBrJyTWSROPB5CxWzSJzPpsPwnH33pRDF uh3FcEUhf0UBDW0OB0W9Qt7hLGixoq4mqE1GlXSQzSa0wMHuWhcMfsbNFujkQ9f3wCn+ IXTsAhJqU7VdngqVFdCrOSShclp5ClEubDIAxTmt/4xGK5a75ag1HD+RYHN6v2WcUNmH ebP5VjvN66Ecq5e4amJuj1w2bkPuzk/FpC4kc3Qkb+FK/h4Mn2VzWvgmrINM5Muhijfe dbhw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=to:message-id:content-transfer-encoding:mime-version:subject:date :from:x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=vMcMEvm8w0Wh/uUg9tQfpvnyjGSnqr3OvUHb1KDw93o=; b=JhR4NRUYRglk8HUjYCYeqHhG9BHNVtnIipxn9YwrcmQmWcBcGn9nhYypv0YUreVVxo vLx2/kiE+IRSJSke6abi8vdTF/mW93fUtOIPQJma11T5bQ3bC6yTm8ea9N+mWBXHa86E TAC8tbpcniy4sbdLXppKEX4ULObb6Qwp9CxVeqvzBo30WuI6dZXet5HOftyMCH5SVWwd NIWZ/n527gKWw9lXcwvBE7B4gAU/wApMbWTe+YSnRH8IMWt3WrTX5emYV/WjKfP1dqrt OH6pEUn5FCIcfyvOyXLTCvxuNn7LQgWJ1ynkUw18D1JIVBFlUJNM/ErlYOpZFQmA00xF QaLg== X-Gm-Message-State: ACrzQf0rjjalmV7z6cCDYhYX5vTTwMDVz4lcko1oNRSIS8XoEe5zqpVX TSN+2ocjX9GQCXTIcBb5rJFhww== X-Received: by 2002:adf:f5c4:0:b0:236:c419:710f with SMTP id k4-20020adff5c4000000b00236c419710fmr4787510wrp.56.1667232310598; Mon, 31 Oct 2022 09:05:10 -0700 (PDT) Received: from arrakeen.starnux.net ([2a01:e0a:982:cbb0:8261:5fff:fe11:bdda]) by smtp.gmail.com with ESMTPSA id f18-20020a1cc912000000b003cf5ec79bf9sm7701997wmb.40.2022.10.31.09.05.09 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 31 Oct 2022 09:05:10 -0700 (PDT) From: Neil Armstrong Date: Mon, 31 Oct 2022 17:05:07 +0100 Subject: [PATCH v2] mfd: rk808: permit having multiple PMIC instances MIME-Version: 1.0 Message-Id: <20221025-rk808-multi-v2-0-d292d51ada81@linaro.org> To: Neil Armstrong , Lee Jones , linux-kernel@vger.kernel.org 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?1747654003472320704?= X-GMAIL-MSGID: =?utf-8?q?1748219946983679172?= This set each cells id to PLATFORM_DEVID_NONE to allow multiple instances of each cell in case multiple PMICs handled by the rk808 driver are probed. This fixes probing a RK818 and a RK817 on the Odroid Go Ultra devices. Signed-off-by: Neil Armstrong --- Cc: Lee Jones Cc: linux-kernel@vger.kernel.org --- Changes in v2: - replaced -1 by PLATFORM_DEVID_NONE - Link to v1: https://lore.kernel.org/r/20221025-rk808-multi-v1-0-c07b7cf3fd67@linaro.org --- drivers/mfd/rk808.c | 26 ++++++++++++++++---------- 1 file changed, 16 insertions(+), 10 deletions(-) --- base-commit: 247f34f7b80357943234f93f247a1ae6b6c3a740 change-id: 20221025-rk808-multi-65dd03a92705 Best regards, diff --git a/drivers/mfd/rk808.c b/drivers/mfd/rk808.c index e00da7c7e3b1..c9337c1fd748 100644 --- a/drivers/mfd/rk808.c +++ b/drivers/mfd/rk808.c @@ -137,58 +137,64 @@ static const struct resource rk817_charger_resources[] = { }; static const struct mfd_cell rk805s[] = { - { .name = "rk808-clkout", }, - { .name = "rk808-regulator", }, - { .name = "rk805-pinctrl", }, + { .name = "rk808-clkout", .id = PLATFORM_DEVID_NONE, }, + { .name = "rk808-regulator", .id = PLATFORM_DEVID_NONE, }, + { .name = "rk805-pinctrl", .id = PLATFORM_DEVID_NONE, }, { .name = "rk808-rtc", .num_resources = ARRAY_SIZE(rtc_resources), .resources = &rtc_resources[0], + .id = PLATFORM_DEVID_NONE, }, { .name = "rk805-pwrkey", .num_resources = ARRAY_SIZE(rk805_key_resources), .resources = &rk805_key_resources[0], + .id = PLATFORM_DEVID_NONE, }, }; static const struct mfd_cell rk808s[] = { - { .name = "rk808-clkout", }, - { .name = "rk808-regulator", }, + { .name = "rk808-clkout", .id = PLATFORM_DEVID_NONE, }, + { .name = "rk808-regulator", .id = PLATFORM_DEVID_NONE, }, { .name = "rk808-rtc", .num_resources = ARRAY_SIZE(rtc_resources), .resources = rtc_resources, + .id = PLATFORM_DEVID_NONE, }, }; static const struct mfd_cell rk817s[] = { - { .name = "rk808-clkout",}, - { .name = "rk808-regulator",}, + { .name = "rk808-clkout", .id = PLATFORM_DEVID_NONE, }, + { .name = "rk808-regulator", .id = PLATFORM_DEVID_NONE, }, { .name = "rk805-pwrkey", .num_resources = ARRAY_SIZE(rk817_pwrkey_resources), .resources = &rk817_pwrkey_resources[0], + .id = PLATFORM_DEVID_NONE, }, { .name = "rk808-rtc", .num_resources = ARRAY_SIZE(rk817_rtc_resources), .resources = &rk817_rtc_resources[0], + .id = PLATFORM_DEVID_NONE, }, - { .name = "rk817-codec",}, + { .name = "rk817-codec", .id = PLATFORM_DEVID_NONE, }, { .name = "rk817-charger", .num_resources = ARRAY_SIZE(rk817_charger_resources), .resources = &rk817_charger_resources[0], + .id = PLATFORM_DEVID_NONE, }, }; static const struct mfd_cell rk818s[] = { - { .name = "rk808-clkout", }, - { .name = "rk808-regulator", }, + { .name = "rk808-regulator", .id = PLATFORM_DEVID_NONE, }, { .name = "rk808-rtc", .num_resources = ARRAY_SIZE(rtc_resources), .resources = rtc_resources, + .id = PLATFORM_DEVID_NONE, }, };