From patchwork Tue Oct 25 09:54:29 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Neil Armstrong X-Patchwork-Id: 10696 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:6687:0:0:0:0:0 with SMTP id l7csp916455wru; Tue, 25 Oct 2022 03:12:28 -0700 (PDT) X-Google-Smtp-Source: AMsMyM5agGA435PcVLhIFPyoGiN1FwP8/obeq3ppnzOifh4MYUmXQ8+/TtErKhd9j41aR4USL5G1 X-Received: by 2002:a17:907:74e:b0:74f:83d4:cf58 with SMTP id xc14-20020a170907074e00b0074f83d4cf58mr32429044ejb.178.1666692737234; Tue, 25 Oct 2022 03:12:17 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1666692737; cv=none; d=google.com; s=arc-20160816; b=xZiG265ZM52ZTpkbcHwLkRBETIP3L8DSEwy+RCmaDJyyhQ9+JsL7+SHnSsRkSewtiM De91liQ0z+O6hv2BR7F0eqBjMMko/5nwwr4EkFWZVCExSDtiNxTyGd0FuidSJWFXqvjY haATEPSsBMbKgU6374ixKluoCz+c1oogB+wp6T4Dk47aIu0Jzr7RGtDWc/V2fMJZwD24 +3lNPieychwXR+lXbuGHqJjR0MhedOkEqye8eQdemktD8ZJ5yLrRMOW4DclhnT2J9iDU vThEqeeCg5IIKd9Rf/+/wwy0x74r/S442E6RHNa3tYVQun9IwpMxxmGmHD4vwNR5veBN /hBg== 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=5Fe2kZ1GOC4RiCKtckIokXCknoVb38npm9cAAuR5C5A=; b=cF2sYR98hGkMDydLq5QT4JviWclZtgErf9lFR67nHS04MMvpQq0rPZI0sYin9M/Y4v Ldg2GnSot50agCbkefPNv/jTeitebnvUp98OGURFMo1IJR1f4ruAtkAYhA34fJBaEHn+ LWHv3RelMyWxEd4GiKeVZYDHkZUzqYjCZYQBdBzqbItzMwRZNa6W3iidTwcQZ5P/jjMv ZBlAZuG2+x2L/xYdHLldxzMbR9ivzOLvV4tnLoSlFCW88+7CP0CseVs6/bGSPJEJXYFl dxs0f0I9dAkctKpGFgZqq87M66bO3hDD6THU72gVtkoXdMv5/YNks/jJrwN8VoxbQ8H+ bfkg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=IxUNwaY3; 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 qa14-20020a170907868e00b007781bc042a2si2482239ejc.646.2022.10.25.03.11.51; Tue, 25 Oct 2022 03:12:17 -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=IxUNwaY3; 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 S231790AbiJYKCE (ORCPT + 99 others); Tue, 25 Oct 2022 06:02:04 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49606 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231951AbiJYKBJ (ORCPT ); Tue, 25 Oct 2022 06:01:09 -0400 Received: from mail-wm1-x331.google.com (mail-wm1-x331.google.com [IPv6:2a00:1450:4864:20::331]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 56BFDAD996 for ; Tue, 25 Oct 2022 02:54:34 -0700 (PDT) Received: by mail-wm1-x331.google.com with SMTP id jb18so4518459wmb.4 for ; Tue, 25 Oct 2022 02:54:34 -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=5Fe2kZ1GOC4RiCKtckIokXCknoVb38npm9cAAuR5C5A=; b=IxUNwaY3v4m9SoQVwB6LN/6F+sgBLnEMl0dkolNGUME9nZZb00snxD4FjlFxE7fVk5 O506VbGM4HJ6q3ucQI3++CZoGw6QAxx9qjOGvFJX12BM7ItvlmmxDkrKs1V8oCVFjI3N 7sRQIH77ZTON+QpNsGTOhA4XhlkpvUo6TgKfotSPeEtxVvpWyvuy7yWLMHVfnd5nSHZX RFoprWKgC2Xr3UGGzjx/9A496/PnTpdYgoSn7l3tMNyOuoxoGLaEvMqQhpfROzlThQ1v 6JEtP5/GHEzNduLSG1FwMvcGSVs/XbsTXcZoyfzdjhJc0PYHW3S3+8DTmonFUf/rgRUA BdRg== 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=5Fe2kZ1GOC4RiCKtckIokXCknoVb38npm9cAAuR5C5A=; b=mO2ON+vmmqs/AmxsF7d+tV2PrlY4uwR9Q+lRb5HwqzpMu90k1Q5uUtcH1tvpktELEq Mkaf8yWmw8BXvSxky+LbRfrgz9bahq6Q2VKE3AR18icw7xoWZNkLubgt1JfUE1p4wxvd nUoOk8Es3ACCu0oc3Sw2GgsxMZWG8G8ZYArRQgcAMAerNdfo5m0eux7EYZnDAnwxn3fs qzwpMuA8BEbBkYi0DL9RgVLgOqjcL7FXMf41kUl+TPyJN5TkV5LPTnVDQ/gO+8uRZVXp +To/oqJOHR4VLIrOeIZ7nYbLYbwgO3Tx2N/gzgTLCcjNjBtNtnPIgpHqCv4tLYgvsJNh 3+DA== X-Gm-Message-State: ACrzQf1gLFtwaLMZppok70RHPFJfjQSLMr/JTDxDUDNUXTGmoQGmC2ss pPe/DtnW+VBd+6e8G71E1xSAsPGDE6bg2Ab1 X-Received: by 2002:a05:600c:3d92:b0:3cf:3921:d8ad with SMTP id bi18-20020a05600c3d9200b003cf3921d8admr4831493wmb.15.1666691673049; Tue, 25 Oct 2022 02:54:33 -0700 (PDT) Received: from arrakeen.starnux.net ([2a01:e0a:982:cbb0:52eb:f6ff:feb3:451a]) by smtp.gmail.com with ESMTPSA id 130-20020a1c0288000000b003cf37c5ddc0sm2195204wmc.22.2022.10.25.02.54.32 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 25 Oct 2022 02:54:32 -0700 (PDT) From: Neil Armstrong Date: Tue, 25 Oct 2022 11:54:29 +0200 Subject: [PATCH] mfd: rk808: permit having multiple PMIC instances MIME-Version: 1.0 Message-Id: <20221025-rk808-multi-v1-0-c07b7cf3fd67@linaro.org> To: Neil Armstrong , linux-kernel@vger.kernel.org, Lee Jones 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,URIBL_BLOCKED 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?1747654003472320704?= This set each cells id to -1 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 --- 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..b9cfd249912d 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 = -1, }, + { .name = "rk808-regulator", .id = -1, }, + { .name = "rk805-pinctrl", .id = -1, }, { .name = "rk808-rtc", .num_resources = ARRAY_SIZE(rtc_resources), .resources = &rtc_resources[0], + .id = -1, }, { .name = "rk805-pwrkey", .num_resources = ARRAY_SIZE(rk805_key_resources), .resources = &rk805_key_resources[0], + .id = -1, }, }; static const struct mfd_cell rk808s[] = { - { .name = "rk808-clkout", }, - { .name = "rk808-regulator", }, + { .name = "rk808-clkout", .id = -1, }, + { .name = "rk808-regulator", .id = -1, }, { .name = "rk808-rtc", .num_resources = ARRAY_SIZE(rtc_resources), .resources = rtc_resources, + .id = -1, }, }; static const struct mfd_cell rk817s[] = { - { .name = "rk808-clkout",}, - { .name = "rk808-regulator",}, + { .name = "rk808-clkout", .id = -1, }, + { .name = "rk808-regulator", .id = -1, }, { .name = "rk805-pwrkey", .num_resources = ARRAY_SIZE(rk817_pwrkey_resources), .resources = &rk817_pwrkey_resources[0], + .id = -1, }, { .name = "rk808-rtc", .num_resources = ARRAY_SIZE(rk817_rtc_resources), .resources = &rk817_rtc_resources[0], + .id = -1, }, - { .name = "rk817-codec",}, + { .name = "rk817-codec", .id = -1, }, { .name = "rk817-charger", .num_resources = ARRAY_SIZE(rk817_charger_resources), .resources = &rk817_charger_resources[0], + .id = -1, }, }; static const struct mfd_cell rk818s[] = { - { .name = "rk808-clkout", }, - { .name = "rk808-regulator", }, + { .name = "rk808-regulator", .id = -1, }, { .name = "rk808-rtc", .num_resources = ARRAY_SIZE(rtc_resources), .resources = rtc_resources, + .id = -1, }, };