Received: by 2002:ac0:a5b6:0:0:0:0:0 with SMTP id m51-v6csp1589697imm; Thu, 14 Jun 2018 00:06:11 -0700 (PDT) X-Google-Smtp-Source: ADUXVKJ1bCzBV67/zNgbkYbs1nvWeSFz+KY47PZWlYF4JVT4DjBt9NboKIT1F1NSrtbJaXdTZTj+ X-Received: by 2002:a62:9652:: with SMTP id c79-v6mr8293884pfe.114.1528959971251; Thu, 14 Jun 2018 00:06:11 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1528959971; cv=none; d=google.com; s=arc-20160816; b=eO95WEMQXlNWJU7XA8DZvj3UgjjrmlYpr7k3o1vQK3r8hpXtOFARsgq7NC50XvIfrp WgPryyeqvtOpUzFj1YzMjGmHTU1lOTcGU+nR/hYPB9hHReDmVHZ3XxrdDns0ju5cVdrv vxZFe4X083JwG0mwuiT200HL0rLb1LpKubOJ9/XZ2o3eABEVthNG+/9w9zqMDFaAKkNz cw3cik5WapUPlZ7cKg6H0Z97/XQybne4THbqmSnneiGJCveMf9dstLtHUvtc7Kc11KfS eGoPR9hNDqoQz1zBDuV5nXnp7qISHmrUM7AQtFEy1UJof7pymsnJKb/JuFvbjiriIyLM dDjw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-language :content-transfer-encoding:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject:arc-authentication-results; bh=nbAcgZ2xVUfhu1NXAUDBt3DJBxnai3VmrfihsEi6jHw=; b=0eE06pL4fE69/ZaQoYyT/40gB7DeD9J1kTNZI+M7h4d4wKw43B0sy2HTSz7lbGut8S RtgwQYmtbOHx6ULY3AnzcxSMfF22TDhQpdUpqfRwD6bXmyY42iuc69MZ9w907mRdvSF5 S2R8hHcKqFASWuAxUSbwTdzQcLHOC5s79d+qCckQGMoDUm0mPN3l0f3ZUMnDV4+OhdBN fqpjiAR2UbyesUBYywrpOm+GJHDThofmHXf6NOYCzUpuFZ5YiXQ8kckG8drlaiW7lKYE pa80SK+6s8OSeFiZFEbxPoDueAzj3fixV8yLAyQbX0rqHNBnXE82IgSltzhDvLB5S/4T hUiQ== 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id o184-v6si3922030pga.92.2018.06.14.00.05.56; Thu, 14 Jun 2018 00:06:11 -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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754640AbeFNHFb (ORCPT + 99 others); Thu, 14 Jun 2018 03:05:31 -0400 Received: from mga14.intel.com ([192.55.52.115]:55248 "EHLO mga14.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752833AbeFNHF3 (ORCPT ); Thu, 14 Jun 2018 03:05:29 -0400 X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga006.fm.intel.com ([10.253.24.20]) by fmsmga103.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 14 Jun 2018 00:05:29 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.51,222,1526367600"; d="scan'208";a="237343347" Received: from songjunw-mobl1.ger.corp.intel.com (HELO [10.226.39.15]) ([10.226.39.15]) by fmsmga006.fm.intel.com with ESMTP; 14 Jun 2018 00:05:26 -0700 Subject: Re: [PATCH 4/7] tty: serial: lantiq: Always use readl()/writel() To: Andy Shevchenko Cc: hua.ma@linux.intel.com, yixin.zhu@linux.intel.com, chuanhua.lei@intel.com, Linux MIPS Mailing List , qi-ming.wu@intel.com, linux-clk@vger.kernel.org, "open list:SERIAL DRIVERS" , devicetree , James Hogan , Jiri Slaby , Linux Kernel Mailing List , Greg Kroah-Hartman , Ralf Baechle References: <20180612054034.4969-1-songjun.wu@linux.intel.com> <20180612054034.4969-5-songjun.wu@linux.intel.com> From: "Wu, Songjun" Message-ID: <4d2482dc-a77c-6a1f-5e71-f7f14d66bf80@linux.intel.com> Date: Thu, 14 Jun 2018 15:05:25 +0800 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:52.0) Gecko/20100101 Thunderbird/52.3.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit Content-Language: en-US Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 6/12/2018 4:13 PM, Andy Shevchenko wrote: > On Tue, Jun 12, 2018 at 8:40 AM, Songjun Wu wrote: >> Previous implementation uses platform-dependent functions >> ltq_w32()/ltq_r32() to access registers. Those functions are not >> available for other SoC which uses the same IP. >> Change to OS provided readl()/writel() and readb()/writeb(), so >> that different SoCs can use the same driver. > This patch consists 2 or even 3 ones: > - whitespace shuffling (indentation fixes, blank lines), I dunno if > it's needed at all > - some new registers / bits > - actual switch to readl() / writel() > > Please, split. It will be split to four patches, coding style, new registers, readl()/writel() and asc_update_bits. >> +#define asc_w32_mask(clear, set, reg) \ >> + ({ typeof(reg) reg_ = (reg); \ >> + writel((readl(reg_) & ~(clear)) | (set), reg_); }) > This would be better as a static inline helper, and name is completely > misleading, it doesn't mask the register bits, it _updates_ them. It will be changed to asc_update_bits.