Received: by 2002:ad5:4acb:0:0:0:0:0 with SMTP id n11csp3292716imw; Mon, 11 Jul 2022 06:02:11 -0700 (PDT) X-Google-Smtp-Source: AGRyM1vbUdAq4hvlv8JBaClAxmPIxr2sv78+fkVUOg43KB81/v3RIBR6es6oWBQXpbghPJMs5bna X-Received: by 2002:a17:902:e0d3:b0:16b:e8da:4090 with SMTP id e19-20020a170902e0d300b0016be8da4090mr19363465pla.53.1657544531534; Mon, 11 Jul 2022 06:02:11 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1657544531; cv=none; d=google.com; s=arc-20160816; b=xbyie4FmURP+JSAdL3tqnIAIMA+cEsq2/aF+NGn4TszfwIeQM8VxL8x8uHq0Rt6omH MTRTrJeGjxxSvi2edtnRbBjpXAo7tuMq+sQlNXy1gBFUGvZbjPvDVBIZ9jAMgiE6QvBx P4fnZLoNJkFxylVcZYePYodh+Vk9Q1VIzyAv/okIZCIkiTwrfzfZVGGYzw7ple/nuS6F TafoawcZTZlZ2EzDhBuDAnel60I7pUy8+tRlInbpEaoNUcv7xXPt8Ln/JUXnm/u7z6uy DYzpSAcP4oIZehXFm9R/Bxdb3QVLhOhLln4oNWwGW3Mn9YW2HPc0AaOwyOvfq0o4oi7c m/5g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from; bh=CNVzeO7yENbn6vnt4eIzaH9oqra4HNHcSW+xYICoQQ8=; b=HnSU6BosBK+3DAMNXFKcKvxthAsW6+47L79nD2H6WLmWo9KFnPH+QFX+Up9ZB1uw/s d/91BsUJuhQJ0aNDIjFut/n/N096Ia8WGSTgAzh9hudG/j/Ee5/n3VH+PxiyPm7hZfUP 4fEkzopq5GKwvmfJHedk5YDOIof64k9q3TxvxJJbX0MbUoy7sPgXElLf28UefJot7wnt 9l7b04793hIJhq1kApkBLj8ouQ8zvc2JdqYuYL6buG/PqcTe6gHG+kMgwyWGOkUirhQb 2G3TxZYCD/VET4Du26tCni1f8Ghy7IlYlpB6rXkLy61+IEuc+rFmFbaezSddPFf2pjpf 3acw== ARC-Authentication-Results: i=1; mx.google.com; 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=fail (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id k189-20020a6384c6000000b00415ed04e300si6672050pgd.267.2022.07.11.06.01.58; Mon, 11 Jul 2022 06:02:11 -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; 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=fail (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231770AbiGKMfz (ORCPT + 99 others); Mon, 11 Jul 2022 08:35:55 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:59778 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231368AbiGKMfc (ORCPT ); Mon, 11 Jul 2022 08:35:32 -0400 Received: from maillog.nuvoton.com (maillog.nuvoton.com [202.39.227.15]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 105E8545DB; Mon, 11 Jul 2022 05:35:29 -0700 (PDT) Received: from NTHCCAS01.nuvoton.com (NTHCCAS01.nuvoton.com [10.1.8.28]) by maillog.nuvoton.com (Postfix) with ESMTP id 2F90C1C811A9; Mon, 11 Jul 2022 20:35:26 +0800 (CST) Received: from NTHCCAS02.nuvoton.com (10.1.9.121) by NTHCCAS01.nuvoton.com (10.1.8.28) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.7; Mon, 11 Jul 2022 20:35:25 +0800 Received: from NTHCCAS01.nuvoton.com (10.1.8.28) by NTHCCAS02.nuvoton.com (10.1.9.121) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2176.2; Mon, 11 Jul 2022 20:35:25 +0800 Received: from taln60.nuvoton.co.il (10.191.1.180) by NTHCCAS01.nuvoton.com (10.1.12.25) with Microsoft SMTP Server id 15.1.2375.7 via Frontend Transport; Mon, 11 Jul 2022 20:35:25 +0800 Received: by taln60.nuvoton.co.il (Postfix, from userid 10070) id D659A63A52; Mon, 11 Jul 2022 15:35:23 +0300 (IDT) From: Tomer Maimon To: , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , CC: , , , , , , Tomer Maimon Subject: [PATCH v8 07/16] reset: npcm: using syscon instead of device data Date: Mon, 11 Jul 2022 15:35:10 +0300 Message-ID: <20220711123519.217219-8-tmaimon77@gmail.com> X-Mailer: git-send-email 2.33.0 In-Reply-To: <20220711123519.217219-1-tmaimon77@gmail.com> References: <20220711123519.217219-1-tmaimon77@gmail.com> MIME-Version: 1.0 Content-Transfer-Encoding: 7BIT Content-Type: text/plain; charset=US-ASCII X-Spam-Status: No, score=0.5 required=5.0 tests=BAYES_00,DKIM_ADSP_CUSTOM_MED, FORGED_GMAIL_RCVD,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,NML_ADSP_CUSTOM_MED,SPF_HELO_NONE, SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=no 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 Using syscon device tree property instead of device data to handle the NPCM general control registers. In case the syscon not found the code still search for nuvoton,npcm750-gcr to support DTS backward compatibility. Signed-off-by: Tomer Maimon --- drivers/reset/reset-npcm.c | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/drivers/reset/reset-npcm.c b/drivers/reset/reset-npcm.c index 2ea4d3136e15..b08f8d8a1d63 100644 --- a/drivers/reset/reset-npcm.c +++ b/drivers/reset/reset-npcm.c @@ -138,8 +138,7 @@ static int npcm_reset_xlate(struct reset_controller_dev *rcdev, } static const struct of_device_id npcm_rc_match[] = { - { .compatible = "nuvoton,npcm750-reset", - .data = (void *)"nuvoton,npcm750-gcr" }, + { .compatible = "nuvoton,npcm750-reset" }, { } }; @@ -160,10 +159,15 @@ static int npcm_usb_reset(struct platform_device *pdev, struct npcm_rc_data *rc) gcr_dt = (const char *) of_match_device(dev->driver->of_match_table, dev)->data; - gcr_regmap = syscon_regmap_lookup_by_compatible(gcr_dt); + gcr_regmap = syscon_regmap_lookup_by_phandle(dev->of_node, "nuvoton,sysgcr"); if (IS_ERR(gcr_regmap)) { - dev_err(&pdev->dev, "Failed to find %s\n", gcr_dt); - return PTR_ERR(gcr_regmap); + dev_warn(&pdev->dev, "Failed to find nuvoton,sysgcr property, please update the device tree\n"); + dev_info(&pdev->dev, "Using nuvoton,npcm750-gcr for Poleg backward compatibility\n"); + gcr_regmap = syscon_regmap_lookup_by_compatible("nuvoton,npcm750-gcr"); + if (IS_ERR(gcr_regmap)) { + dev_err(&pdev->dev, "Failed to find nuvoton,npcm750-gcr"); + return PTR_ERR(gcr_regmap); + } } /* checking which USB device is enabled */ -- 2.33.0