From nobody Thu Nov 28 09:02:11 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 1DA6C1B4F1A for ; Mon, 4 Nov 2024 11:14:07 +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=1730718851; cv=none; b=opSyB9QTBtkjVDce7MFuWJxYkujMT8uqMI9+6+J+v+2zpM3cmj1slBHKKygNmxVgnuFa1o6RJ1rVByJ1mmEz3V9BshzQESd3oLqyP7dlOauU06gQVwaQ9Z+38FRzX7oiGsqUzRnCeXY8nAQ1yRVZUQ8lLc7EbO64fj2IJXi5bDE= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1730718851; c=relaxed/simple; bh=QJeUvBluegdItMpgUwyoqMVpfqBzO+kuVhCQNc09jRw=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=m1SMHLskrz8SH+uSgRNFQoKa1VpBifhFg8dNlKAcWTIGYer76SbTln1eJrWwuLtRd9TRq087+iny61elBQbnh21ZZFdOPXx5OhSOHZeXn1AnvLO7nnF3q6ww+7eaxOuKZ18wH4nYTRmu0/x3Y98HvclRSYmPYMk7EPxTWliAHnA= 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=VaJDNFhq; dkim=fail (0-bit key) header.d=ew.tq-group.com header.i=@ew.tq-group.com header.b=tnrZODSP 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="VaJDNFhq"; 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="tnrZODSP" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=tq-group.com; i=@tq-group.com; q=dns/txt; s=key1; t=1730718848; x=1762254848; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=D3YWv+Tb4Tb0J6UXqkPRQMhka0vbADfJliqcOUGLvqQ=; b=VaJDNFhqc7U6YHfDISZKDKivHgkp2oUXDAZ4eyokdKgBeINcn+lThNx9 ZzgqdSUlQb6Uga+X+Szmuu1Sj03zUsKR3ZRb/P/eyrN4nW3Bwo7wNGV7S N5NVv7Nlf73d1+wIQXb4a8pLJbRTH+SB4PwAjxSTQiz1nM6l8BBZQDOel Rl6av0OpkylxpuniRcJWgru9n5cbuXWVMCIdfb/giF0Qrtm/1NQAmTBBN 3EmtOpB3eReM5numAd1mu7EIOgJ4ojhRpGJXJ+bn9qHwpUi/u59Oj8c86 1C4/Rs9ktJevmdrNA2AoFIALZyLjWmJdpCn1JjrAGFCJy7Ryb+Ad5d9i7 A==; X-CSE-ConnectionGUID: 0++yl3ECTqiEB+j3E0jjbA== X-CSE-MsgGUID: K/xsdAOmSqC8klYqVy07aQ== X-IronPort-AV: E=Sophos;i="6.11,256,1725314400"; d="scan'208";a="39829939" Received: from vmailcow01.tq-net.de ([10.150.86.48]) by mx1.tq-group.com with ESMTP; 04 Nov 2024 12:14:05 +0100 X-CheckPoint: {6728AC7D-3B-D31EDE1A-D52D6119} X-MAIL-CPID: D9607CFAC80A223701AAEB72C0DB3F49_5 X-Control-Analysis: str=0001.0A682F20.6728AC7E.0012,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 7930E167F00; Mon, 4 Nov 2024 12:14:01 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ew.tq-group.com; s=dkim; t=1730718841; h=from:subject:date:message-id:to:cc:mime-version:content-type: content-transfer-encoding:in-reply-to:references; bh=D3YWv+Tb4Tb0J6UXqkPRQMhka0vbADfJliqcOUGLvqQ=; b=tnrZODSP0cpSb+rs7QsS8ijbk5b1Dm+a+w5Q9ZGMfpm+J9laGwJkFT8c6Xqz1IqGffqbKD Ygq08OArViUvsUGk4ng6lKwn0yh6m8MMiSAHLoJ1DgDLfrWz7+26o0XCqRha4yuj1RnqEK P1SQIMr7p6k0ZH8/3OTDDOXaQtXgMM66NXUADoqRo+3TeW1xaEGEngpgYKvKdI7QOk7QxW so6u+Kub/NaE/0nz6SuuJEV1cDkxKVrVeY55UdMYd0DUwOWBL2Gv/jYu4M9b1zx185Oe96 O7F3oViALC9mh/e/7v4unPnb/+KqLDIwiQ4Mhv7q4Lp8cvOKQA8Tptaz93f1TA== From: Matthias Schiffer To: Lee Jones Cc: linux@ew.tq-group.com, linux-kernel@vger.kernel.org, Matthias Schiffer Subject: [PATCH v6 1/5] mfd: tqmx86: add board definitions for TQMx120UC, TQMx130UC and TQMxE41S Date: Mon, 4 Nov 2024 12:13:29 +0100 Message-ID: <90ddebda96d29246992b58ae0231a511f6424211.1730717841.git.matthias.schiffer@ew.tq-group.com> X-Mailer: git-send-email 2.47.0 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 v6: 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 Thu Nov 28 09:02:11 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 A75721B6539 for ; Mon, 4 Nov 2024 11:14:10 +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=1730718853; cv=none; b=fo2fKCHM7LrXzBd0GxGxEwM0V0WR4e1WhhKgYl6xO6oubh1BciYQY0X247cDLW+SCBZpVtycuKvWoZic/sZ2EkS4xnBMFHLLfi8Q+tjhsds6+Rb2MA3PVIjVZqFbUvkBmogd1XSBo9zj8AaQDx3O32Xmur3Zci1Y9/51CLc8a3Y= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1730718853; c=relaxed/simple; bh=I5W+a2Yq5uNm3qVK3Oy3wkHDAhvR3a9OaEclN8+/0ck=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=SZl1mJdZPxfBh63+56h6XrighcPqWFcKnXWPZqfktGBwiT9ZL0UOxUcKRZHSvbOyV6OLDRPJ/Cma4gBnj9ST25r2W2Fm0YMsViAS9Gtog1e2fb931IqA/3EGOCohKyp8DM3KglfJDPozB25+JdlLKy4xW+HdsaE1z88m4hseIM8= 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=Xy6HNwD7; dkim=fail (0-bit key) header.d=ew.tq-group.com header.i=@ew.tq-group.com header.b=JlAUwXxv 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="Xy6HNwD7"; 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="JlAUwXxv" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=tq-group.com; i=@tq-group.com; q=dns/txt; s=key1; t=1730718850; x=1762254850; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=rKqow/CvlcwE5gBbqhsmlEBb2jOEmT6Pew34oYuS32o=; b=Xy6HNwD7qvsYo69+K9LTO5OFNVUE6wksYQcOv0y+hchE/sXgKJ/u5VM1 4ihZE/xlHIpAuRdHvVOaF5PZWxwKX0VouLmym+D01fEvp/FicVnPoUnDT Jqld7aXEGUQZyeT8dOqb4qul2iaC+TOhp7r1fviaPGiGutVqjwCBtCz+M ixEv3+vKl8aefp6Ydqum0YERhYx7Ez2Lz5r1TZLB3Puz4rak2NVW9qPwn 7YETJ26fujZxSZtUt3PyBr6qIguIcq+/0YnuCYe55n04Q3Wn5kBi0L11b 31zOaffUQM8jEE6pvsjLErWbVVASP7O/a7VtDVMu+eCNrZ9YLH/2PIJtG Q==; X-CSE-ConnectionGUID: 4JUXGrAJSledOWLcLP5WGg== X-CSE-MsgGUID: AeOTjComQ3SmwgQ6tOo2fA== X-IronPort-AV: E=Sophos;i="6.11,256,1725314400"; d="scan'208";a="39829943" Received: from vmailcow01.tq-net.de ([10.150.86.48]) by mx1.tq-group.com with ESMTP; 04 Nov 2024 12:14:10 +0100 X-CheckPoint: {6728AC82-5-5736D786-D50827BE} X-MAIL-CPID: 790D321F476324D40E2C3BCA74ECE8C0_2 X-Control-Analysis: str=0001.0A682F20.6728AC82.0065,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 E120F167F14; Mon, 4 Nov 2024 12:14:05 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ew.tq-group.com; s=dkim; t=1730718846; h=from:subject:date:message-id:to:cc:mime-version:content-type: content-transfer-encoding:in-reply-to:references; bh=rKqow/CvlcwE5gBbqhsmlEBb2jOEmT6Pew34oYuS32o=; b=JlAUwXxvpkE4NqlkWcIRMhxbgpV96NQBGYo/YBE0cRupnshMZsSenz/EMgTIEiNImp+ZXb yIayy3Rszd3uUY7p8qQA+0gH/oW8jtAgfQclLdvQedumSm2+5SH57PByMSeQ1pdqtYmkmW y5nWPj3HrKwG5uV3l+rql2q9KzducdSb2PmH77NTRHkXoAXn1/sPFkQWQC57alxGpLOgNh bijh5ORv4kqlIdOfbm6993AHoUkGcSzYfVeKyojkRPYh+H7uHNdp+M5xxAPnR2hc7D/5sz DwK4ynVcoXpm9a9cS+XrYrmvUS+K1zx+aYsFFPyHJXes9uk5TvRmgRpRhFL1Lw== From: Matthias Schiffer To: Lee Jones Cc: linux@ew.tq-group.com, linux-kernel@vger.kernel.org, Matthias Schiffer Subject: [PATCH v6 2/5] mfd: tqmx86: improve gpio_irq module parameter description Date: Mon, 4 Nov 2024 12:13:30 +0100 Message-ID: <3275f436b66f6807c02256bc852d39b03ebd64d5.1730717841.git.matthias.schiffer@ew.tq-group.com> X-Mailer: git-send-email 2.47.0 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 v6: 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 Thu Nov 28 09:02:11 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 1028A1D5ADC for ; Mon, 4 Nov 2024 11:14:16 +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=1730718859; cv=none; b=oJzNyJYoU9vbvcWaQb84N8NfBTNCgvseVdnThPzt3jvw1KUZ9r6K3bDLO/smK7ZLVLL/tUZY6aJSbdzU/izgXPRo9kZaSo8PUChY6yt7vcU+cPuLRJr/zzNuuxdCZrq4TUAyUoC9lDZiUK6vNsHIQImVNozEwhfFkDiZ3wbj2BI= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1730718859; c=relaxed/simple; bh=rw5E1JB4nC83lqxQB5uqt2dDZtOE0yVDEk+EO/U051k=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=R5cqqsKxbzC79qgv33wZAs8aqXAbQ2w48S/CUXu9VEl6yiAOCOYIHf3VoAMJOFcZFEIUQvhC+WX7GAbpOgfalBVyz3Mtaf7aiG8av9WJvl7VIdyANkPnfckwOxGm6xYRSRHAhu6r86JXw06w73lUfechK6p1bGpFHH/GPe3UJEw= 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=aQrSioLm; dkim=fail (0-bit key) header.d=ew.tq-group.com header.i=@ew.tq-group.com header.b=Ds17FoDA 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="aQrSioLm"; 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="Ds17FoDA" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=tq-group.com; i=@tq-group.com; q=dns/txt; s=key1; t=1730718857; x=1762254857; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=JRajhXc19FFguiO/eykwy5/WHEj90rgmbEAe6gvC+/s=; b=aQrSioLmjX3PngJk0ibj8/L+bdHvk5jlkxRPli0c4nyWfImDSQ55qdGi shKsFHDijC8B8SsLLz10e4mI4yp2MwR3MNJhbdvJGY9rn1r1whaNmNqqA gnBPG2p+9Phu+hF7sNbUrXLKQ6lTS9vZuLqdxFz9GV5MuncInmZX3iAks iI8OkmtmVg9sv8nlWPr5hVc0RsgoD0i4Y3Eg3xHW8IQMFN4jnRtKaDVFj lUkTHDGOGh7FE+lLVUvZiLrS9Wxu7OknN8nub0YA+FnN7EDkWJs9o5vDx 0bLU32r55HC3G5YkQAztzj7Fm2pghdv/m95JfvRWft3bQIFngH023Yuqy Q==; X-CSE-ConnectionGUID: CjdqhJBJTe2trBruytQheQ== X-CSE-MsgGUID: yrlXdFzwTI+corC2gxcDyg== X-IronPort-AV: E=Sophos;i="6.11,256,1725314400"; d="scan'208";a="39829945" Received: from vmailcow01.tq-net.de ([10.150.86.48]) by mx1.tq-group.com with ESMTP; 04 Nov 2024 12:14:14 +0100 X-CheckPoint: {6728AC86-2C-90CD5875-E0265C0B} X-MAIL-CPID: 294B8A3FFA2196C0A0CC6B23B8CE5514_3 X-Control-Analysis: str=0001.0A682F1C.6728AC87.00D2,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 4762416A004; Mon, 4 Nov 2024 12:14:10 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ew.tq-group.com; s=dkim; t=1730718850; h=from:subject:date:message-id:to:cc:mime-version:content-type: content-transfer-encoding:in-reply-to:references; bh=JRajhXc19FFguiO/eykwy5/WHEj90rgmbEAe6gvC+/s=; b=Ds17FoDAy4UWrRM3aUODvZCcM6ce0A/nmynr4keKlnVjj1U1+GbXT0a0Htm/fu9N+q40jh Lze2xw+IC/owofoIPxeP5aHVnKGt/ISIcHekCzl4rPXHa+kS6cpfqfL/2JNhZeYHl3ySKp 5yJmK8aiqrk03LCLsGe/J67btdQV0oGSxCQmb1K+BbjI256odtGdWqhXjXFrllRiTo6FDX 3WkKNFdsAv85hpe0Dk616dwy4/ADaH7248fz7SiW09xKmAW63OHwikrHi6ugBHsrqmVzYu YdYBtCPqihmu3mbv0fgLkP97jk/Z3MWCNlimta+Lk88VwFWJiujB9VtiMJWLmw== From: Matthias Schiffer To: Lee Jones Cc: linux@ew.tq-group.com, linux-kernel@vger.kernel.org, Matthias Schiffer , Gregor Herburger Subject: [PATCH v6 3/5] mfd: tqmx86: refactor GPIO IRQ setup Date: Mon, 4 Nov 2024 12:13:31 +0100 Message-ID: <97f481334f480a113b7076e76f994e0e73ee5aa5.1730717841.git.matthias.schiffer@ew.tq-group.com> X-Mailer: git-send-email 2.47.0 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 v6: 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 Thu Nov 28 09:02:11 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 2DC7D1C9DC8 for ; Mon, 4 Nov 2024 11:14:19 +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=1730718862; cv=none; b=tWfZEiscR51u+d6cNr/659nuBMiDP55LbFIkvmpdKqvSKIhbylXtkvnSESPq8oHbxv1XJnbTzZXESFzB3x07+QdoUjLMcLKUAVmCQlfmPIWS9jhy3M6q4f5p4HuZNG+M1PrBAIyq8x6QYoK9TaMKmN9ofrgFE+NvTg5T6iarU0c= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1730718862; c=relaxed/simple; bh=4tAzpegFAYNwAozXl43wpkwjaMrrBw7LLt69rd9Qeo4=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=h8CgAfSDAgEQHBzRMCQyL7w5ogGGcweNPZLp35Z4qVY2lDWDP590yZ50AVIQH6Kt3F53Q752G7WJThZrVDRmVCvyBnezJIKEywVOepQ2qh9jDuzlgHjpgEE9x+sqntEdInAnyGZNNFsR9PL43esucYhYngyutYdEQxd33wtcKfg= 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=KQsKn14h; dkim=fail (0-bit key) header.d=ew.tq-group.com header.i=@ew.tq-group.com header.b=jIQ2LJiI 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="KQsKn14h"; 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="jIQ2LJiI" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=tq-group.com; i=@tq-group.com; q=dns/txt; s=key1; t=1730718860; x=1762254860; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=Eep/aycY0RWUrLmTc5EgqAHEe/apPKt39IMJFtx8pLk=; b=KQsKn14hTyvrMBfROzWlrgGUYfYjZD2PRlk6kFOQygdV20IqdA8P3g1t lXmGtwSfdLzq2/jJ5ot3wBd2WqScYkq5h6MWzusZJSleuVXYq5DeLctc1 QMOxyj70F185w9tEHwVkmuaxzMrqZUjBvZURk7JYfI4lMK/1LwshlY7HW 4yL2jkWrEKeHRDBrtFJvaacjzDMQ+gl93wM529GlfjtTHF5skRkkzI53Q 36ph4kENfMVGVX1/+MnkR0Cq48jI2pG7gyVAl9+hwdtxeoIIZj2wGjaGu EL4pyHcgvSAWp1TJqfme9000QpYHXsId2qzzS3aCUgYl7kRBqn0N3W7Pi Q==; X-CSE-ConnectionGUID: HAQ7sPJWTB+8S6XmNY0g/w== X-CSE-MsgGUID: ZB9RrZL3Sb2TC8/NFVBGBg== X-Ironport-Invalid-End-Of-Message: True X-IronPort-AV: E=Sophos;i="6.11,256,1725314400"; d="scan'208";a="39829947" Received: from vmailcow01.tq-net.de ([10.150.86.48]) by mx1.tq-group.com with ESMTP; 04 Nov 2024 12:14:19 +0100 X-CheckPoint: {6728AC8B-15-D31EDE1A-D52D6119} X-MAIL-CPID: C96BA6B3B13A4728FC28B61E41D80E5C_5 X-Control-Analysis: str=0001.0A682F15.6728AC8B.0094,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 C02C916A08E; Mon, 4 Nov 2024 12:14:14 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ew.tq-group.com; s=dkim; t=1730718855; h=from:subject:date:message-id:to:cc:mime-version:content-type: content-transfer-encoding:in-reply-to:references; bh=Eep/aycY0RWUrLmTc5EgqAHEe/apPKt39IMJFtx8pLk=; b=jIQ2LJiId5YPLBkX1+yR/cbaWP1PtuFOAiiUTdUfo6ftkfPv0x0/AjDG1bHVJA5/Ey/Nmu z9m52gWwX0EVxfmM335a5H7jWrvZDBRy4BDHjdfOJMRH+RnLvyHcvnA60Ks4t1HYVHsNJ8 N7cPFl1dR9i9WEnFvv7w0Pu1rdHA9GXzB0t+SO5jYrVZ+I6iZimkq/gs64rerLalfHC+Ea QuFPQIX9qKs1R1nB2jjwc8U6KZ3rjkLVKxNivPOXUCSMNfMB/yHOO05NpzRT6zVZje4hZA KYd8Vw5m5s+xIFaH4HMZnoCy+QcbTdt6dAMok4lBO4YcwOtCR1FIaxIiLCL51w== From: Matthias Schiffer To: Lee Jones Cc: linux@ew.tq-group.com, linux-kernel@vger.kernel.org, Matthias Schiffer Subject: [PATCH v6 4/5] mfd: tqmx86: make IRQ setup errors non-fatal Date: Mon, 4 Nov 2024 12:13:32 +0100 Message-ID: <812ca50b33766b1b528a02a8d5226f21822b2851.1730717841.git.matthias.schiffer@ew.tq-group.com> X-Mailer: git-send-email 2.47.0 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 v6: no changes 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 Thu Nov 28 09:02:11 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 4FABE1D63C9 for ; Mon, 4 Nov 2024 11:14:28 +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=1730718871; cv=none; b=jtrBT2fqRtLCcIGct9HbX/CO/urlOEaVBnoqTeriWq7VJ72h1w1shUdpLoKK2PgYLYqqVx+cNPSq6OdfFPnHVVa05fD/7knyHBbP1x8+tVsCm3HCsqjSGf1V16g6vtnGq9cNMGlO3G+y3mnMc0/HoNXv2mULXiwnQdD4cffvcfA= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1730718871; c=relaxed/simple; bh=+beHcLgIUxi1Mim/HpZ7JvNMEbOcqwsEDzqXNpU79HQ=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=gGeMJuY1+wKTaUk03riPWNmWw0cyg0HoxE6UrHAMuyhe7T9FHR74L7brAxcDIKh3osiMg3rIZ75jM3Y7xB+1sXEUeb9o6SmtP13kYuf7KEszDkajf/te1vdZKZ+arPZa9p5a8D8riWe+HLPTszZCuTRruPRCQl8ShG45+tqjuuQ= 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=LgHEW3oB; dkim=fail (0-bit key) header.d=ew.tq-group.com header.i=@ew.tq-group.com header.b=Ff7kdpZj 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="LgHEW3oB"; 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="Ff7kdpZj" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=tq-group.com; i=@tq-group.com; q=dns/txt; s=key1; t=1730718869; x=1762254869; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=w+LOrG+TF2iFIuOL/HdJ+hGmYA88dTXTNReBNAUuqr8=; b=LgHEW3oBEbIYBzk7HtaPlRdzSSyoM+jxE7X7I6WIgFw39hr4pNN04nJ/ NjbXsAiho/0Ykax6n3Ca9hQi7B1yRzeh4eQw2Y308vBpZEl/PCwOtUYCP i7Ur91173Sgb6w6L9EUihWw9SQx8XR95RpQT1OuEsvBBn31199xEDkCaC NxEEDke7xxrCOWqos4obrtEZmdslv4OEm4JYokXwglkqKdveuxLVMyvjY nvuEaS7HI3J/Qaz7+DB3ZFzt7HEbTxlGR4RethRpea1RGWtMjxbFuTK9b eOn1n7wbBCS43h7tmAy1QWWgauWA5VxH6sZjtYMC3b8/ekAqrAdCoHgyf A==; X-CSE-ConnectionGUID: wG47SwRMSA2Dv74JbDAVog== X-CSE-MsgGUID: gSai7tf1RAywTdTMNR2yOg== X-IronPort-AV: E=Sophos;i="6.11,256,1725314400"; d="scan'208";a="39829949" Received: from vmailcow01.tq-net.de ([10.150.86.48]) by mx1.tq-group.com with ESMTP; 04 Nov 2024 12:14:26 +0100 X-CheckPoint: {6728AC8F-11-D31EDE1A-D52D6119} X-MAIL-CPID: BD26B7E974B5E2AC6AA67F8F74B77F4C_5 X-Control-Analysis: str=0001.0A682F19.6728AC93.0058,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 475C116A08F; Mon, 4 Nov 2024 12:14:19 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ew.tq-group.com; s=dkim; t=1730718859; h=from:subject:date:message-id:to:cc:mime-version:content-type: content-transfer-encoding:in-reply-to:references; bh=w+LOrG+TF2iFIuOL/HdJ+hGmYA88dTXTNReBNAUuqr8=; b=Ff7kdpZjaZkt9rZgwIrY9Au9wGoXSPOIlXKHKvlJP7aCoA0dPy4uPCaU+aFN17AEjfdAfi IPgGXBYLPiI4o7xaHy5fBvWQSKc2byunC9lRhSeXjKuHArJbxXz7aFnQs/c2esUxo6ttvk z0N3YcWS8+AGgQHikwq5lB1G1QfAjOMCbBgtqCK6Pym1thFvysaZ8xWFrcB5bmz/DSjz0X PfJpQGYkbhk+Z5bQIa5XV1kIYrddP9KU+kVWf0zksumKJCfT9+abMSmmdyOxG6suSjW8iJ A6b9itREox++YTp1ObdRGuJJgF3DQ13URBst0pQ0praEdfRMXry8uXW5oZeifg== From: Matthias Schiffer To: Lee Jones Cc: linux@ew.tq-group.com, linux-kernel@vger.kernel.org, Gregor Herburger , Matthias Schiffer Subject: [PATCH v6 5/5] mfd: tqmx86: add I2C IRQ support Date: Mon, 4 Nov 2024 12:13:33 +0100 Message-ID: X-Mailer: git-send-email 2.47.0 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. The new code and module parameter refer to the I2C controller as "I2C1", as the TQMx86 PLD actually contains a second I2C controller, for which driver support will be added in the future. 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 v6: - remove obsolete comment - refer to I2C controller as "I2C1" drivers/mfd/tqmx86.c | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/drivers/mfd/tqmx86.c b/drivers/mfd/tqmx86.c index 1fd2212bf492c..7dd971b762578 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_I2C1_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 i2c1_irq; +module_param(i2c1_irq, uint, 0); +MODULE_PARM_DESC(i2c1_irq, "I2C1 IRQ number (valid parameters: 7, 9, 12)"); + /* Index of IRQ placeholder in resource list */ #define TQMX86_IRQ_GPIO 1 +#define TQMX86_IRQ_I2C1 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_I2C1] =3D {}, }; =20 static const struct resource tqmx_watchdog_resources[] =3D { @@ -262,6 +270,13 @@ 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 (i2c1_irq) { + err =3D tqmx86_setup_irq(dev, "I2C1", i2c1_irq, io_base, + TQMX86_REG_IO_EXT_INT_I2C1_SHIFT); + if (!err) + tqmx_i2c_soft_resources[TQMX86_IRQ_I2C1] =3D DEFINE_RES_IRQ(i2c1_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/