From patchwork Thu Aug 20 15:26:00 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Robert Baldyga X-Patchwork-Id: 7045391 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 4B36EC05AC for ; Thu, 20 Aug 2015 15:27:59 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 58A3B2034A for ; Thu, 20 Aug 2015 15:27:58 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 625A8202DD for ; Thu, 20 Aug 2015 15:27:57 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753535AbbHTP1n (ORCPT ); Thu, 20 Aug 2015 11:27:43 -0400 Received: from mailout3.samsung.com ([203.254.224.33]:57774 "EHLO mailout3.samsung.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753110AbbHTP0r (ORCPT ); Thu, 20 Aug 2015 11:26:47 -0400 Received: from epcpsbgm2new.samsung.com (epcpsbgm2 [203.254.230.27]) by mailout3.samsung.com (Oracle Communications Messaging Server 7.0.5.31.0 64bit (built May 5 2014)) with ESMTP id <0NTE01TGS08L7V40@mailout3.samsung.com>; Fri, 21 Aug 2015 00:26:45 +0900 (KST) X-AuditID: cbfee61b-f79706d000001b96-cf-55d5f1b5eb43 Received: from epmmp2 ( [203.254.227.17]) by epcpsbgm2new.samsung.com (EPCPMTA) with SMTP id 01.53.07062.5B1F5D55; Fri, 21 Aug 2015 00:26:45 +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:45 +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 1/3] NFC: nci: Add post_setup handler Date: Thu, 20 Aug 2015 17:26:00 +0200 Message-id: <1440084362-27909-2-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+t9jQd2tH6+GGkzt1LNYvP0ei8X8I+dY LfrfLGS1OPdqJaPFtsVTmC0u75rDZjFnw2Z2izcr7rBbrD1yl91i6fWLTBYTpq9lsVh06wyz xYPDO9ktWvceYbc43c3qwO+xZt4aRo/Lfb1MHiuXf2Hz2LSqk81j3slAj+7Z/1g85s78xebR t2UVo8fG7U+YPD5vkgvgiuKySUnNySxLLdK3S+DKuLp8MmvBZu6KO58KGhh3cnYxcnJICJhI tPx7xghhi0lcuLeerYuRi0NIYBajxOU3bYwQzk9GiTPveplBqtgEdCS2fJ8A1iEiECGx6cdT dpAiZoHjTBI7Z2xkBUkIC1hILPqxCMxmEVCVmDp5OTuIzSvgKvF2zzMWiHVyEiePTQar4RRw k7hxuwOsRgio5sKfCSwTGHkXMDKsYpRILUguKE5KzzXKSy3XK07MLS7NS9dLzs/dxAgO7WfS OxgP73I/xCjAwajEw3tB+GqoEGtiWXFl7iFGCQ5mJRHeW8+AQrwpiZVVqUX58UWlOanFhxil OViUxHn1TTaFCgmkJ5akZqemFqQWwWSZODilGhiXvbk0YYK2c/U6ZvP5rxfevdZ3T/h3xoeZ fzkde/3zTn2cN+2fIE9l96ZrIc9+27ea7nkZyK3gFtL93f65OLvnWmbt43v2GL02MZxVceAI 71K1SrMb73YyFn63e3/2QOWjST9WiBw7n2eY5sL8usFkzyM/9X2smxbx+9xgyRNflmNz6aep g9YCJZbijERDLeai4kQALHoXdWkCAAA= 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 require non-standard configuration after NCI_CORE_INIT request, because they need to know ndev->manufact_specific_info or ndev->manufact_id. This patch adds post_setup handler allowing to do such custom configuration. Signed-off-by: Robert Baldyga --- include/net/nfc/nci_core.h | 1 + net/nfc/nci/core.c | 4 ++++ 2 files changed, 5 insertions(+) diff --git a/include/net/nfc/nci_core.h b/include/net/nfc/nci_core.h index 01fc8c5..1bdaa5f 100644 --- a/include/net/nfc/nci_core.h +++ b/include/net/nfc/nci_core.h @@ -79,6 +79,7 @@ struct nci_ops { int (*close)(struct nci_dev *ndev); int (*send)(struct nci_dev *ndev, struct sk_buff *skb); int (*setup)(struct nci_dev *ndev); + int (*post_setup)(struct nci_dev *ndev); int (*fw_download)(struct nci_dev *ndev, const char *firmware_name); __u32 (*get_rfprotocol)(struct nci_dev *ndev, __u8 rf_protocol); int (*discover_se)(struct nci_dev *ndev); diff --git a/net/nfc/nci/core.c b/net/nfc/nci/core.c index 95af2d2..d9045ec 100644 --- a/net/nfc/nci/core.c +++ b/net/nfc/nci/core.c @@ -388,6 +388,10 @@ static int nci_open_device(struct nci_dev *ndev) msecs_to_jiffies(NCI_INIT_TIMEOUT)); } + if (ndev->ops->post_setup) { + rc = ndev->ops->post_setup(ndev); + } + if (!rc) { rc = __nci_request(ndev, nci_init_complete_req, 0, msecs_to_jiffies(NCI_INIT_TIMEOUT));