From patchwork Wed Feb 10 02:45:00 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kuninori Morimoto X-Patchwork-Id: 8268091 Return-Path: X-Original-To: patchwork-alsa-devel@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 1B2829F1C1 for ; Wed, 10 Feb 2016 02:46:44 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 2129320270 for ; Wed, 10 Feb 2016 02:46:43 +0000 (UTC) Received: from alsa0.perex.cz (alsa0.perex.cz [77.48.224.243]) by mail.kernel.org (Postfix) with ESMTP id BD8A22026C for ; Wed, 10 Feb 2016 02:46:41 +0000 (UTC) Received: by alsa0.perex.cz (Postfix, from userid 1000) id D1FC82651C9; Wed, 10 Feb 2016 03:46:40 +0100 (CET) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Spam-Status: No, score=-1.8 required=5.0 tests=BAD_ENC_HEADER,BAYES_00, DKIM_SIGNED, RCVD_IN_DNSWL_NONE, T_DKIM_INVALID, UNPARSEABLE_RELAY autolearn=no version=3.3.1 Received: from alsa0.perex.cz (localhost [127.0.0.1]) by alsa0.perex.cz (Postfix) with ESMTP id 08087265340; Wed, 10 Feb 2016 03:45:29 +0100 (CET) X-Original-To: alsa-devel@alsa-project.org Delivered-To: alsa-devel@alsa-project.org Received: by alsa0.perex.cz (Postfix, from userid 1000) id 38D00265340; Wed, 10 Feb 2016 03:45:27 +0100 (CET) Received: from relmlie3.idc.renesas.com (relmlor4.renesas.com [210.160.252.174]) by alsa0.perex.cz (Postfix) with ESMTP id EBF852652AC for ; Wed, 10 Feb 2016 03:45:02 +0100 (CET) Received: from unknown (HELO relmlir2.idc.renesas.com) ([10.200.68.152]) by relmlie3.idc.renesas.com with ESMTP; 10 Feb 2016 11:45:01 +0900 Received: from relmlac4.idc.renesas.com (relmlac4.idc.renesas.com [10.200.69.24]) by relmlir2.idc.renesas.com (Postfix) with ESMTP id A23C63F885; Wed, 10 Feb 2016 11:45:01 +0900 (JST) Received: by relmlac4.idc.renesas.com (Postfix, from userid 0) id 8A4F6480A4; Wed, 10 Feb 2016 11:45:01 +0900 (JST) Received: from relmlac4.idc.renesas.com (localhost [127.0.0.1]) by relmlac4.idc.renesas.com (Postfix) with ESMTP id 83000480A3; Wed, 10 Feb 2016 11:45:01 +0900 (JST) Received: from relmlii1.idc.renesas.com [10.200.68.65] by relmlac4.idc.renesas.com with ESMTP id MAF32153; Wed, 10 Feb 2016 11:45:01 +0900 X-IronPort-AV: E=Sophos;i="5.22,424,1449500400"; d="scan'";a="204066459" Received: from mail-hk2apc01lp0208.outbound.protection.outlook.com (HELO APC01-HK2-obe.outbound.protection.outlook.com) ([65.55.88.208]) by relmlii1.idc.renesas.com with ESMTP/TLS/AES256-SHA; 10 Feb 2016 11:45:01 +0900 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=renesasgroup.onmicrosoft.com; s=selector1-renesas-com; h=From:To:Date:Subject:Message-ID:Content-Type:MIME-Version; bh=ICQK3GOY/0RU1RRoOCtLF2rl6kAZartzuuoJgJgGDfg=; b=U/ikUyyZtoOzkuLhf1Li06Jc6hfIhEuUCfgB7PpUf0DymCHQD4MgA7Atmbfzbv9SAo+hKgYidMJqgKJMcCkRn9FCSsfBe7Y6MwfeMBQI52xqujNysHs+OUvPIxFpsVj9ngSwKwYEN08IOT1qX/WmXmi+HWbb+dRiB5R8nMEu1vE= Authentication-Results: kernel.org; dkim=none (message not signed) header.d=none; kernel.org; dmarc=none action=none header.from=renesas.com; Received: from morimoto-PC.renesas.com (211.11.155.144) by HKXPR06MB1016.apcprd06.prod.outlook.com (10.161.181.156) with Microsoft SMTP Server (TLS) id 15.1.403.16; Wed, 10 Feb 2016 02:45:00 +0000 Message-ID: <87wpqds2x2.wl%kuninori.morimoto.gx@renesas.com> From: Kuninori Morimoto User-Agent: Wanderlust/2.15.9 Emacs/24.3 Mule/6.0 To: Mark Brown , Greg KH In-Reply-To: <871t8lthka.wl%kuninori.morimoto.gx@renesas.com> References: <871t8lthka.wl%kuninori.morimoto.gx@renesas.com> MIME-Version: 1.0 (generated by SEMI-EPG 1.14.7 - "Harue") Date: Wed, 10 Feb 2016 02:45:00 +0000 X-Originating-IP: [211.11.155.144] X-ClientProxiedBy: TY1PR01CA0004.jpnprd01.prod.outlook.com (25.161.131.142) To HKXPR06MB1016.apcprd06.prod.outlook.com (25.161.181.156) X-Microsoft-Exchange-Diagnostics: 1; HKXPR06MB1016; 2:jvgVEbS4zdjL2CylSbGErEqOi5w9U9UV4DJqA0IJFCVI0CNbHhTm0YkwI41T9j3U7OYBQwaGsywAL7FVyJNmSnHeZ9E74oQC7ctemHxaWGY/4XPL5/DhTQ+j6EBlspI9GfGDscMqV7r5bK9Rl+tSlg==; 3:URS3yUxURUcWfvUEdXNn3QwE3N+tkI7Esopj49VPjPIxpuE+h1D3hJFHPmpz9xu612pZLhgqeZbYSJJvapnTfrH4Yj2aGum/DMPSGw7ujKB6VwVvZP8nvq+02+8/s79o; 25:UBIdBI8HLjZXt1U7a6TJr8r5W9fjUHD63GRvxT0qtYZNr7eWUGYYco7HjwXq2p80+nJA32VLaV5rp11wuRiRodfcqtJAS4JsH0cgkyVmQyT8z2ZHUH03PpyVQgkHQ2pTXkL5QD3eXxUz/7LhX347Yg1NIkgxYCiKq6m1LmlClgbJbJX9+QMxTFY6HYNh+Ngj5lvD91Z2cMKB11VU+AoW1GcDmG2dOoPd7dEL+ibvPMjSyZlufuLkBdaSt9UDPU/6ATn/aHfgn0/pdQbBj4uBqqrEYMASngJDcs4F5N8GHcJ9+uLESQA/HTvBfVkj9Zqy X-Microsoft-Antispam: UriScan:;BCL:0;PCL:0;RULEID:;SRVR:HKXPR06MB1016; X-MS-Office365-Filtering-Correlation-Id: 8a097522-d8fc-48b8-14b6-08d331c42bc2 X-Microsoft-Exchange-Diagnostics: 1; HKXPR06MB1016; 20:LDbdalti5tXxENpgvPqDokV6EAkUJKo9fAzLi2XQr66owFadYc4yQRowYG0Gm4di3NKr8elQPuopo/M/m6k7bzInE76P0iEFeo9AvTDZjrNyt7wAVwXIJNccwP7wCMTvd8z454wAqvJXhYeZNs0ek1TfyT8eOWO4JORToAFIjslwHqCrVfEE1VCZesB2XwBg0mtYxH2yeEy5db+Ay/vjLQ+AcQJUqToWeqK1jCftnsFmfrkIbMbtdYCfszlPiQ/S6hpoWmnXhGF+LfKzaiFlUd042+yf4jlr40+XnQX7PZUYSWpvleZaCAduFmpcfHs51L1XY1eLhwqkmTfTW08NU1gT+bUJolAx2EUsPmQnML3WdUv/lNPZ6mEhVBVuwd5y37UuyqNA95yC+xyFIxKUtS4AKfnZs78Q255YVHVhERs2/o4ZBFtb20qS8MWJVgQ5HGQa7vp78Wvx1MAgtdwwiwP5QhQcLUYtrRkqrkeMbzI17zPGAtgYOmptcBjhutyA; 4:beL/+eSuTCgwz4jp55iSUM1oY7Q7S+WjuhEXatCdWPJDVf7CJjvWgsFP7ILozkNhOwZWzCl83KCNAP3goSUgGUMgZLU+JGilJZh2WMchkaUsgoGYYldlXhFY/jpgoKJVUM+i95XnJr6riiuP0KCsQGLb3Jhv/gNpegWXASYCfvXjqyJRVKB/yMQgR335BpKEGmL4/9Lp0T9QgexciuJRLqssnSlx13Pv0mNdLX/QOzHXOM4+nQ4cNC43Mpn4cEe3am1bzo45BzqIE1WvoDRezobjPARpsybT3SQ2oj6s9QK7/gg7y9IcmnhdwNN44GX5mXwXB7tZSQ6lcaLII2uqudMxnEdj8hh7Qbogcpsgcz/f7Dez81ChN66OeN33gW8U X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:; X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(601004)(2401047)(8121501046)(5005006)(10201501046)(3002001); SRVR:HKXPR06MB1016; BCL:0; PCL:0; RULEID:; SRVR:HKXPR06MB1016; X-Forefront-PRVS: 0848C1A6AA X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10019020)(6009001)(50986999)(586003)(54356999)(76176999)(19580395003)(19580405001)(189998001)(122386002)(33646002)(83506001)(86362001)(66066001)(42186005)(87976001)(77096005)(53416004)(5001770100001)(5008740100001)(5001960100002)(6116002)(229853001)(47776003)(40100003)(1096002)(46406003)(2950100001)(4326007)(2906002)(50466002)(92566002)(36756003)(3846002)(4001350100001)(23726003)(5004730100002); DIR:OUT; SFP:1102; SCL:1; SRVR:HKXPR06MB1016; H:morimoto-PC.renesas.com; FPR:; SPF:None; MLV:sfv; LANG:en; X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; HKXPR06MB1016; 23:uIYtrsqlDIRf0MCBimG2g80/gvXcJihSv5lIfya1A?= =?us-ascii?Q?Y2BSyPU/49ex4/xvSf+b2sbJ0m97HzSVFZXDHr/McGQC5EbkNVvBs9aI44el?= =?us-ascii?Q?u1UUxpPfHyuFsMA2jpsuLBTI1R+ebITOsFGyPAt7KkDRxNr3FOMd80vfiDro?= =?us-ascii?Q?DOO2+it/rWvDsX5iIxeU0wF//cvAAgMsE4EirwLygeHT5N1wdOoD1dUrtcZk?= =?us-ascii?Q?0mR6AP9HGQFuptEGV41AbnKXfUT6b6sih7huIyHYmaWujtxVY6B819wEbA0I?= =?us-ascii?Q?Eckk8WsF6ag0T0ueS5aUcRmIn0HHW1qnRnI+/R2wn7oxFdLYJ+Ujm2q3z2N0?= =?us-ascii?Q?A8/JnGT9+aEs76gcGvFnCov+WIBweNa3Wlz7ivimeVY3M3I8cA1PcMVl7sIl?= =?us-ascii?Q?+9100dGKPuiUAFQNxQCwBvlsNp3G9kAi6q/2p7xVZroHsTngDkutMQjGTQC3?= =?us-ascii?Q?UHTSlLrE51xWF8lbsgsXrNwOR6R8wjqqmodWQ7regEbxgjusGzTWYoWH3Q+O?= =?us-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gW9F33FyusvU34R1c0= SpamDiagnosticOutput: 1:23 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: renesas.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 10 Feb 2016 02:45:00.2956 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-Transport-CrossTenantHeadersStamped: HKXPR06MB1016 Cc: Linux-ALSA , Linux-Kernel Subject: [alsa-devel] [PATCH 3/7][RFC] regmap: regmap_fields_xxx() uses regmap_raw_update_bits() X-BeenThere: alsa-devel@alsa-project.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "Alsa-devel mailing list for ALSA developers - http://www.alsa-project.org" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: alsa-devel-bounces@alsa-project.org Sender: alsa-devel-bounces@alsa-project.org X-Virus-Scanned: ClamAV using ClamSMTP From: Kuninori Morimoto It can be easy to add _check, _async, _check_async functions Signed-off-by: Kuninori Morimoto --- drivers/base/regmap/regmap.c | 32 ++++++++++++++++++-------------- include/linux/regmap.h | 15 +++++++++++---- 2 files changed, 29 insertions(+), 18 deletions(-) diff --git a/drivers/base/regmap/regmap.c b/drivers/base/regmap/regmap.c index ed2fc15..9329c27 100644 --- a/drivers/base/regmap/regmap.c +++ b/drivers/base/regmap/regmap.c @@ -1731,7 +1731,7 @@ int _regmap_field_update_bits(struct regmap_field *field, EXPORT_SYMBOL_GPL(_regmap_field_update_bits); /** - * regmap_fields_write(): Write a value to a single register field with port ID + * _regmap_fields_write(): Write a value to a single register field with port ID * * @field: Register field to write to * @id: port ID @@ -1740,17 +1740,19 @@ EXPORT_SYMBOL_GPL(_regmap_field_update_bits); * A value of zero will be returned on success, a negative errno will * be returned in error cases. */ -int regmap_fields_write(struct regmap_field *field, unsigned int id, - unsigned int val) +int _regmap_fields_write(struct regmap_field *field, + unsigned int id, unsigned int val, + bool *change, bool async, bool force) { if (id >= field->id_size) return -EINVAL; - return regmap_update_bits(field->regmap, - field->reg + (field->id_offset * id), - field->mask, val << field->shift); + return regmap_raw_update_bits(field->regmap, + field->reg + (field->id_offset * id), + field->mask, val << field->shift, + change, async, force); } -EXPORT_SYMBOL_GPL(regmap_fields_write); +EXPORT_SYMBOL_GPL(_regmap_fields_write); int regmap_fields_force_write(struct regmap_field *field, unsigned int id, unsigned int val) @@ -1765,7 +1767,7 @@ int regmap_fields_force_write(struct regmap_field *field, unsigned int id, EXPORT_SYMBOL_GPL(regmap_fields_force_write); /** - * regmap_fields_update_bits(): Perform a read/modify/write cycle + * _regmap_fields_update_bits(): Perform a read/modify/write cycle * on the register field * * @field: Register field to write to @@ -1776,19 +1778,21 @@ EXPORT_SYMBOL_GPL(regmap_fields_force_write); * A value of zero will be returned on success, a negative errno will * be returned in error cases. */ -int regmap_fields_update_bits(struct regmap_field *field, unsigned int id, - unsigned int mask, unsigned int val) +int _regmap_fields_update_bits(struct regmap_field *field, unsigned int id, + unsigned int mask, unsigned int val, + bool *change, bool async, bool force) { if (id >= field->id_size) return -EINVAL; mask = (mask << field->shift) & field->mask; - return regmap_update_bits(field->regmap, - field->reg + (field->id_offset * id), - mask, val << field->shift); + return regmap_raw_update_bits(field->regmap, + field->reg + (field->id_offset * id), + mask, val << field->shift, + change, async, force); } -EXPORT_SYMBOL_GPL(regmap_fields_update_bits); +EXPORT_SYMBOL_GPL(_regmap_fields_update_bits); /* * regmap_bulk_write(): Write multiple registers to the device diff --git a/include/linux/regmap.h b/include/linux/regmap.h index e3e54364..687223d 100644 --- a/include/linux/regmap.h +++ b/include/linux/regmap.h @@ -79,6 +79,11 @@ struct reg_sequence { #define regmap_field_update_bits(field, mask, val)\ _regmap_field_update_bits(field, mask, val, NULL, false, false) +#define regmap_fields_write(field, id, val)\ + _regmap_fields_write(field, id, val, NULL, false, false) +#define regmap_fields_update_bits(field, id, mask, val)\ + _regmap_fields_update_bits(field, id, mask, val, NULL, false, false) + #ifdef CONFIG_REGMAP enum regmap_endian { @@ -782,14 +787,16 @@ int _regmap_field_write(struct regmap_field *field, unsigned int val, int _regmap_field_update_bits(struct regmap_field *field, unsigned int mask, unsigned int val, bool *change, bool async, bool force); -int regmap_fields_write(struct regmap_field *field, unsigned int id, - unsigned int val); +int _regmap_fields_write(struct regmap_field *field, + unsigned int id, unsigned int val, + bool *change, bool async, bool force); int regmap_fields_force_write(struct regmap_field *field, unsigned int id, unsigned int val); int regmap_fields_read(struct regmap_field *field, unsigned int id, unsigned int *val); -int regmap_fields_update_bits(struct regmap_field *field, unsigned int id, - unsigned int mask, unsigned int val); +int _regmap_fields_update_bits(struct regmap_field *field, unsigned int id, + unsigned int mask, unsigned int val, + bool *change, bool async, bool force); /** * Description of an IRQ for the generic regmap irq_chip.