From patchwork Thu Sep 17 09:53:44 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Magnus Damm X-Patchwork-Id: 7205481 Return-Path: X-Original-To: patchwork-linux-sh@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork2.web.kernel.org (Postfix) with ESMTP id D7382BEEC1 for ; Thu, 17 Sep 2015 10:05:44 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id F0AFD2081C for ; Thu, 17 Sep 2015 10:05:43 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 08B70207F5 for ; Thu, 17 Sep 2015 10:05:43 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752812AbbIQJxr (ORCPT ); Thu, 17 Sep 2015 05:53:47 -0400 Received: from mail-pa0-f52.google.com ([209.85.220.52]:33502 "EHLO mail-pa0-f52.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751948AbbIQJxp (ORCPT ); Thu, 17 Sep 2015 05:53:45 -0400 Received: by pacex6 with SMTP id ex6so16414858pac.0; Thu, 17 Sep 2015 02:53:45 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:date:message-id:in-reply-to:references:subject; bh=n1Jzfc7Z/pLNi7gDVWW4GPnBaPXGCoGq9FCf2eutMPQ=; b=vVm8Mi9Tatu8gT+3UtA2FIGlH6Lboq5DTgnlS6hE0qP/9BUDVHDZQE9lg1xvlritHj LRVwDIMpCro5o1K5H3lDGVoxZ52JUreyD3iYT3VhHQ3wG62T6oRAzqUQ4wKjHp4kC/yK CeVntU9c+7qJsP6VgqeFrYSQ3l5I7ZGfTaZ+r7+xq0SfCRavs6rHL2qzlAiigeJVOsyc uT4FuUNpLqIHeE332N81hxcodwXX86l6gSjBxBspI4f4Zh40fPDYrlg6g27rllO6JdOW 3vOljqbLjBt0Cd/PiEnrfABNngHfMIfGuoMCpVn1wdEzYEeAZ02b0THxKxT16UAeZO51 Mpyw== X-Received: by 10.68.163.5 with SMTP id ye5mr69812484pbb.120.1442483625301; Thu, 17 Sep 2015 02:53:45 -0700 (PDT) Received: from [127.0.0.1] (s214090.ppp.asahi-net.or.jp. [220.157.214.90]) by smtp.gmail.com with ESMTPSA id kv10sm2673853pbc.2.2015.09.17.02.53.42 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 17 Sep 2015 02:53:44 -0700 (PDT) From: Magnus Damm To: linux-kernel@vger.kernel.org Cc: devicetree@vger.kernel.org, laurent.pinchart+renesas@ideasonboard.com, geert+renesas@glider.be, linux-sh@vger.kernel.org, daniel.lezcano@linaro.org, horms+renesas@verge.net.au, Magnus Damm , tglx@linutronix.de Date: Thu, 17 Sep 2015 18:53:44 +0900 Message-Id: <20150917095344.5369.2009.sendpatchset@little-apple> In-Reply-To: <20150917095325.5369.73893.sendpatchset@little-apple> References: <20150917095325.5369.73893.sendpatchset@little-apple> Subject: [PATCH v2 02/11] clocksource: sh_cmt: Use 0x3f mask for SH_CMT_48BIT case Sender: linux-sh-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-sh@vger.kernel.org X-Spam-Status: No, score=-6.8 required=5.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_HI, T_DKIM_INVALID, T_RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP From: Magnus Damm Always use 0x3f as channel mask for the SH_CMT_48BIT type of devices. Once this patch is applied the "renesas,channels-mask" property will be ignored by the driver for older devices matching SH_CMT_48BIT. In the future when all CMT types store channel mask in the driver then we will be able to deprecate and remove "renesas,channels-mask" from DTS. Signed-off-by: Magnus Damm Acked-by: Geert Uytterhoeven Tested-by: Geert Uytterhoeven Acked-by: Laurent Pinchart --- Changes since V1: - Fixed compile error - thanks Geert! - Added Acked-by and Tested-by from Geert - Added Acked-by from Laurent drivers/clocksource/sh_cmt.c | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) -- To unsubscribe from this list: send the line "unsubscribe linux-sh" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html --- 0001/drivers/clocksource/sh_cmt.c +++ work/drivers/clocksource/sh_cmt.c 2015-09-17 17:25:15.820513000 +0900 @@ -74,6 +74,8 @@ enum sh_cmt_model { struct sh_cmt_info { enum sh_cmt_model model; + unsigned long channels_mask; + unsigned long width; /* 16 or 32 bit version of hardware block */ unsigned long overflow_bit; unsigned long clear_bits; @@ -212,6 +214,7 @@ static const struct sh_cmt_info sh_cmt_i }, [SH_CMT_48BIT] = { .model = SH_CMT_48BIT, + .channels_mask = 0x3f, .width = 32, .overflow_bit = SH_CMT32_CMCSR_CMF, .clear_bits = ~(SH_CMT32_CMCSR_CMF | SH_CMT32_CMCSR_OVF), @@ -972,9 +975,14 @@ static int sh_cmt_setup(struct sh_cmt_de id = of_match_node(sh_cmt_of_table, pdev->dev.of_node); cmt->info = id->data; - ret = sh_cmt_parse_dt(cmt); - if (ret < 0) - return ret; + /* prefer in-driver channel configuration over DT */ + if (cmt->info->channels_mask) { + cmt->hw_channels = cmt->info->channels_mask; + } else { + ret = sh_cmt_parse_dt(cmt); + if (ret < 0) + return ret; + } } else if (pdev->dev.platform_data) { struct sh_timer_config *cfg = pdev->dev.platform_data; const struct platform_device_id *id = pdev->id_entry;