From patchwork Mon Feb 15 05:25:15 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kuninori Morimoto X-Patchwork-Id: 8309861 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 02E349F2F0 for ; Mon, 15 Feb 2016 05:31:35 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id F26B6204D8 for ; Mon, 15 Feb 2016 05:31:33 +0000 (UTC) Received: from alsa0.perex.cz (alsa0.perex.cz [77.48.224.243]) by mail.kernel.org (Postfix) with ESMTP id B070120462 for ; Mon, 15 Feb 2016 05:31:32 +0000 (UTC) Received: by alsa0.perex.cz (Postfix, from userid 1000) id C6A4126154E; Mon, 15 Feb 2016 06:31:26 +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 57F5C261555; Mon, 15 Feb 2016 06:27:50 +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 8759E261555; Mon, 15 Feb 2016 06:27:48 +0100 (CET) Received: from relmlie2.idc.renesas.com (relmlor3.renesas.com [210.160.252.173]) by alsa0.perex.cz (Postfix) with ESMTP id 9E8BA261600 for ; Mon, 15 Feb 2016 06:25:19 +0100 (CET) Received: from unknown (HELO relmlir2.idc.renesas.com) ([10.200.68.152]) by relmlie2.idc.renesas.com with ESMTP; 15 Feb 2016 14:25:18 +0900 Received: from relmlac4.idc.renesas.com (relmlac4.idc.renesas.com [10.200.69.24]) by relmlir2.idc.renesas.com (Postfix) with ESMTP id 4817F529D2; Mon, 15 Feb 2016 14:25:18 +0900 (JST) Received: by relmlac4.idc.renesas.com (Postfix, from userid 0) id 34655480A4; Mon, 15 Feb 2016 14:25:18 +0900 (JST) Received: from relmlac4.idc.renesas.com (localhost [127.0.0.1]) by relmlac4.idc.renesas.com (Postfix) with ESMTP id 2C965480A3; Mon, 15 Feb 2016 14:25:18 +0900 (JST) Received: from relmlii1.idc.renesas.com [10.200.68.65] by relmlac4.idc.renesas.com with ESMTP id QAJ19847; Mon, 15 Feb 2016 14:25:18 +0900 X-IronPort-AV: E=Sophos;i="5.22,449,1449500400"; d="scan'";a="204324744" Received: from mail-sg2apc01lp0241.outbound.protection.outlook.com (HELO APC01-SG2-obe.outbound.protection.outlook.com) ([65.55.88.241]) by relmlii1.idc.renesas.com with ESMTP/TLS/AES256-SHA; 15 Feb 2016 14:25:17 +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=ayDhp+hNauvJup2wbZY4MNQemmsbUtwoFYKpPUbQD1k=; b=lEyGJA8yaroiCi8/UDNKciGO8jZYstOt1YoSgAPs0cFgvp4OIQEsgEwo1liEcSpRJRESftLtAJEur32ECrc9itDC0c8F9atomwVMRqSJwpvFv8KM1o+9EAq+ybhU0KLhYqghCxuhgYVuLlv1xQBETryJt+z5KFMm8uRPowi9iBs= 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 SIXPR06MB1022.apcprd06.prod.outlook.com (10.160.239.156) with Microsoft SMTP Server (TLS) id 15.1.409.15; Mon, 15 Feb 2016 05:25:15 +0000 Message-ID: <87y4amh7lv.wl%kuninori.morimoto.gx@renesas.com> From: Kuninori Morimoto User-Agent: Wanderlust/2.15.9 Emacs/24.3 Mule/6.0 MIME-Version: 1.0 (generated by SEMI-EPG 1.14.7 - "Harue") To: Mark Brown , Greg KH In-Reply-To: <87d1ryimdz.wl%kuninori.morimoto.gx@renesas.com> References: <87d1ryimdz.wl%kuninori.morimoto.gx@renesas.com> Date: Mon, 15 Feb 2016 05:25:15 +0000 X-Originating-IP: [211.11.155.144] X-ClientProxiedBy: OS1PR01CA0035.jpnprd01.prod.outlook.com (25.164.162.17) To SIXPR06MB1022.apcprd06.prod.outlook.com (25.160.239.156) X-Microsoft-Exchange-Diagnostics: 1; SIXPR06MB1022; 2:KmsuAMirRdfyuj5j2ySU3FTY7HhsKtH4/UR/Pk2s93YglvlmbUbCYM9FKk7wZaWG8MsNAu8JtAfWn6vv5Q05ovejjY03bdZGuynbhCrZs/aMalrYRe1RNEBXb0Mco4I5bxpYuIoKfRB9LG/2M2qvYw==; 3:uqbIZad80oAxReTcOplkf2EMFaHsWgN5blQ3K/xUKe+08TiOo1QjWqUnaYo7btB8rjQzZUcMO6sXNbq5D4lFmTvlpgu2FNp1GERAcpKW5n+Z5zWE2u/1cSSwML3WRzYc; 25:J1ptXksFnVDnpungooezfOA8re268lkh6qrTvCKm2oiWhGPAYzQiodjNBmIX9BGWrCra2m+M9Y03O+sOuRTCfX8Y13S4r9YBDiD5pg1fexf7H2JnQfUiRB0DOGUZFKamlkzn85NyM0BBf5mBtT95UryjLooMNgh23H45GQQCxoRztuscpdvaNtgaCEtUGF80R6dKX0UiowlibdDjO/D908ToaqldkfYBadnSWWhjOG4ESfhhsRk1vjBWQvyY0tGrVSNRGnS1XdbFsTYHv1BDsgALmTqHR9kZugJ0smg4+O4/0nKVipvwg4epoRCVg1Zq X-Microsoft-Antispam: UriScan:;BCL:0;PCL:0;RULEID:;SRVR:SIXPR06MB1022; X-MS-Office365-Filtering-Correlation-Id: 27291906-3348-43a2-671f-08d335c86332 X-Microsoft-Exchange-Diagnostics: 1; SIXPR06MB1022; 20:Td17PuPQzok4qoK5JeKm1Fx4Q4ooyDtCol6ZHFO5Wkdk+iCkQMMvOgNRs6LyM7CgCVDiZKrYDeNDLquFniFatLZXswan8XSXFDcBuL1HWcbVkESKEg+P4xXFDCfwgsWlQzSOSSfocZD/TvrMDrbmNJzAP36FqSWVbgialH7G0zcB3ma7MnJ9Cr8Oz3FrBe2gxafe4uOAH3Bo95it5Tcq+8he/eZBWF72P1zLgydNcq+f0glO+LJVMXWquCIhDLDIq+41QcVfx1Nt4ztd7cK5DZJcFa05rmX9KB9OAq7CL+C0KDiNfMlLJQ/OxBme+qWjoWJloFxjf77fUrQqbtUZpURWjzBXYunozlLy5IeMN8erbJCeNfVoNJCk91LpnM1EAgiP1VSyt/hTOe1s6n8RwaC1pP9Te11AvM+A+RZaX006AL3/Gx6XdbPaiov0/Bf/wOPftB+KWj+CuTqWh54KNDhLyApA+Ypccq2kNqeSkojBQKhZVGL0W2rpdl4wfL9t; 4:9ZYUrGFTr2rklQKLA8v5ZNbMaCw36Cyj77MmorZU+7r5Ho42l0CSNFo+SLMrt6VN7aXEcPrqsDdA3uodm7LNQHYQncMPjOD4hUphg6Wy5BxOIoKdMtkhA699AbQVn6M9s8llr14skqdtjDmGXrKPbEnHD6UZL6X5Y7zTCxdVfBXxW5dvLzh2qwM6Sl4dHQtFNg+Pz0rgjhm4w+I6AFk5vZHMVS8qx4ImeYQKDFoxFQM5RrzMAnjwH9Ryzx4TwD7PcrdQk+SMquf4ObyMr1e0tAp3b5GP7gQdLFY6arQNfjlKy0nVdGd+6wcfqsIxUOOTUylu8hofrKxR/xKVSELhhfDVg0KRKAQ71cvbVLCMvQXUGrD8rVziXhxW+rpBPoQ6 X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:; X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(601004)(2401047)(5005006)(8121501046)(10201501046)(3002001); SRVR:SIXPR06MB1022; BCL:0; PCL:0; RULEID:; SRVR:SIXPR06MB1022; X-Forefront-PRVS: 08534B37A7 X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10019020)(4630300001)(6009001)(5001960100002)(1096002)(4326007)(5004730100002)(77096005)(122386002)(53416004)(5008740100001)(47776003)(4001350100001)(5001770100001)(42186005)(40100003)(23726003)(33646002)(92566002)(189998001)(86362001)(46406003)(2950100001)(76176999)(229853001)(586003)(3846002)(6116002)(50466002)(66066001)(54356999)(83506001)(50986999)(87976001)(36756003)(19580405001)(2906002)(19580395003); DIR:OUT; SFP:1102; SCL:1; SRVR:SIXPR06MB1022; H:morimoto-PC.renesas.com; FPR:; SPF:None; MLV:sfv; LANG:en; X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; SIXPR06MB1022; 23:zgC41KiK76Q8J11XShzhL6PvIXf1n+J3QP5fYSuiB?= =?us-ascii?Q?1rZ8MC3WjTTuR1rj6zzr8TqFb40ZCGEY822Rs+JH1aiA4ETX2NylHKGZbObS?= =?us-ascii?Q?s12KDuxAd0npBsgZQXCA+jtFKsbEy7d/6ZAogDHFxg+KpQEY7b46TlBio52r?= =?us-ascii?Q?IYAgfaoMg7d25uHRP3OXv9JlTGRlmsnYmsukPrPAyi9R+fm4vE/w9EEI5hk0?= =?us-ascii?Q?cedNN+SGye1NBnKaEgEv827KqbURd3cKyHJsutH5sGLz0vuXQOCbLOiU6hlu?= =?us-ascii?Q?2/Hl0vMq6tCyc4gLhJPqGmuBXT9VkkrZ0DHlgOSxe1vEc+QfhmYBIVq753RJ?= =?us-ascii?Q?2T54z7hydcVcYLKsTfT1efImIz9JB9+E5XPPPdCp1kHzz1Gxr02L2CoL8yyr?= =?us-ascii?Q?ers3IDZW1Mzkczdkr5cFFn5odQs2EZ/ZgGpxwmqz5i4WEq2YUmWULHAz2Pvq?= =?us-ascii?Q?wTxBco+L5k9re+B7BnNCFUKRdQg7Tc5/kZnmlQl7PfeGnYit77+FSRa9RaBM?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Y0yGjVlnUduU8TDidcqYGM= SpamDiagnosticOutput: 1:23 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: renesas.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 15 Feb 2016 05:25:15.7569 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-Transport-CrossTenantHeadersStamped: SIXPR06MB1022 Cc: Linux-ALSA , Linux-Kernel Subject: [alsa-devel] [PATCH 10/15 v2][RFC] regmap: merge regmap_fields_write() into macro 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 This patch merges regmap_fields_write() into macro by using regmap_fields_update_bits_base(). Signed-off-by: Kuninori Morimoto --- drivers/base/regmap/regmap.c | 22 ---------------------- include/linux/regmap.h | 5 +++-- 2 files changed, 3 insertions(+), 24 deletions(-) diff --git a/drivers/base/regmap/regmap.c b/drivers/base/regmap/regmap.c index 0c7773f..4b14745 100644 --- a/drivers/base/regmap/regmap.c +++ b/drivers/base/regmap/regmap.c @@ -1748,28 +1748,6 @@ int regmap_fields_update_bits_base(struct regmap_field *field, unsigned int id, } EXPORT_SYMBOL_GPL(regmap_fields_update_bits_base); -/** - * regmap_fields_write(): Write a value to a single register field with port ID - * - * @field: Register field to write to - * @id: port ID - * @val: Value to be written - * - * 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) -{ - if (id >= field->id_size) - return -EINVAL; - - return regmap_update_bits(field->regmap, - field->reg + (field->id_offset * id), - field->mask, val << field->shift); -} -EXPORT_SYMBOL_GPL(regmap_fields_write); - int regmap_fields_force_write(struct regmap_field *field, unsigned int id, unsigned int val) { diff --git a/include/linux/regmap.h b/include/linux/regmap.h index 2735a3d..5f438a4 100644 --- a/include/linux/regmap.h +++ b/include/linux/regmap.h @@ -79,6 +79,9 @@ struct reg_sequence { #define regmap_field_update_bits(field, mask, val)\ regmap_field_update_bits_base(field, mask, val, NULL, false, false) +#define regmap_fields_write(field, id, val) \ + regmap_fields_update_bits_base(field, id, ~0, val, NULL, false, false) + #ifdef CONFIG_REGMAP enum regmap_endian { @@ -780,8 +783,6 @@ int regmap_field_read(struct regmap_field *field, unsigned int *val); int regmap_field_update_bits_base(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_force_write(struct regmap_field *field, unsigned int id, unsigned int val); int regmap_fields_read(struct regmap_field *field, unsigned int id,