From nobody Tue Nov 26 06:37:55 2024 Received: from mx1.tq-group.com (mx1.tq-group.com [93.104.207.81]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id CF0321E1A14 for ; Mon, 21 Oct 2024 11:34:59 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=93.104.207.81 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1729510502; cv=none; b=XHeMksL5Xy3b0ggMfOhKZBNPm3sDGVl+TBix8KfDyv1O8OVezn2ZHm67PisVrr+l5VWjlDCm5fZw029uGhaLvjo5E+EBQAaRvvWDqetqDRNi3LPCnzIdo6S+lOtJlV4UtuUmxPPwPwdR6W5levYyHtnV1CzOpg7f+BtuBDV7ZDs= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1729510502; c=relaxed/simple; bh=1MOtHteYWLgSnE+BGZjFr2i4gBJ6Z8DTY4EVbhQyBFw=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=eGDn47KuvmIV12siwAA98GyN3XgIFqk9mx43H5Ya744+c10y8I7eHgixpisYYU+7tcsPSZ8sfdnN+1z6mENl0orwFZinQ/nswJaeG56WKSwrcp0/nrYyr9zjxX9k5Sw8g2CmSSIjiDX2S1TZH1LZM016VcDhvQ3sCVO1nMFrb+4= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=ew.tq-group.com; spf=pass smtp.mailfrom=ew.tq-group.com; dkim=pass (2048-bit key) header.d=tq-group.com header.i=@tq-group.com header.b=NoYE9PuG; dkim=fail (0-bit key) header.d=ew.tq-group.com header.i=@ew.tq-group.com header.b=mt0AKEgy reason="key not found in DNS"; arc=none smtp.client-ip=93.104.207.81 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=ew.tq-group.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=ew.tq-group.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=tq-group.com header.i=@tq-group.com header.b="NoYE9PuG"; dkim=fail reason="key not found in DNS" (0-bit key) header.d=ew.tq-group.com header.i=@ew.tq-group.com header.b="mt0AKEgy" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=tq-group.com; i=@tq-group.com; q=dns/txt; s=key1; t=1729510500; x=1761046500; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=kIeUNChnfvhiBSBAYrYCxmsV3Uo5EQOsZuqb2GqwFAc=; b=NoYE9PuGQyHXZhhT1wChvKjfi9IGAyELNx0SMi9QuF/25KHDRYxAQ1rp 0x8FXntQ8nzq1BfUE4LRDJpyJ6N4ObsblrdhBxBVYUXgWF6cnxycIKQER Nc9eQP59vdROY35n4lTPhSY+1z9QyEvHfc/9SMNl4BbkgLe6pDpS+E3rd JP5kZI7ugIN8XRXniu7bgjNQxPJoLWB+L70z9qvFheFqA+me7O6aPRqdb Ukne9CTRkuE5YtKnMr/RScyj+1MjazYiS2T3krcX6lSqWmvVMV3CroRbw gNYS7rw12G9Q1RGrIwbrl3yp66Ge1SdahncZW6Wk4eMT08y7Chh/v2dkl A==; X-CSE-ConnectionGUID: R9w9UCN4S5Omybbv1wvikw== X-CSE-MsgGUID: ttIQnVJ6TDG7UtaPIHUqdw== X-IronPort-AV: E=Sophos;i="6.11,220,1725314400"; d="scan'208";a="39572170" Received: from vmailcow01.tq-net.de ([10.150.86.48]) by mx1.tq-group.com with ESMTP; 21 Oct 2024 13:34:53 +0200 X-CheckPoint: {67163C5D-7-69FF9A8E-EE9CEDAF} X-MAIL-CPID: 858BF63EA041801573E13CE6D54F75A0_0 X-Control-Analysis: str=0001.0A682F18.67163C5D.006B,ss=1,re=0.000,recu=0.000,reip=0.000,cl=1,cld=1,fgs=0 Received: from [127.0.0.1] (localhost [127.0.0.1]) by localhost (Mailerdaemon) with ESMTPSA id B3402161191; Mon, 21 Oct 2024 13:34:48 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ew.tq-group.com; s=dkim; t=1729510488; h=from:subject:date:message-id:to:cc:mime-version:content-type: content-transfer-encoding:in-reply-to:references; bh=kIeUNChnfvhiBSBAYrYCxmsV3Uo5EQOsZuqb2GqwFAc=; b=mt0AKEgyHeh7MrB17IY1hEQyXRjhUU+iSz9USD/mgv3dhL9MsXyr13OdAwCfegW2Yfc0X5 axOxTxNwSUcmQUT4DRcQz2+R1Wm1QdA6fjZE69gcG0zu70UMG+SjaGty5EO6jEcZ8g4XGB F/9uiV6djWkkRz4yp5nNiWJSKFn2fcpAYBit3ykjtIrKyK+8hh1pedPCv1So0sezQhcgQu m42pkw5FUVT1I50a5iY9/TF55HyGNdElxj4pwCTPYZmj0m/BZ3wZS+yREH4yo1cBmAl3Qj oU5NALCpyPaLsWlQEy8cn7lGEpt+K0s7+tIqJRlQsu9geRlHS+6Rm5AdpMdcuQ== From: Matthias Schiffer To: Lee Jones Cc: linux@ew.tq-group.com, linux-kernel@vger.kernel.org, Matthias Schiffer Subject: [PATCH v5 1/5] mfd: tqmx86: add board definitions for TQMx120UC, TQMx130UC and TQMxE41S Date: Mon, 21 Oct 2024 13:34:23 +0200 Message-ID: <6c74f7b138507382e3c4db0a05c21d3f1f442109.1729509613.git.matthias.schiffer@ew.tq-group.com> X-Mailer: git-send-email 2.46.2 In-Reply-To: References: Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-Last-TLS-Session-Version: TLSv1.3 This adds support for 3 new TQMx86 COMs: - TQMx120UC/TQMx130UC: COM Express Compact Type 6 modules with 12th and 13th Generation Intel Core CPUs ([1, 2]) - TQMxE41S: SMARC 2.1 module with Intel Atom x7000E and compatible CPUs [3] [1] https://www.tq-group.com/en/products/tq-embedded/x86-architecture/tqmx1= 20uc/ [2] https://www.tq-group.com/en/products/tq-embedded/x86-architecture/tqmx1= 30uc/ [3] https://www.tq-group.com/en/products/tq-embedded/x86-architecture/tqmxe= 41s/ Signed-off-by: Matthias Schiffer --- v2: no changes v3: no changes v4: no changes v5: no changes drivers/mfd/tqmx86.c | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/drivers/mfd/tqmx86.c b/drivers/mfd/tqmx86.c index fac02875fe7d9..e15b9be98c2db 100644 --- a/drivers/mfd/tqmx86.c +++ b/drivers/mfd/tqmx86.c @@ -35,11 +35,14 @@ #define TQMX86_REG_BOARD_ID_E39C2 7 #define TQMX86_REG_BOARD_ID_70EB 8 #define TQMX86_REG_BOARD_ID_80UC 9 +#define TQMX86_REG_BOARD_ID_120UC 10 #define TQMX86_REG_BOARD_ID_110EB 11 #define TQMX86_REG_BOARD_ID_E40M 12 #define TQMX86_REG_BOARD_ID_E40S 13 #define TQMX86_REG_BOARD_ID_E40C1 14 #define TQMX86_REG_BOARD_ID_E40C2 15 +#define TQMX86_REG_BOARD_ID_130UC 16 +#define TQMX86_REG_BOARD_ID_E41S 19 #define TQMX86_REG_BOARD_REV 0x01 #define TQMX86_REG_IO_EXT_INT 0x06 #define TQMX86_REG_IO_EXT_INT_NONE 0 @@ -132,6 +135,8 @@ static const char *tqmx86_board_id_to_name(u8 board_id,= u8 sauc) return "TQMx70EB"; case TQMX86_REG_BOARD_ID_80UC: return "TQMx80UC"; + case TQMX86_REG_BOARD_ID_120UC: + return "TQMx120UC"; case TQMX86_REG_BOARD_ID_110EB: return "TQMx110EB"; case TQMX86_REG_BOARD_ID_E40M: @@ -142,6 +147,10 @@ static const char *tqmx86_board_id_to_name(u8 board_id= , u8 sauc) return "TQMxE40C1"; case TQMX86_REG_BOARD_ID_E40C2: return "TQMxE40C2"; + case TQMX86_REG_BOARD_ID_130UC: + return "TQMx130UC"; + case TQMX86_REG_BOARD_ID_E41S: + return "TQMxE41S"; default: return "Unknown"; } @@ -154,11 +163,14 @@ static int tqmx86_board_id_to_clk_rate(struct device = *dev, u8 board_id) case TQMX86_REG_BOARD_ID_60EB: case TQMX86_REG_BOARD_ID_70EB: case TQMX86_REG_BOARD_ID_80UC: + case TQMX86_REG_BOARD_ID_120UC: case TQMX86_REG_BOARD_ID_110EB: case TQMX86_REG_BOARD_ID_E40M: case TQMX86_REG_BOARD_ID_E40S: case TQMX86_REG_BOARD_ID_E40C1: case TQMX86_REG_BOARD_ID_E40C2: + case TQMX86_REG_BOARD_ID_130UC: + case TQMX86_REG_BOARD_ID_E41S: return 24000; case TQMX86_REG_BOARD_ID_E39MS: case TQMX86_REG_BOARD_ID_E39C1: --=20 TQ-Systems GmbH | M=C3=BChlstra=C3=9Fe 2, Gut Delling | 82229 Seefeld, Germ= any Amtsgericht M=C3=BCnchen, HRB 105018 Gesch=C3=A4ftsf=C3=BChrer: Detlef Schneider, R=C3=BCdiger Stahl, Stefan Sch= neider https://www.tq-group.com/ From nobody Tue Nov 26 06:37:55 2024 Received: from mx1.tq-group.com (mx1.tq-group.com [93.104.207.81]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id AC5B51E5713 for ; Mon, 21 Oct 2024 11:35:01 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=93.104.207.81 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1729510504; cv=none; b=a0B1f9xpurXiixfYI49UeqIEPcg1Q6kOf1CStbLBFXYnpcdJYdj2mC33/pE7x1xdKZUeDiEcsU4bmJFhNek4s1UIdSovh+bbJuA6nI5xuWTBHeJQ9TBEmmO1LPdzweuI8xj+oUxAXLeN1A98c4gkj5mMaObh7Xq9E6Bd0Dzwq8g= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1729510504; c=relaxed/simple; bh=SWB+YIcKSa2cnIMjMV1MetO1v44wetA8djbP3HOM6xk=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=iQrffkqfy36hICia/sEgc7QK2/5P++1v2qHLAdLKh3kL03P/CKK7hGER3nDQaI1kA/Jz1OjpdbGQ1UQmPcgU1f+d5LKsLDgkba213gMFM7m9TUEClZ+ZfECJCUgqHemHidPj2zin1UnZIUL7RORIFGx1yX+WBmi0O2Z1F406SaY= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=ew.tq-group.com; spf=pass smtp.mailfrom=ew.tq-group.com; dkim=pass (2048-bit key) header.d=tq-group.com header.i=@tq-group.com header.b=jjWfXkqM; dkim=fail (0-bit key) header.d=ew.tq-group.com header.i=@ew.tq-group.com header.b=s8Fim2hl reason="key not found in DNS"; arc=none smtp.client-ip=93.104.207.81 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=ew.tq-group.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=ew.tq-group.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=tq-group.com header.i=@tq-group.com header.b="jjWfXkqM"; dkim=fail reason="key not found in DNS" (0-bit key) header.d=ew.tq-group.com header.i=@ew.tq-group.com header.b="s8Fim2hl" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=tq-group.com; i=@tq-group.com; q=dns/txt; s=key1; t=1729510501; x=1761046501; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=Sx7Xorv8FjsmAB4buQ1e6aM0MbULMg22J2nr/WshdS0=; b=jjWfXkqMEqoH1JKE5mtR4GKTG7gldOdQZ2yBcKxL5SzKT7Zrt35KJFwb PeeRCzNsUYerxOfqXwLkQRcAeKmXxS4csp2oJ3HMRGJyx1KzxXextNFXX sNKXY14G3YlP2yYQqle1jR9yd9wnqQ4zRN2wu5xkvLrxDS1qdZAR+v5Rk EqP+aGnXynsnK07fJ+kkk9y0bq6KTmvmpIFNg9vTfzAMUkFRoVSNwGYv5 WoB4V2Ppt5RMgkvGulpYJY3sIdnzdwyY5chw8OGJdwZ7my6BJanTdnXmn nq3TqXSdjVtjSPdxY4D2ZqHMQTuksDF6HWvVOPCe3zBeuF0sBpxhv4nSW A==; X-CSE-ConnectionGUID: dnkRsAzDQlOlV34uNJSI/g== X-CSE-MsgGUID: SVFzqBCDTCW71OFS9EXBMA== X-IronPort-AV: E=Sophos;i="6.11,220,1725314400"; d="scan'208";a="39572171" Received: from vmailcow01.tq-net.de ([10.150.86.48]) by mx1.tq-group.com with ESMTP; 21 Oct 2024 13:34:57 +0200 X-CheckPoint: {67163C61-32-21611FC3-DAD22B0C} X-MAIL-CPID: EE7BF2580129918420CE6084B8755F1E_4 X-Control-Analysis: str=0001.0A682F22.67163C61.00C3,ss=1,re=0.000,recu=0.000,reip=0.000,cl=1,cld=1,fgs=0 Received: from [127.0.0.1] (localhost [127.0.0.1]) by localhost (Mailerdaemon) with ESMTPSA id 2DB5316B483; Mon, 21 Oct 2024 13:34:53 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ew.tq-group.com; s=dkim; t=1729510493; h=from:subject:date:message-id:to:cc:mime-version:content-type: content-transfer-encoding:in-reply-to:references; bh=Sx7Xorv8FjsmAB4buQ1e6aM0MbULMg22J2nr/WshdS0=; b=s8Fim2hlylK+vd/pGfJA1qIUnuS2nGnUXXfgfcA7bV3hLvsg4byOHkLGteRXDpq/x16Tqh EswlaHPB1IyWGvyUMo00SIpoSA5YEiayIFyCZoSaSRtSo8N4cSYWoqY2ML3z5g9EiQmo67 L7notjFxNOofXwgr0lJGgooiNPMtcURWVVA18fg8cjTMcI8HCprmBieZC6fQx/b0HGn3Al uKeaW3n5xWxBksf/MUzcz+uZ05r/tvDmE2uGF8imgW1iMv5SQUpnitRiLC5+x7N+Fp2ykf Wm0ZDymevjZzhiyeTe2c52Lh7A6ycQygFSDxsimeGlXiQ2pou6xTVfelHBoj3Q== From: Matthias Schiffer To: Lee Jones Cc: linux@ew.tq-group.com, linux-kernel@vger.kernel.org, Matthias Schiffer Subject: [PATCH v5 2/5] mfd: tqmx86: improve gpio_irq module parameter description Date: Mon, 21 Oct 2024 13:34:24 +0200 Message-ID: X-Mailer: git-send-email 2.46.2 In-Reply-To: References: Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-Last-TLS-Session-Version: TLSv1.3 Clarify that "7, 9, 12" refers to the valid arguments that can be passed as gpio_irq. Signed-off-by: Matthias Schiffer --- v2: new patch v3: no changes v4: no changes v5: no changes drivers/mfd/tqmx86.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/mfd/tqmx86.c b/drivers/mfd/tqmx86.c index e15b9be98c2db..7b2f9490a9af5 100644 --- a/drivers/mfd/tqmx86.c +++ b/drivers/mfd/tqmx86.c @@ -58,7 +58,7 @@ =20 static uint gpio_irq; module_param(gpio_irq, uint, 0); -MODULE_PARM_DESC(gpio_irq, "GPIO IRQ number (7, 9, 12)"); +MODULE_PARM_DESC(gpio_irq, "GPIO IRQ number (valid parameters: 7, 9, 12)"); =20 static const struct resource tqmx_i2c_soft_resources[] =3D { DEFINE_RES_IO(TQMX86_IOBASE_I2C, TQMX86_IOSIZE_I2C), --=20 TQ-Systems GmbH | M=C3=BChlstra=C3=9Fe 2, Gut Delling | 82229 Seefeld, Germ= any Amtsgericht M=C3=BCnchen, HRB 105018 Gesch=C3=A4ftsf=C3=BChrer: Detlef Schneider, R=C3=BCdiger Stahl, Stefan Sch= neider https://www.tq-group.com/ From nobody Tue Nov 26 06:37:55 2024 Received: from mx1.tq-group.com (mx1.tq-group.com [93.104.207.81]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 598C21E7C18 for ; Mon, 21 Oct 2024 11:35:03 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=93.104.207.81 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1729510506; cv=none; b=Ry9YL/FtVH65QUCOxnFQiEccjjfNp/FcekUoweI0HdkdvQt3tNtHkY8s0fQXG8yVpht+/Xieep4I3fFLgvWweeNuLucYG25nQ1YCWgg3vnGnMFS2Ac0P7oOoFzFEVVe9IxhnJjyXNohZlI/j+/OzkX29IBvz6KiH4Lycn3sLmi4= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1729510506; c=relaxed/simple; bh=u3MRpfsBNrYEXrrDZiUvwzrIQ0Qj5UhCoBgsuhERX7o=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=SQzOsyLMVQRV+JGImxqsDMe1jBfUcdL2yMXda7OXO4U331qAZDVF0sgaSZm7yZdNmyqoEslQIjQoBZNBgpDM1IlIwknJ2EH8nMD0NtZM+M27+0ZC0h0oYHxKNK2s18AZuaTw3b5mJ685gfHrvtow9FoJcOiAdjAuKNL+CYHRZ2Q= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=ew.tq-group.com; spf=pass smtp.mailfrom=ew.tq-group.com; dkim=pass (2048-bit key) header.d=tq-group.com header.i=@tq-group.com header.b=H7b6tf67; dkim=fail (0-bit key) header.d=ew.tq-group.com header.i=@ew.tq-group.com header.b=W/mZABEX reason="key not found in DNS"; arc=none smtp.client-ip=93.104.207.81 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=ew.tq-group.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=ew.tq-group.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=tq-group.com header.i=@tq-group.com header.b="H7b6tf67"; dkim=fail reason="key not found in DNS" (0-bit key) header.d=ew.tq-group.com header.i=@ew.tq-group.com header.b="W/mZABEX" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=tq-group.com; i=@tq-group.com; q=dns/txt; s=key1; t=1729510503; x=1761046503; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=KgACnBmebNMiSOX9BB+1c3iZLWhclN2SNaXkWrwesu4=; b=H7b6tf67wWNROlhWxU8I9v26oTIUqWU0TikXjFbqKBzKyXwsKOVvqKZu SAVEelooIgtxI6eW+mAVMHRtMORlWxxU8enmXsw45Y+F1Qa1skZ9Nhvfs ZUr7yKvBwAkVxTG7NaKSrL1SidWNgpdDdzBykJ3fHoicXrtDpvEVvKdrv b+3vKkPtfMwbuFak0bgTRPxK8O26FcxMiFXkiM/tGrdpCAsgOB2Z+gKTY gvcePZvjVE5e2tsdOSwvX8yVP40GOeByrLv9B4zjaccLCd3nMZxh3+qfq cR6xCFyJuppAtsk+izadc1Js1a8hPLuYuV3drJcrTaK0e8aBScFVMV+mq w==; X-CSE-ConnectionGUID: tjhLVjZ2QQehU8+7qKnpCw== X-CSE-MsgGUID: l5a61T0eS56v/FBbBnJ9aw== X-IronPort-AV: E=Sophos;i="6.11,220,1725314400"; d="scan'208";a="39572174" Received: from vmailcow01.tq-net.de ([10.150.86.48]) by mx1.tq-group.com with ESMTP; 21 Oct 2024 13:35:02 +0200 X-CheckPoint: {67163C66-5-236878CD-F32272AF} X-MAIL-CPID: 5C26BF51197334E733BC197B0C0ECC93_2 X-Control-Analysis: str=0001.0A682F22.67163C66.0043,ss=1,re=0.000,recu=0.000,reip=0.000,cl=1,cld=1,fgs=0 Received: from [127.0.0.1] (localhost [127.0.0.1]) by localhost (Mailerdaemon) with ESMTPSA id A176116B31E; Mon, 21 Oct 2024 13:34:57 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ew.tq-group.com; s=dkim; t=1729510497; h=from:subject:date:message-id:to:cc:mime-version:content-type: content-transfer-encoding:in-reply-to:references; bh=KgACnBmebNMiSOX9BB+1c3iZLWhclN2SNaXkWrwesu4=; b=W/mZABEX33Kbwo4ePm5+xRaEYXiEjxAC6M62o1l5L8t+JFZDFPOgGWLaGfpqPEv1m/EG8Z MKgs21krhhxsbt7ju92xrBZc5p2E4Yuw4OkyzJb9cs1fvOvNeRiQZhbDO6Vq6gjnMfmcxi VyNDecwMgxSelpZied9EbH3ur0iX5X+EJJX6d98jAWnL8Ho2V9Yd7lneEq+CNpNvhtCgWQ +EDtsXG9d1BOhsQFsDpLZHcKZJl1Fm2Zrxntyk5o3f8Agn0zsvemgfMWrvw0VG/wJAMAUI VzVlQqA1+/1GCdkWEO0QhSJEm9sEhXwNlkkF47cbCEmybgrWpEBzzIfduP5pZQ== From: Matthias Schiffer To: Lee Jones Cc: linux@ew.tq-group.com, linux-kernel@vger.kernel.org, Matthias Schiffer , Gregor Herburger Subject: [PATCH v5 3/5] mfd: tqmx86: refactor GPIO IRQ setup Date: Mon, 21 Oct 2024 13:34:25 +0200 Message-ID: X-Mailer: git-send-email 2.46.2 In-Reply-To: References: Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-Last-TLS-Session-Version: TLSv1.3 Move IRQ setup into a helper function. The string "GPIO" for error messages is replaced with a label argument to prepare for reusing the function for the I2C IRQ. No functional change intended. Co-developed-by: Gregor Herburger Signed-off-by: Gregor Herburger Signed-off-by: Matthias Schiffer --- v2: no changes (was patch 2/4) v3: no changes v4: drop tqmx86_irq_to_irq_cfg() function, handle IRQ-to-register-value mapping in tqmx86_setup_irq() instead v5: no changes drivers/mfd/tqmx86.c | 59 +++++++++++++++++++++++++++----------------- 1 file changed, 37 insertions(+), 22 deletions(-) diff --git a/drivers/mfd/tqmx86.c b/drivers/mfd/tqmx86.c index 7b2f9490a9af5..8aa448a67c9a5 100644 --- a/drivers/mfd/tqmx86.c +++ b/drivers/mfd/tqmx86.c @@ -186,33 +186,52 @@ static int tqmx86_board_id_to_clk_rate(struct device = *dev, u8 board_id) } } =20 -static int tqmx86_probe(struct platform_device *pdev) +static int tqmx86_setup_irq(struct device *dev, const char *label, u8 irq, + void __iomem *io_base, u8 reg_shift) { - u8 board_id, sauc, rev, i2c_det, io_ext_int_val; - struct device *dev =3D &pdev->dev; - u8 gpio_irq_cfg, readback; - const char *board_name; - void __iomem *io_base; - int err; + u8 val, readback; + int irq_cfg; =20 - switch (gpio_irq) { + switch (irq) { case 0: - gpio_irq_cfg =3D TQMX86_REG_IO_EXT_INT_NONE; + irq_cfg =3D TQMX86_REG_IO_EXT_INT_NONE; break; case 7: - gpio_irq_cfg =3D TQMX86_REG_IO_EXT_INT_7; + irq_cfg =3D TQMX86_REG_IO_EXT_INT_7; break; case 9: - gpio_irq_cfg =3D TQMX86_REG_IO_EXT_INT_9; + irq_cfg =3D TQMX86_REG_IO_EXT_INT_9; break; case 12: - gpio_irq_cfg =3D TQMX86_REG_IO_EXT_INT_12; + irq_cfg =3D TQMX86_REG_IO_EXT_INT_12; break; default: - pr_err("tqmx86: Invalid GPIO IRQ (%d)\n", gpio_irq); + dev_err(dev, "invalid %s IRQ (%d)\n", label, irq); return -EINVAL; } =20 + val =3D ioread8(io_base + TQMX86_REG_IO_EXT_INT); + val &=3D ~(TQMX86_REG_IO_EXT_INT_MASK << reg_shift); + val |=3D (irq_cfg & TQMX86_REG_IO_EXT_INT_MASK) << reg_shift; + + iowrite8(val, io_base + TQMX86_REG_IO_EXT_INT); + readback =3D ioread8(io_base + TQMX86_REG_IO_EXT_INT); + if (readback !=3D val) { + dev_warn(dev, "%s interrupts not supported\n", label); + return -EINVAL; + } + + return 0; +} + +static int tqmx86_probe(struct platform_device *pdev) +{ + u8 board_id, sauc, rev, i2c_det; + struct device *dev =3D &pdev->dev; + const char *board_name; + void __iomem *io_base; + int err; + io_base =3D devm_ioport_map(dev, TQMX86_IOBASE, TQMX86_IOSIZE); if (!io_base) return -ENOMEM; @@ -233,15 +252,11 @@ static int tqmx86_probe(struct platform_device *pdev) */ i2c_det =3D inb(TQMX86_REG_I2C_DETECT); =20 - if (gpio_irq_cfg) { - io_ext_int_val =3D - gpio_irq_cfg << TQMX86_REG_IO_EXT_INT_GPIO_SHIFT; - iowrite8(io_ext_int_val, io_base + TQMX86_REG_IO_EXT_INT); - readback =3D ioread8(io_base + TQMX86_REG_IO_EXT_INT); - if (readback !=3D io_ext_int_val) { - dev_warn(dev, "GPIO interrupts not supported.\n"); - return -EINVAL; - } + if (gpio_irq) { + err =3D tqmx86_setup_irq(dev, "GPIO", gpio_irq, io_base, + TQMX86_REG_IO_EXT_INT_GPIO_SHIFT); + if (err) + return err; =20 /* Assumes the IRQ resource is first. */ tqmx_gpio_resources[0].start =3D gpio_irq; --=20 TQ-Systems GmbH | M=C3=BChlstra=C3=9Fe 2, Gut Delling | 82229 Seefeld, Germ= any Amtsgericht M=C3=BCnchen, HRB 105018 Gesch=C3=A4ftsf=C3=BChrer: Detlef Schneider, R=C3=BCdiger Stahl, Stefan Sch= neider https://www.tq-group.com/ From nobody Tue Nov 26 06:37:55 2024 Received: from mx1.tq-group.com (mx1.tq-group.com [93.104.207.81]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 944811E9088 for ; Mon, 21 Oct 2024 11:35:08 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=93.104.207.81 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1729510511; cv=none; b=fvpM9OrrHNGeMbJ9Wzw2Rujc66WhmHnxeXu7sVTp69jp4LyUWOh18xi07XmTpujzaeh3Sh4G2Y6zUydOAXG5BWSEsoPasOZbHoJuv06FmMiU6rfwaCj9gRTq1L6+ey1F6ZhWTLV5E2lkERx3fV/1A6a+5CVxrKc8I60XFxy/mUs= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1729510511; c=relaxed/simple; bh=fRVRaBwlJZbv50zfC2PPH76a//MtJAkMe+p9jYxgtLA=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=c7fD8JP8h3e5fZdGQHPPXe7t1No4kdRugSkbBHoDRJwO14Eu+kznY20AVznEzWt6yzIPCYgnrpDX/x4fYA0ECrL0BaOlZalt+lwblRZob3FcqOSfTtq6a1cHdRhjldwBDe5E/K6tqKOcpLvNXAvvCBOXzLberokCqrsXHfKzP1I= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=ew.tq-group.com; spf=pass smtp.mailfrom=ew.tq-group.com; dkim=pass (2048-bit key) header.d=tq-group.com header.i=@tq-group.com header.b=acFq7zXa; dkim=fail (0-bit key) header.d=ew.tq-group.com header.i=@ew.tq-group.com header.b=kb/yu5C3 reason="key not found in DNS"; arc=none smtp.client-ip=93.104.207.81 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=ew.tq-group.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=ew.tq-group.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=tq-group.com header.i=@tq-group.com header.b="acFq7zXa"; dkim=fail reason="key not found in DNS" (0-bit key) header.d=ew.tq-group.com header.i=@ew.tq-group.com header.b="kb/yu5C3" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=tq-group.com; i=@tq-group.com; q=dns/txt; s=key1; t=1729510508; x=1761046508; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=yn7P9s9yfLjz2aH1iQX9Xxev1nS9eDHS8J7ckQDc9R8=; b=acFq7zXaxt4CbiOraDX3ABRN3C4KoVFtpyaqVUrBd9ABqUs5qF26r8sc bXwV4K7YX4PNTSvqJUbFRx9B/NM4iz69YdrcpUP8KfqqqZ+ocUQ8U4o+P 8MZndvWlsiDF6jFtNAJIBR1gQUhz0qgTuIEGx2HWyrCYin0Y86b7gCM4r KY6mskce+cswu9H3qBoA6r+9jIvRBqx7aEMw2CL/nXYBAav8jJ2fKSDdo 94odRnlzD6Acnupyhrysq9EcYsftfgtcrMA465wfWEiQ1raME0V3iUNOp Bmu1M41VnVBL3gDtr4A64Oc3Y80forDdECBtx7Uk2szU3cWDish95M7Ep w==; X-CSE-ConnectionGUID: 7Q3Bgeb7QGWKcbF8hbPCLw== X-CSE-MsgGUID: DRbSwB3pQyWirI7fZeqMeg== X-IronPort-AV: E=Sophos;i="6.11,220,1725314400"; d="scan'208";a="39572176" Received: from vmailcow01.tq-net.de ([10.150.86.48]) by mx1.tq-group.com with ESMTP; 21 Oct 2024 13:35:06 +0200 X-CheckPoint: {67163C6A-27-69FF9A8E-EE9CEDAF} X-MAIL-CPID: 506B085ADD78BEFC05A4BB5CBF61F036_0 X-Control-Analysis: str=0001.0A682F21.67163C76.002A,ss=1,re=0.000,recu=0.000,reip=0.000,cl=1,cld=1,fgs=0 Received: from [127.0.0.1] (localhost [127.0.0.1]) by localhost (Mailerdaemon) with ESMTPSA id 27E5616B2F7; Mon, 21 Oct 2024 13:35:02 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ew.tq-group.com; s=dkim; t=1729510502; h=from:subject:date:message-id:to:cc:mime-version:content-type: content-transfer-encoding:in-reply-to:references; bh=yn7P9s9yfLjz2aH1iQX9Xxev1nS9eDHS8J7ckQDc9R8=; b=kb/yu5C3qbqwyvDbDwBcQ48XRy0xSEecXcMmTq6Ug96swvkvOTeUaNWjihcK2mhx5AHZto +siJw6FoCn3A8yhMEGu8aZYQJHT+zUhkFNs8+JkYu+lr4p3cFnp2L20X1OqsRkKAO8JOr9 ULRhwrkDeoZblvxegRp4WVavzsyjI56o52rQpIi6KquBelvFg9yTBBawe2tTg/C8zVWlcY mpuDsDqYwhUYTMd+l9ZJnZfjBeGPxEsLHgShJOCI0ozWMxlm2y/Ik3Spe9XFPYbpg9nE1r v4+oucbp998+bIDuZBpG+lsjDRiOBgVNC3GIyMl8de89YaGQf7aymRq79zehtg== From: Matthias Schiffer To: Lee Jones Cc: linux@ew.tq-group.com, linux-kernel@vger.kernel.org, Matthias Schiffer Subject: [PATCH v5 4/5] mfd: tqmx86: make IRQ setup errors non-fatal Date: Mon, 21 Oct 2024 13:34:26 +0200 Message-ID: <95e7deca3451f2fb19b2c8253e9d19117bbdd06c.1729509613.git.matthias.schiffer@ew.tq-group.com> X-Mailer: git-send-email 2.46.2 In-Reply-To: References: Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-Last-TLS-Session-Version: TLSv1.3 GPIO IRQ setup can fail either because an invalid IRQ was passed as a parameter, or because the GPIO controller does not support interrupts. Neither is severe enough to stop the whole probe; simply disable IRQ support in the GPIO resource when setup fails. The code is made a bit more robust by introduing a define for the index of the IRQ resource in the resource list instead of assuming that it is at index 0. Signed-off-by: Matthias Schiffer --- v2: no changes (was patch 3/4) v3: replace IRQ 0 resource with an empty placeholder to simplify error hand= ling v4: no changes v5: move placeholder to the end of the resource array, use define for index drivers/mfd/tqmx86.c | 19 +++++++------------ 1 file changed, 7 insertions(+), 12 deletions(-) diff --git a/drivers/mfd/tqmx86.c b/drivers/mfd/tqmx86.c index 8aa448a67c9a5..1fd2212bf492c 100644 --- a/drivers/mfd/tqmx86.c +++ b/drivers/mfd/tqmx86.c @@ -60,6 +60,9 @@ static uint gpio_irq; module_param(gpio_irq, uint, 0); MODULE_PARM_DESC(gpio_irq, "GPIO IRQ number (valid parameters: 7, 9, 12)"); =20 +/* Index of IRQ placeholder in resource list */ +#define TQMX86_IRQ_GPIO 1 + static const struct resource tqmx_i2c_soft_resources[] =3D { DEFINE_RES_IO(TQMX86_IOBASE_I2C, TQMX86_IOSIZE_I2C), }; @@ -68,13 +71,10 @@ static const struct resource tqmx_watchdog_resources[] = =3D { DEFINE_RES_IO(TQMX86_IOBASE_WATCHDOG, TQMX86_IOSIZE_WATCHDOG), }; =20 -/* - * The IRQ resource must be first, since it is updated with the - * configured IRQ in the probe function. - */ static struct resource tqmx_gpio_resources[] =3D { - DEFINE_RES_IRQ(0), DEFINE_RES_IO(TQMX86_IOBASE_GPIO, TQMX86_IOSIZE_GPIO), + /* Placeholder for IRQ resource - filled in by the probe function */ + [TQMX86_IRQ_GPIO] =3D {}, }; =20 static struct i2c_board_info tqmx86_i2c_devices[] =3D { @@ -255,13 +255,8 @@ static int tqmx86_probe(struct platform_device *pdev) if (gpio_irq) { err =3D tqmx86_setup_irq(dev, "GPIO", gpio_irq, io_base, TQMX86_REG_IO_EXT_INT_GPIO_SHIFT); - if (err) - return err; - - /* Assumes the IRQ resource is first. */ - tqmx_gpio_resources[0].start =3D gpio_irq; - } else { - tqmx_gpio_resources[0].flags =3D 0; + if (!err) + tqmx_gpio_resources[TQMX86_IRQ_GPIO] =3D DEFINE_RES_IRQ(gpio_irq); } =20 ocores_platform_data.clock_khz =3D tqmx86_board_id_to_clk_rate(dev, board= _id); --=20 TQ-Systems GmbH | M=C3=BChlstra=C3=9Fe 2, Gut Delling | 82229 Seefeld, Germ= any Amtsgericht M=C3=BCnchen, HRB 105018 Gesch=C3=A4ftsf=C3=BChrer: Detlef Schneider, R=C3=BCdiger Stahl, Stefan Sch= neider https://www.tq-group.com/ From nobody Tue Nov 26 06:37:55 2024 Received: from mx1.tq-group.com (mx1.tq-group.com [93.104.207.81]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id CA4091E909F for ; Mon, 21 Oct 2024 11:35:11 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=93.104.207.81 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1729510514; cv=none; b=ofWx1hCcU5sfocS0/xoqn8JDAxg5Wuc+1RFNmsbN/jCvOUUadP9Dzu+oxM8fHtTYTnLsNspIMu5WlIgeSUKPlJNH5wj4itmCxTZc4Lv/7SU2pfobqjoKcxYNMILSB5LMoZKCqsnkjozUtjxBvvrnBBV1+IByhPqupXB5ggsVPik= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1729510514; c=relaxed/simple; bh=WA/4uKfUsD44pjBCULZxuAlLuwB456I0k5rzgWYSiTE=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=ujMw7puDzK8w+G6/IllYLcsA0t7djI62DUHsOA9fAq6Qcu6c1Tv8f24pGGur/CMbk6EJMUw2v8yL8noxhMtXV6fS13juoRVNLifpnMOe6VfRqEAwt3mcpceRrr26fw9R8DH+EdY2D4GXtwNdVFR0EMTcwo0vrlvuO+Rl1XFo7Mo= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=ew.tq-group.com; spf=pass smtp.mailfrom=ew.tq-group.com; dkim=pass (2048-bit key) header.d=tq-group.com header.i=@tq-group.com header.b=YmIz9YXz; dkim=fail (0-bit key) header.d=ew.tq-group.com header.i=@ew.tq-group.com header.b=hmmdSEaY reason="key not found in DNS"; arc=none smtp.client-ip=93.104.207.81 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=ew.tq-group.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=ew.tq-group.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=tq-group.com header.i=@tq-group.com header.b="YmIz9YXz"; dkim=fail reason="key not found in DNS" (0-bit key) header.d=ew.tq-group.com header.i=@ew.tq-group.com header.b="hmmdSEaY" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=tq-group.com; i=@tq-group.com; q=dns/txt; s=key1; t=1729510512; x=1761046512; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=eER0iIIf1vXWwp4jkMn6PNdl/e0XfRg68y+teb4/R6w=; b=YmIz9YXzbdn6UCtXW3bLSjH8rAsxO+rkbnHKTiXfwjDLcNX+3MA1THgF JpxUNhZ610eTml+RwUaE2FwymjoNkV/psqt7ALLz3MGaKTsCAAUWiMFZR YSKyt+YZliJCCy2+oM5vMhj0Z5byDKrXtsxlnD2omvH92qu7fc3OlX2dG MIvCj+0SBkJBQvA1aKKdUJuLY1Zu1CkLhZkiS2IQOkyOcTMt/CDZ5MN0w JTjgeFd68yRegyS1voBRy2Eb3FKRFUAfNSoWe3pTzRDEXTmaTC+pVoejE 4YTUg7yLxtnGrzhrZ/HldGl2myz4lxp+zsFSOGji61u/rs5mA5p+LrRU5 Q==; X-CSE-ConnectionGUID: Xaen60zNRQG6GBVjetv1zA== X-CSE-MsgGUID: chFPbu+6TkGNrrOBlLRCig== X-IronPort-AV: E=Sophos;i="6.11,220,1725314400"; d="scan'208";a="39572178" Received: from vmailcow01.tq-net.de ([10.150.86.48]) by mx1.tq-group.com with ESMTP; 21 Oct 2024 13:35:10 +0200 X-CheckPoint: {67163C6E-53-21611FC3-DAD22B0C} X-MAIL-CPID: 20F6F9CCED11484797F4B29287C975C4_4 X-Control-Analysis: str=0001.0A682F17.67163C6F.0056,ss=1,re=0.000,recu=0.000,reip=0.000,cl=1,cld=1,fgs=0 Received: from [127.0.0.1] (localhost [127.0.0.1]) by localhost (Mailerdaemon) with ESMTPSA id 871C216B31D; Mon, 21 Oct 2024 13:35:06 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ew.tq-group.com; s=dkim; t=1729510506; h=from:subject:date:message-id:to:cc:mime-version:content-type: content-transfer-encoding:in-reply-to:references; bh=eER0iIIf1vXWwp4jkMn6PNdl/e0XfRg68y+teb4/R6w=; b=hmmdSEaYHt2wbNJD2vs2VrvRzymnBBagwBjpoMkX+FtshORlZvrl1egi70l7Usvstmx3cI by6n0eJiEp1LKwTRfoStN9kckisCriM1C1xIw3RumIf/oFwYVKzUCJJudU2k5sZgcLAcYN /+KDbgbeXXDLYzTGtoROC1y/9alXgWqJy4k76iHDIAByWjY0d154i8734Z67nwyHiJmS7p yFStGjZqKMvSiLTXT505XdcBq/LzZSiUjeMEOanPix+WtT8d1OJ4C+yYdgdt9KfAiO3H0P 0s9CiSGebONeOUx8jvkdFwTheZtPeP990BNpjcVl7IxKXJ9flCUMSO8HrlrvSA== From: Matthias Schiffer To: Lee Jones Cc: linux@ew.tq-group.com, linux-kernel@vger.kernel.org, Gregor Herburger , Matthias Schiffer Subject: [PATCH v5 5/5] mfd: tqmx86: add I2C IRQ support Date: Mon, 21 Oct 2024 13:34:27 +0200 Message-ID: <1d2477439ec2bb7f5145648da4be5dcd8cfb6847.1729509613.git.matthias.schiffer@ew.tq-group.com> X-Mailer: git-send-email 2.46.2 In-Reply-To: References: Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-Last-TLS-Session-Version: TLSv1.3 From: Gregor Herburger The i2c-ocores controller can run in interrupt mode on tqmx86 modules. Add module parameter to allow configuring the IRQ number, similar to the handling of the GPIO IRQ. Signed-off-by: Gregor Herburger Signed-off-by: Matthias Schiffer --- v2: improve module parameter description (was patch 4/4) v3: replace IRQ 0 resource with an empty placeholder to simplify error hand= ling v4: no changes v5: move placeholder to the end of the resource array, use define for index drivers/mfd/tqmx86.c | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/drivers/mfd/tqmx86.c b/drivers/mfd/tqmx86.c index 1fd2212bf492c..94126a484c412 100644 --- a/drivers/mfd/tqmx86.c +++ b/drivers/mfd/tqmx86.c @@ -50,6 +50,7 @@ #define TQMX86_REG_IO_EXT_INT_9 2 #define TQMX86_REG_IO_EXT_INT_12 3 #define TQMX86_REG_IO_EXT_INT_MASK 0x3 +#define TQMX86_REG_IO_EXT_INT_I2C_SHIFT 0 #define TQMX86_REG_IO_EXT_INT_GPIO_SHIFT 4 #define TQMX86_REG_SAUC 0x17 =20 @@ -60,11 +61,18 @@ static uint gpio_irq; module_param(gpio_irq, uint, 0); MODULE_PARM_DESC(gpio_irq, "GPIO IRQ number (valid parameters: 7, 9, 12)"); =20 +static uint i2c_irq; +module_param(i2c_irq, uint, 0); +MODULE_PARM_DESC(i2c_irq, "I2C IRQ number (valid parameters: 7, 9, 12)"); + /* Index of IRQ placeholder in resource list */ #define TQMX86_IRQ_GPIO 1 +#define TQMX86_IRQ_I2C 1 =20 -static const struct resource tqmx_i2c_soft_resources[] =3D { +static struct resource tqmx_i2c_soft_resources[] =3D { DEFINE_RES_IO(TQMX86_IOBASE_I2C, TQMX86_IOSIZE_I2C), + /* Placeholder for IRQ resource - filled in by the probe function */ + [TQMX86_IRQ_I2C] =3D {}, }; =20 static const struct resource tqmx_watchdog_resources[] =3D { @@ -262,6 +270,14 @@ static int tqmx86_probe(struct platform_device *pdev) ocores_platform_data.clock_khz =3D tqmx86_board_id_to_clk_rate(dev, board= _id); =20 if (i2c_det =3D=3D TQMX86_REG_I2C_DETECT_SOFT) { + if (i2c_irq) { + err =3D tqmx86_setup_irq(dev, "I2C", i2c_irq, io_base, + TQMX86_REG_IO_EXT_INT_I2C_SHIFT); + if (!err) + /* Assumes the IRQ resource placeholder is first */ + tqmx_i2c_soft_resources[TQMX86_IRQ_I2C] =3D DEFINE_RES_IRQ(i2c_irq); + } + err =3D devm_mfd_add_devices(dev, PLATFORM_DEVID_NONE, tqmx86_i2c_soft_dev, ARRAY_SIZE(tqmx86_i2c_soft_dev), --=20 TQ-Systems GmbH | M=C3=BChlstra=C3=9Fe 2, Gut Delling | 82229 Seefeld, Germ= any Amtsgericht M=C3=BCnchen, HRB 105018 Gesch=C3=A4ftsf=C3=BChrer: Detlef Schneider, R=C3=BCdiger Stahl, Stefan Sch= neider https://www.tq-group.com/