From patchwork Thu Aug 20 15:26:01 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Robert Baldyga X-Patchwork-Id: 7045371 X-Patchwork-Delegate: kvalo@adurom.com Return-Path: X-Original-To: patchwork-linux-wireless@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 BF0E3C05AC for ; Thu, 20 Aug 2015 15:27:39 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id D0C0E20592 for ; Thu, 20 Aug 2015 15:27:37 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id C761B20392 for ; Thu, 20 Aug 2015 15:27:36 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753398AbbHTP06 (ORCPT ); Thu, 20 Aug 2015 11:26:58 -0400 Received: from mailout2.samsung.com ([203.254.224.25]:54300 "EHLO mailout2.samsung.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752177AbbHTP04 (ORCPT ); Thu, 20 Aug 2015 11:26:56 -0400 Received: from epcpsbgm2new.samsung.com (epcpsbgm2 [203.254.230.27]) by mailout2.samsung.com (Oracle Communications Messaging Server 7.0.5.31.0 64bit (built May 5 2014)) with ESMTP id <0NTE0140G08UVLA0@mailout2.samsung.com>; Fri, 21 Aug 2015 00:26:54 +0900 (KST) X-AuditID: cbfee61b-f79706d000001b96-d9-55d5f1be6bf6 Received: from epmmp2 ( [203.254.227.17]) by epcpsbgm2new.samsung.com (EPCPMTA) with SMTP id F2.53.07062.EB1F5D55; Fri, 21 Aug 2015 00:26:54 +0900 (KST) Received: from AMDC2122.DIGITAL.local ([106.120.53.17]) by mmp2.samsung.com (Oracle Communications Messaging Server 7.0.5.31.0 64bit (built May 5 2014)) with ESMTPA id <0NTE00JA207NHU20@mmp2.samsung.com>; Fri, 21 Aug 2015 00:26:54 +0900 (KST) From: Robert Baldyga To: sameo@linux.intel.com, lauro.venancio@openbossa.org, aloisio.almeida@openbossa.org Cc: robh+dt@kernel.org, pawel.moll@arm.com, mark.rutland@arm.com, ijc+devicetree@hellion.org.uk, galak@codeaurora.org, linux-wireless@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-nfc@lists.01.org, m.szyprowski@samsung.com, pebolle@tiscali.nl, Robert Baldyga Subject: [PATCH v3 2/3] NFC: nci: export nci_core_reset and nci_core_init Date: Thu, 20 Aug 2015 17:26:01 +0200 Message-id: <1440084362-27909-3-git-send-email-r.baldyga@samsung.com> X-Mailer: git-send-email 1.9.1 In-reply-to: <1440084362-27909-1-git-send-email-r.baldyga@samsung.com> References: <1440084362-27909-1-git-send-email-r.baldyga@samsung.com> X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFrrGLMWRmVeSWpSXmKPExsVy+t9jQd19H6+GGiw+oGGxePs9Fov5R86x WvS/Wchqce7VSkaLbYunMFtc3jWHzWLOhs3sFm9W3GG3WHvkLrvF0usXmSwmTF/LYrHo1hlm iweHd7JbtO49wm5xupvVgd9jzbw1jB6X+3qZPFYu/8LmsWlVJ5vHvJOBHt2z/7F4zJ35i82j b8sqRo+N258weXzeJBfAFcVlk5Kak1mWWqRvl8CV8WLfX/aC47wVM9ZeZGtgXMndxcjJISFg IvF9zlQWCFtM4sK99WwgtpDALEaJnbMZuxi5gOyfjBIL9/aygyTYBHQktnyfwAhiiwhESGz6 8ZQdpIhZ4DiTxM4ZG1lBEsICnhIzls8Ba2ARUJWYPf0c2AZeAVeJT21fmCG2yUmcPDYZrJ5T wE3ixu0OdojNrhIX/kxgmcDIu4CRYRWjRGpBckFxUnquUV5quV5xYm5xaV66XnJ+7iZGcGg/ k97BeHiX+yFGAQ5GJR7eC8JXQ4VYE8uKK3MPMUpwMCuJ8N56BhTiTUmsrEotyo8vKs1JLT7E KM3BoiTOq2+yKVRIID2xJDU7NbUgtQgmy8TBKdXA6CzziuNNuoZgTIE7e6XNrTXtE3LjVn1e +nKV+gxp8bX/Td+EH3/+w3DDHN+bAib75DPYv52s/LBi+XrhKZJ/ogoCOrlbzxdG2DTtqD4d e3xGwrngApuUy2EnnqT8P+5z4ffVko+Tvls/+P7oVtm0ZyZHtS7MN85tqOj6d+uD8+xH/2bV NXI2XFdiKc5INNRiLipOBADirpgjaQIAAA== Sender: linux-wireless-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org X-Spam-Status: No, score=-7.5 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, 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 Some drivers needs to have ability to reinit NCI core, for example after updating firmware in setup() of post_setup() callback. This patch makes nci_core_reset() and nci_core_init() functions public, to make it possible. Signed-off-by: Robert Baldyga --- include/net/nfc/nci_core.h | 2 ++ net/nfc/nci/core.c | 14 ++++++++++++++ 2 files changed, 16 insertions(+) diff --git a/include/net/nfc/nci_core.h b/include/net/nfc/nci_core.h index 1bdaa5f..d0d0f1e 100644 --- a/include/net/nfc/nci_core.h +++ b/include/net/nfc/nci_core.h @@ -278,6 +278,8 @@ int nci_request(struct nci_dev *ndev, unsigned long opt), unsigned long opt, __u32 timeout); int nci_prop_cmd(struct nci_dev *ndev, __u8 oid, size_t len, __u8 *payload); +int nci_core_reset(struct nci_dev *ndev); +int nci_core_init(struct nci_dev *ndev); int nci_recv_frame(struct nci_dev *ndev, struct sk_buff *skb); int nci_set_config(struct nci_dev *ndev, __u8 id, size_t len, __u8 *val); diff --git a/net/nfc/nci/core.c b/net/nfc/nci/core.c index d9045ec..943889b 100644 --- a/net/nfc/nci/core.c +++ b/net/nfc/nci/core.c @@ -351,6 +351,20 @@ int nci_prop_cmd(struct nci_dev *ndev, __u8 oid, size_t len, __u8 *payload) } EXPORT_SYMBOL(nci_prop_cmd); +int nci_core_reset(struct nci_dev *ndev) +{ + return __nci_request(ndev, nci_reset_req, 0, + msecs_to_jiffies(NCI_RESET_TIMEOUT)); +} +EXPORT_SYMBOL(nci_core_reset); + +int nci_core_init(struct nci_dev *ndev) +{ + return __nci_request(ndev, nci_init_req, 0, + msecs_to_jiffies(NCI_INIT_TIMEOUT)); +} +EXPORT_SYMBOL(nci_core_init); + static int nci_open_device(struct nci_dev *ndev) { int rc = 0;