From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id F3C15EB64DB for ; Thu, 15 Jun 2023 22:15:22 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S239130AbjFOWPV (ORCPT ); Thu, 15 Jun 2023 18:15:21 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:55604 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230114AbjFOWPU (ORCPT ); Thu, 15 Jun 2023 18:15:20 -0400 Received: from fgw20-7.mail.saunalahti.fi (fgw20-7.mail.saunalahti.fi [62.142.5.81]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 6A78B2D59 for ; Thu, 15 Jun 2023 15:14:58 -0700 (PDT) Received: from localhost (88-113-24-87.elisa-laajakaista.fi [88.113.24.87]) by fgw20.mail.saunalahti.fi (Halon) with ESMTP id 0df2eb39-0bca-11ee-b3cf-005056bd6ce9; Fri, 16 Jun 2023 01:14:54 +0300 (EEST) From: andy.shevchenko@gmail.com Date: Fri, 16 Jun 2023 01:14:53 +0300 To: Charles Keepax Cc: broonie@kernel.org, lee@kernel.org, krzysztof.kozlowski+dt@linaro.org, linus.walleij@linaro.org, vkoul@kernel.org, robh+dt@kernel.org, conor+dt@kernel.org, lgirdwood@gmail.com, yung-chuan.liao@linux.intel.com, sanyog.r.kale@intel.com, pierre-louis.bossart@linux.intel.com, alsa-devel@alsa-project.org, patches@opensource.cirrus.com, devicetree@vger.kernel.org, linux-gpio@vger.kernel.org, linux-spi@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH v3 1/6] soundwire: bus: Allow SoundWire peripherals to register IRQ handlers Message-ID: References: <20230605125504.2570158-1-ckeepax@opensource.cirrus.com> <20230605125504.2570158-2-ckeepax@opensource.cirrus.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20230605125504.2570158-2-ckeepax@opensource.cirrus.com> Precedence: bulk List-ID: X-Mailing-List: linux-spi@vger.kernel.org Mon, Jun 05, 2023 at 01:54:59PM +0100, Charles Keepax kirjoitti: > From: Lucas Tanure > > Currently the in-band alerts for SoundWire peripherals can only > be communicated to the driver through the interrupt_callback > function. This however is slightly inconvient for devices that wish to > share IRQ handling code between SoundWire and I2C/SPI, the later would > normally register an IRQ handler with the IRQ subsystem. However there > is no reason the SoundWire in-band IRQs can not also be communicated > as an actual IRQ to the driver. > > Add support for SoundWire peripherals to register a normal IRQ handler > to receive SoundWire in-band alerts, allowing code to be shared across > control buses. Note that we allow users to use both the > interrupt_callback and the IRQ handler, this is useful for devices which > must clear additional chip specific SoundWire registers that are not a > part of the normal IRQ flow, or the SoundWire specification. ... > + bus->irq_chip.name = dev_name(bus->dev); > + bus->domain = irq_domain_add_linear(NULL, SDW_MAX_DEVICES, &sdw_domain_ops, bus); I'm wondering why you are not using existing fwnode, if any (e.g. from parent device). > + if (!bus->domain) { > + dev_err(bus->dev, "Failed to add IRQ domain\n"); > + return -EINVAL; > + } -- With Best Regards, Andy Shevchenko