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 alsa0.perex.cz (alsa0.perex.cz [77.48.224.243]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 83915C433EF for ; Fri, 21 Jan 2022 16:56:15 +0000 (UTC) Received: from alsa1.perex.cz (alsa1.perex.cz [207.180.221.201]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by alsa0.perex.cz (Postfix) with ESMTPS id D0770295F; Fri, 21 Jan 2022 17:55:22 +0100 (CET) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz D0770295F DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1642784172; bh=nA7YzVS4r6cfhPvGGCIVfXAdXfmgViKp4+OFnZSh8BM=; h=From:To:References:In-Reply-To:Subject:Date:Cc:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From; b=Y4/cJhyumYSCIVJ7X9P6uBTRJzF/60wjQgh+p4lFwHTSvlat5y7/0B4UDajINrM/v jCeaiBVv6axdSkulbIrIbt+OdrY6V8RXtxDYgdw5l4ssl3Gji/XOMUS/a38lKTEzyW OQdNzkX78EFRA50hYMMAvojEqt45TxSWaw+0L7rI= Received: from alsa1.perex.cz (localhost.localdomain [127.0.0.1]) by alsa1.perex.cz (Postfix) with ESMTP id 5D360F80125; Fri, 21 Jan 2022 17:55:22 +0100 (CET) Received: by alsa1.perex.cz (Postfix, from userid 50401) id 788E7F800F5; Fri, 21 Jan 2022 17:55:21 +0100 (CET) Received: from mx0b-001ae601.pphosted.com (mx0b-001ae601.pphosted.com [67.231.152.168]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by alsa1.perex.cz (Postfix) with ESMTPS id 2AE5AF800F5 for ; Fri, 21 Jan 2022 17:55:13 +0100 (CET) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz 2AE5AF800F5 Authentication-Results: alsa1.perex.cz; dkim=pass (2048-bit key) header.d=cirrus.com header.i=@cirrus.com header.b="ACsTlvSN" Received: from pps.filterd (m0077474.ppops.net [127.0.0.1]) by mx0b-001ae601.pphosted.com (8.16.1.2/8.16.1.2) with ESMTP id 20L5kA6Y005173; Fri, 21 Jan 2022 10:55:12 -0600 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cirrus.com; h=from : to : cc : references : in-reply-to : subject : date : message-id : mime-version : content-type : content-transfer-encoding; s=PODMain02222019; bh=ylGyq7sLup9Rxfkgq+dfRN9ellYolkMaBQNzruHzou0=; b=ACsTlvSNjKR90Kk1SQZHW/kmzdoABEADjJu5bnXEc7B1k+9ms3TufB1J2GMYZIpe3j5x JvKVEpjZROpRbk3LOJV7xwJaqP36Kvw+9lwaW/yQSh2yVtjisyMagGF8PUujSrZVVFTY TYoqg3t4hR/LfCxP4m3kUJRaJMFlwm2BVLCXTkfz3KvTgvYye/7X2GmOYFBDXMfAJV0G vs0TyI2+zOWZaHxcBx7cdEtSvy4KYAbqc77O9Dqkip3BcOltlaKEZEvTmqk216LsGix/ VvI2U2ONS/DQpiSJpmJHXTWuuCdBZ9aUlCd9tjW2JDIq+i1ORM7zFqHPy1Ox4Zd8jWVI 8A== Received: from ediex01.ad.cirrus.com ([84.19.233.68]) by mx0b-001ae601.pphosted.com (PPS) with ESMTPS id 3dqhynrv2v-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128 verify=NOT); Fri, 21 Jan 2022 10:55:11 -0600 Received: from EDIEX01.ad.cirrus.com (198.61.84.80) by EDIEX01.ad.cirrus.com (198.61.84.80) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.18; Fri, 21 Jan 2022 16:55:10 +0000 Received: from ediswmail.ad.cirrus.com (198.61.86.93) by EDIEX01.ad.cirrus.com (198.61.84.80) with Microsoft SMTP Server id 15.1.2375.18 via Frontend Transport; Fri, 21 Jan 2022 16:55:10 +0000 Received: from LONN2DGDQ73 (unknown [198.90.238.138]) by ediswmail.ad.cirrus.com (Postfix) with ESMTP id DF69045D; Fri, 21 Jan 2022 16:55:09 +0000 (UTC) From: Stefan Binding To: "'Rafael J. Wysocki'" References: <20220121143254.6432-1-sbinding@opensource.cirrus.com> <20220121143254.6432-8-sbinding@opensource.cirrus.com> In-Reply-To: Subject: RE: [PATCH v5 7/9] platform/x86: serial-multi-instantiate: Add SPI support Date: Fri, 21 Jan 2022 16:55:10 +0000 Message-ID: <019901d80ee7$a6bf2a90$f43d7fb0$@opensource.cirrus.com> MIME-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Mailer: Microsoft Outlook 16.0 Thread-Index: AQIyNEEjz2y1WYLj0c4G0/lJ4TX/RgKST2RJAeKXLR6rlb3VEA== Content-Language: en-gb X-Proofpoint-ORIG-GUID: qRemX4_MgGf_MJQAQwN1TSlciwQ0ymrl X-Proofpoint-GUID: qRemX4_MgGf_MJQAQwN1TSlciwQ0ymrl X-Proofpoint-Spam-Reason: safe Cc: 'Platform Driver' , "'moderated list:SOUND - SOC LAYER / DYNAMIC AUDIO POWER MANAGEM...'" , 'ACPI Devel Maling List' , 'Linux Kernel Mailing List' , 'Takashi Iwai' , 'Mark Gross' , 'Hans de Goede' , 'Mark Brown' , patches@opensource.cirrus.com, 'linux-spi' , 'Len Brown' X-BeenThere: alsa-devel@alsa-project.org X-Mailman-Version: 2.1.15 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" Hi, > -----Original Message----- > From: Rafael J. Wysocki > Sent: 21 January 2022 15:31 > To: Stefan Binding > Cc: Mark Brown ; Rafael J . Wysocki > ; Len Brown ; Hans de Goede > ; Mark Gross ; Jaroslav > Kysela ; Takashi Iwai ; moderated > list:SOUND - SOC LAYER / DYNAMIC AUDIO POWER MANAGEM... devel@alsa-project.org>; Linux Kernel Mailing List kernel@vger.kernel.org>; linux-spi ; ACPI = Devel > Maling List ; Platform Driver = x86@vger.kernel.org>; patches@opensource.cirrus.com > Subject: Re: [PATCH v5 7/9] platform/x86: serial-multi-instantiate: = Add SPI > support >=20 > > diff --git a/drivers/platform/x86/Kconfig = b/drivers/platform/x86/Kconfig > > index 5b65d687f046..28f5bbf0f27a 100644 > > --- a/drivers/platform/x86/Kconfig > > +++ b/drivers/platform/x86/Kconfig > > @@ -991,12 +991,12 @@ config TOPSTAR_LAPTOP > > If you have a Topstar laptop, say Y or M here. > > > > config SERIAL_MULTI_INSTANTIATE > > - tristate "I2C multi instantiate pseudo device driver" > > - depends on I2C && ACPI > > + tristate "I2C and SPI multi instantiate pseudo device = driver" > > + depends on I2C && SPI && ACPI >=20 > Should this be (I2C || SPI) && ACPI ? We made it dependent on both I2C and SPI because of how interconnected = the serial-multi-instantiate driver is with both SPI and I2C. We felt = attempting to make the driver compatible with one without the other would end up very = complicated. > > @@ -146,7 +247,21 @@ static int smi_probe(struct platform_device = *pdev) > > > > platform_set_drvdata(pdev, smi); > > > > - return smi_i2c_probe(pdev, adev, smi, inst_array); > > + switch (node->bus_type) { > > + case SMI_I2C: > > + return smi_i2c_probe(pdev, adev, smi, = node->instances); > > + case SMI_SPI: > > + return smi_spi_probe(pdev, adev, smi, = node->instances); > > + case SMI_AUTO_DETECT: > > + if (i2c_acpi_client_count(adev) > 0) > > + return smi_i2c_probe(pdev, adev, smi, = node->instances); > > + else > > + return smi_spi_probe(pdev, adev, smi, = node->instances); > > + default: > > + break; >=20 > Why is this needed? This return code is attempting to ensure that we don=E2=80=99t try to = guess whether we expect devices to be I2C or SPI - especially with regards to existing = devices. We wanted to maintain compatibility with existing devices, which would = all be I2C. For the device for which we are adding, the same HID is used by both the = same chip for both I2C and SPI, so we also needed a way to support both. Thanks, Stefan