Received: by 2002:a25:8b91:0:0:0:0:0 with SMTP id j17csp493856ybl; Fri, 6 Dec 2019 01:08:40 -0800 (PST) X-Google-Smtp-Source: APXvYqwGrgDKLUdmtXuS0RHT2NzC++ZVPZRQcsbFylsigozMo9YwhywaSoG6WweqYtE3SDCpaZvM X-Received: by 2002:aca:1011:: with SMTP id 17mr11606066oiq.72.1575623320381; Fri, 06 Dec 2019 01:08:40 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1575623320; cv=none; d=google.com; s=arc-20160816; b=aps/T5ES02noDfFNjKloZfJ1S1nfMUsBJcJmIuqQxMPJB+x29RkkRehpbpv6J/Qu3O BhR8N7cWaHUgRnCoSnF4HBuHbtt7VTAbiMnN+eIpZjAKH9g7OnkYqiVGk7N1e2S86SCn 2P+lzV1SJVc8cXg4/aOYgBbN0C/15IJv7B6V68HbkAyy8POJCW8C9Gm/0std56lrXKPy LyxWsliR63Ot9uTEzcD+jrJpx2B2/oCSrtiFr6TRkiSEyP8dbFU6TMAjKdpnSNvAg45o g5zCNnlsJ/n+ndAwaOcY2vGwEflvX/VOdDLHO0XWppQ88kQ5QZjfcPBAyB56hE9Y8TPF +5VQ== 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:dkim-signature; bh=IC0nFJQovPdziVzgU2aFSV4eEeO6kPT3TlMkyeyMjTY=; b=fviWZAwq0wGgrzUlbgr7GGh7/HiX3hP4EFxFu75hPQ1PIzhRqgN9FZrodSKOWhBtp3 sWaVzM8L+CPOt+17JcIyis0dwDPcu4of2gUr9Hy0/FmicmwiXSsE1VGrN4tf4fM85mV6 /gLJPdwDd9gMdR2L91lJWaDDnNDB1lxJo6qHGs4IkV+yfFGqQSlsEvS1aV/pu0yepAPB zxXjNk8gqh9TaAb0nBrbZ2HrbOA4UmB6q+58Wqew/4RmJJKtBxpDOL9Cd2RBF7pwi8nn OQfBVClMjvKhShxstYbzg2kp5uvZcLtToc2N8+7Y2l9Rcp7QTRS5EasZ991xTAo7ngbE MYIg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@baylibre-com.20150623.gappssmtp.com header.s=20150623 header.b=BE6ht680; spf=pass (google.com: best guess record for domain of linux-bluetooth-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-bluetooth-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id z10si4921098oto.50.2019.12.06.01.08.15; Fri, 06 Dec 2019 01:08:40 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-bluetooth-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@baylibre-com.20150623.gappssmtp.com header.s=20150623 header.b=BE6ht680; spf=pass (google.com: best guess record for domain of linux-bluetooth-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-bluetooth-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726168AbfLFJIM (ORCPT + 99 others); Fri, 6 Dec 2019 04:08:12 -0500 Received: from mail-wr1-f65.google.com ([209.85.221.65]:42449 "EHLO mail-wr1-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726088AbfLFJIM (ORCPT ); Fri, 6 Dec 2019 04:08:12 -0500 Received: by mail-wr1-f65.google.com with SMTP id a15so6870555wrf.9 for ; Fri, 06 Dec 2019 01:08:10 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=baylibre-com.20150623.gappssmtp.com; s=20150623; h=subject:to:cc:references:from:message-id:date:user-agent :mime-version:in-reply-to:content-transfer-encoding:content-language; bh=IC0nFJQovPdziVzgU2aFSV4eEeO6kPT3TlMkyeyMjTY=; b=BE6ht680FK89WSCevAr+hDyb8eiiRaSME+dcBCpdAfBPuoSvfGpOOy8GTvuMkQot8K qbPX0nc8xReBu8fQo1uAJ01WyJ7Sn+MJ9qlNLfdJe8VJhQmETJmZdvFuzekZk9T7jguD 1wtEIImojrv6poPBjtrkJo6rqpqlfzJvFsaSLoa1I1SE7pFzYslfnB3cMJOziys4d7el P4GqzCVIPomt19lNJy0tt9k1AqiKL1RuJDu1Ls0BqcStkQMOoTl1bGN9sPT+wIEfn0iH 0Wu7B5mhZZLC913K2lXnVFrcQROMYMdKVoQE0mte0Z2XkYXYPIM+nt/wF8YE/9BR7QC0 rSKg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:cc:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-transfer-encoding :content-language; bh=IC0nFJQovPdziVzgU2aFSV4eEeO6kPT3TlMkyeyMjTY=; b=ZbZwTWR4wHEyHqD98TLdxSlWFIoeRTBhsnKVXAezNTbrCE/2u3nPNaRshW4DaCSMze rpKLouOzTq0rq3pGriCXuMa1EyIcfLGuWC8dAsDU8Ebp3l3Y2Ui37AO3pVTL271q0AjS H5/4+HUE74ghi2bSTaVeh0zBzfxwvldH9Rz2p5rkyI4c71HQp7RbjtEXADwghWei5y4p 2Y1RD9vbyHsOpErd5iaUY3BOR2ZEalrV2toDqI1eMKW7PiSnnFeKkwiNvcIIjDxJTbT/ sciFvaaILtgEvnGnROPF/I3a1pBDP26kVlu1wMeYhr28MNZYt+8+pAiG2sWYZwZnnwsF kKxA== X-Gm-Message-State: APjAAAWNSEt7Uj7+mkcCFiwoP650/D+DNyio+fY315um/94L4aVKAJDO BZPUMIpHDevvdJUseVq37eTfZg== X-Received: by 2002:adf:dd46:: with SMTP id u6mr14998118wrm.13.1575623290069; Fri, 06 Dec 2019 01:08:10 -0800 (PST) Received: from [10.1.4.98] (laubervilliers-658-1-213-31.w90-63.abo.wanadoo.fr. [90.63.244.31]) by smtp.gmail.com with ESMTPSA id g25sm4662913wmh.3.2019.12.06.01.08.08 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Fri, 06 Dec 2019 01:08:09 -0800 (PST) Subject: Re: [PATCH v2] bluetooth: hci_bcm: enable IRQ capability from node To: Kevin Hilman , marcel@holtmann.org, johan.hedberg@gmail.com, linux-bluetooth@vger.kernel.org Cc: linux-kernel@vger.kernel.org References: <20191204161239.16653-1-glaroque@baylibre.com> <7hv9qu2rt1.fsf@baylibre.com> From: guillaume La Roque Message-ID: <6f6cbb0d-3265-8e6d-60fb-6df2539d36af@baylibre.com> Date: Fri, 6 Dec 2019 10:08:08 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.2.1 MIME-Version: 1.0 In-Reply-To: <7hv9qu2rt1.fsf@baylibre.com> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit Content-Language: en-US Sender: linux-bluetooth-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-bluetooth@vger.kernel.org hi Kevin, On 12/6/19 1:58 AM, Kevin Hilman wrote: > Guillaume La Roque writes: > >> Actually IRQ can be found from GPIO but all platorms don't support > nit: s/platorms/platforms/ will fix in v3 >> gpiod_to_irq, it's the case on amlogic chip. >> so to have possibility to use interrupt mode we need to add interrupts >> field in node and support it in driver. >> >> Signed-off-by: Guillaume La Roque >> --- >> sorry for noise, >> >> v2 is for rebasing on master branch >> >> guillaume >> >> drivers/bluetooth/hci_bcm.c | 3 +++ >> 1 file changed, 3 insertions(+) >> >> diff --git a/drivers/bluetooth/hci_bcm.c b/drivers/bluetooth/hci_bcm.c >> index f8f5c593a05c..9f52d57c56de 100644 >> --- a/drivers/bluetooth/hci_bcm.c >> +++ b/drivers/bluetooth/hci_bcm.c >> @@ -1409,6 +1409,7 @@ static int bcm_serdev_probe(struct serdev_device *serdev) >> { >> struct bcm_device *bcmdev; >> const struct bcm_device_data *data; >> + struct platform_device *pdev; >> int err; >> >> bcmdev = devm_kzalloc(&serdev->dev, sizeof(*bcmdev), GFP_KERNEL); >> @@ -1421,6 +1422,8 @@ static int bcm_serdev_probe(struct serdev_device *serdev) >> #endif >> bcmdev->serdev_hu.serdev = serdev; >> serdev_device_set_drvdata(serdev, bcmdev); >> + pdev = to_platform_device(bcmdev->dev); >> + bcmdev->irq = platform_get_irq(pdev, 0); > I don't know this driver well enough to be sure, but don't you need some > error checking here? > > If this fails (on platforms with no IRQ defined), is an error code in > bcmdev->irq going to affect later code that tries to setup IRQs? not needed to do something here becauseĀ  bcm_get_resources function check irq <=0 if yes it check if host-wakeup gpio was defined in node and try a gpiod_to_irq. at the end in bcm_request_irq function i check if irq <=0 if yes return EOPNOTSUPP > Kevin > Guillaume