Received: by 2002:a25:1506:0:0:0:0:0 with SMTP id 6csp2256375ybv; Fri, 21 Feb 2020 11:54:22 -0800 (PST) X-Google-Smtp-Source: APXvYqzZXXRQLlmVnd4F54peBknSTpgWWTIGeYcGhReDto9epgEJIO2BZdz4TKOiQibItKAr/qCO X-Received: by 2002:a05:6808:98e:: with SMTP id a14mr3270611oic.8.1582314862773; Fri, 21 Feb 2020 11:54:22 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1582314862; cv=none; d=google.com; s=arc-20160816; b=opCc/pwouAvlOMtgfrPyuzAQnLvAVahwnsIWr5qrf7jGW+ZhOv22p2/uf9eAr5qd/9 AFlqjQqyF7ef3ZyvidCuca92NbYYEssXMWcluv6uK8UxyrnQtz+JjhGDIuHDmA/n7bUm Wk9hXF/S2W2rXVFdE6FUy9AsbAvgobXcPZHgWbfX/Dzg07pr09sgQRGG3mLA7Wbf+kjL DYXN7BEZ4svYc7G+VvKEOoqQjrNV5VgMF8u84pRMPS92eRy7IADV6A5vo1FLjtiRN3Lj KzaHBSpheeR0fAOJ4zjahK+qTkMGd1qK3xEpMZzzOQlgD6tKsKl+JSSB9UlY/VhE8iAQ DZ2A== 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=5fhzMUsBoSkm7T+dkEgutbnbI9u33ITXrVBUd9byrPk=; b=WjVDi6ia8PQp80400f8StVmDU6/EVhqWkKh8Z0KxDU+S7X1/sOxhqlxUscu8bQLORK JLz5Tq5GYbfJJB+YGJfiT2W84beycj46krDcZQ95h9OJ8v7rT1it4nDJOCiv/RQDKf6Z m2IMg/+2ljmwdwkr6GHwpzOnpRhNJc6lV7CEFtJRBGksuWQ7SJxLgBW5GNE1c4/5mvr7 e+wkMCPvxTmLOuY/QW55L6AmiCacwyoNIUsQz7vUKAosWe3vx5ExTvVOhaOAqv4p0K8F PEd6K3NwQq1Uob1Iu7DAjF+tab3uP6mPklyYbefRvx9/YnyCaWJJUmyl38AJxs/VSl5y Ol1Q== 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 s8si857896oij.275.2020.02.21.11.54.11; Fri, 21 Feb 2020 11:54:22 -0800 (PST) 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 S1728177AbgBUTxS (ORCPT + 99 others); Fri, 21 Feb 2020 14:53:18 -0500 Received: from muru.com ([72.249.23.125]:56882 "EHLO muru.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728028AbgBUTxN (ORCPT ); Fri, 21 Feb 2020 14:53:13 -0500 Received: from hillo.muru.com (localhost [127.0.0.1]) by muru.com (Postfix) with ESMTP id 42F958192; Fri, 21 Feb 2020 19:53:57 +0000 (UTC) From: Tony Lindgren To: linux-omap@vger.kernel.org Cc: "Andrew F . Davis" , Dave Gerlach , Faiz Abbas , Greg Kroah-Hartman , Keerthy , Nishanth Menon , Peter Ujfalusi , Roger Quadros , Suman Anna , Tero Kristo , linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, Adam Ford , =?UTF-8?q?Andr=C3=A9=20Hentschel?= , "H. Nikolaus Schaller" Subject: [PATCH 3/7] ti-sysc: Improve reset to work with modules with no sysconfig Date: Fri, 21 Feb 2020 11:52:52 -0800 Message-Id: <20200221195256.54016-4-tony@atomide.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20200221195256.54016-1-tony@atomide.com> References: <20200221195256.54016-1-tony@atomide.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org At least display susbsystem (DSS) has modules with no sysconfig registers and rely on custom function for module reset handling. Let's make reset work with that too. Signed-off-by: Tony Lindgren --- drivers/bus/ti-sysc.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/drivers/bus/ti-sysc.c b/drivers/bus/ti-sysc.c --- a/drivers/bus/ti-sysc.c +++ b/drivers/bus/ti-sysc.c @@ -1571,7 +1571,7 @@ static int sysc_reset(struct sysc *ddata) sysc_offset = ddata->offsets[SYSC_SYSCONFIG]; syss_offset = ddata->offsets[SYSC_SYSSTATUS]; - if (ddata->legacy_mode || sysc_offset < 0 || + if (ddata->legacy_mode || ddata->cap->regbits->srst_shift < 0 || ddata->cfg.quirks & SYSC_QUIRK_NO_RESET_ON_INIT) return 0; @@ -1586,9 +1586,11 @@ static int sysc_reset(struct sysc *ddata) if (ddata->pre_reset_quirk) ddata->pre_reset_quirk(ddata); - sysc_val = sysc_read_sysconfig(ddata); - sysc_val |= sysc_mask; - sysc_write(ddata, sysc_offset, sysc_val); + if (sysc_offset >= 0) { + sysc_val = sysc_read_sysconfig(ddata); + sysc_val |= sysc_mask; + sysc_write(ddata, sysc_offset, sysc_val); + } if (ddata->cfg.srst_udelay) usleep_range(ddata->cfg.srst_udelay, -- 2.25.1