Received: by 2002:a25:31c3:0:0:0:0:0 with SMTP id x186csp2386333ybx; Sat, 2 Nov 2019 18:40:51 -0700 (PDT) X-Google-Smtp-Source: APXvYqycbDaz6q4wvBmkl6juPmTdqGv/SiKhKuZls2K44msmbUlBru9iv9tFKAepSMDXqlQcp3fS X-Received: by 2002:a17:906:e82:: with SMTP id p2mr17044099ejf.237.1572745251110; Sat, 02 Nov 2019 18:40:51 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1572745251; cv=none; d=google.com; s=arc-20160816; b=rMK1D+ya4Ie+xFogbp7L6hU9EOM6TnUbTG67z1bYjLnCL0iESRKVMevu5OPIW0ILl1 n84eaOS47i2g+44/3DcpsIMDncKSvm9sj/ZvBdxAOpLsBFm6y3SvMEkc0XOmf55QZG2h Ap07OeSg+XN32n3HZFEPQEIIR64ZsuNfseswLqShb7+JTEnKpK1SbOI80rkcv3uG48e2 amc+OnDBGtjo8cx9Vb6tZBnWzk+w07oUDstSikxkN1GmU68bdPXXsD/1hDAP7bGogHhl YdrkdXpdD/7uQzoDdMGwuc+ZbY8bLCpV78J5A6tmRGBfUuryOsu6erJ4okjkkBxx2pO/ wNtg== 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 c8si3921637ede.323.2019.11.02.18.40.28; Sat, 02 Nov 2019 18:40:51 -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 S1727481AbfKCBg4 (ORCPT + 99 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=20F=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=20F=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 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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(-) 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) -- 2.16.4