From patchwork Sun Nov 3 01:36:40 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Andreas_F=C3=A4rber?= X-Patchwork-Id: 178364 Delivered-To: patch@linaro.org Received: by 2002:a92:409a:0:0:0:0:0 with SMTP id d26csp2570003ill; Sat, 2 Nov 2019 18:37:02 -0700 (PDT) X-Google-Smtp-Source: APXvYqxUJJdo+Nz8jrU52BgpRb3iwn7IczQ3AGp2kj/UeW87mMZNyujGxGuYQPSGfLY1ZaLstpH2 X-Received: by 2002:a17:906:5911:: with SMTP id h17mr17622929ejq.194.1572745021960; Sat, 02 Nov 2019 18:37:01 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1572745021; cv=none; d=google.com; s=arc-20160816; b=iFjQWbYpGciZvyIIIyPNkFh7GyLdbL4j3ZLFrykan+8CrQgrCKtPB0atNPUAGv/RUH o5GuJ14d/6ArjjPzd0Sq4shrEJCLhnZSzzJDJb2bnYw8VRyfqzNIm/TiZ4zhV72n4FeO reSbkvx7RUWLGFAA5lhy9v6CLwnQ0w8HYzU9AUo3eiHqGclCMy09XWA6M44BTtILEqGx R5tHsZD48ZGzuhGlEN7L+XPtEA1WScHtX+dtfCvVuAeyY2fVhjf/pQAJzVfzOCuUMYXA Bei6HNzuxGb1f1QfcL4J20NaJtLnmCynzkRBU4IshHah7e9bQbvlTroDpsuqlPljwzz+ UpYA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from; bh=D/OMlUN3Zp7DKugQUr5dcg3+TzXNjIP8g7bq8TZhGJA=; b=0VIhsxmYSeIhsjQdnJ6wUlniPhdXgLHEMWWbM/c/FWORF5/bc2bVIVVrhKy/99+98c S65SDURT+8PLfmB9wGr9VYfG3WbsmmfKl6OoQ49vn9So2Z1NrKpcYS1WaCOnuvNJ0+94 IMLef6BtNLj8c/fYJfBU+osDEs8jyv869gCQwXV7ljE01rR98de/UpSCWpZI/H/Xlt+4 Q5vmpUpJ3j0Dzs+czFZAk38nIXAHLU6xTlxBJv8n9InOxHzBAwYw4C62Huviu6uf3pGc q2om0r5gzHmIw4Pevp5d5eX9zGMIBSQjFMhU7e4hJ5wMCkl39w6LqVVY7lAgkgRw7LV+ hwGQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id r20si3906087edm.17.2019.11.02.18.37.01; Sat, 02 Nov 2019 18:37:01 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727492AbfKCBg4 (ORCPT + 26 others); Sat, 2 Nov 2019 21:36:56 -0400 Received: from mx2.suse.de ([195.135.220.15]:59462 "EHLO mx1.suse.de" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1727431AbfKCBg4 (ORCPT ); Sat, 2 Nov 2019 21:36:56 -0400 X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay2.suse.de (unknown [195.135.220.254]) by mx1.suse.de (Postfix) with ESMTP id 20627AFD4; Sun, 3 Nov 2019 01:36:55 +0000 (UTC) From: =?utf-8?q?Andreas_F=C3=A4rber?= To: linux-realtek-soc@lists.infradead.org Cc: linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, =?utf-8?q?Andreas_F=C3=A4rber?= Subject: [RFC 06/11] soc: realtek: chip: Detect RTD1296 Date: Sun, 3 Nov 2019 02:36:40 +0100 Message-Id: <20191103013645.9856-7-afaerber@suse.de> X-Mailer: git-send-email 2.16.4 In-Reply-To: <20191103013645.9856-1-afaerber@suse.de> References: <20191103013645.9856-1-afaerber@suse.de> MIME-Version: 1.0 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Detection logic from downstream drivers/soc/realtek/rtd129x/rtk_chip.c. Signed-off-by: Andreas Färber --- drivers/soc/realtek/chip.c | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) -- 2.16.4 diff --git a/drivers/soc/realtek/chip.c b/drivers/soc/realtek/chip.c index 9d13422e9936..ba653c097644 100644 --- a/drivers/soc/realtek/chip.c +++ b/drivers/soc/realtek/chip.c @@ -50,9 +50,25 @@ static const char *default_name(struct device *dev, const struct rtd_soc *s) return s->family; } +static const char *rtd1295_name(struct device *dev, const struct rtd_soc *s) +{ + void __iomem *base; + + base = of_iomap(dev->of_node, 1); + if (base) { + u32 chipinfo1 = readl_relaxed(base); + iounmap(base); + if (chipinfo1 & BIT(11)) { + return "RTD1296"; + } + } + + return "RTD1295"; +} + static const struct rtd_soc rtd_soc_families[] = { { 0x00006329, "RTD1195", default_name, rtd1195_revisions, "Phoenix" }, - { 0x00006421, "RTD1295", default_name, rtd1295_revisions, "Kylin" }, + { 0x00006421, "RTD1295", rtd1295_name, rtd1295_revisions, "Kylin" }, }; static const struct rtd_soc *rtd_soc_by_chip_id(u32 chip_id)