Received: by 2002:ab2:6d45:0:b0:1fb:d597:ff75 with SMTP id d5csp115295lqr; Wed, 5 Jun 2024 00:05:40 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCXRDiUWIn3eOtKq0EcnjhUhEYinK5L89y5slw6RShnu6ZB1HZA8PYfFlWqz15SL8pGy9pZqaQb3s3xHJypS+N0v3d15jtMF1VEbLm2Nvg== X-Google-Smtp-Source: AGHT+IGybJzHd31IQ2n5tXi9IaciBAawZ2McqeWht3CLTQ8HdeMol7f0E/bnyDLo2/yHBo4PIysS X-Received: by 2002:a05:622a:30b:b0:43f:ee68:a862 with SMTP id d75a77b69052e-4402b6a8219mr17609541cf.61.1717571140619; Wed, 05 Jun 2024 00:05:40 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1717571140; cv=pass; d=google.com; s=arc-20160816; b=WjZDvzo3JIr5JABHz61Ar6YES/+o69eFz6ENRqtDdPwAgjZkpv4dNlsYvFwXx2OADp XA0pp2tsbKkPml2dpPFLUbw7Jdl/zvZ8ihHOQIW3UmGLdwu/5B4JU1tlb22Vnf6CAaKP FFnrfMmG68kYUJ2umCDtsC82JfWXL2XL7g4d+yoz/JfRQepqUUXuyr0J8aanHd9H+ACf U7zkU6E02KD+Wqs7jUpqnOeTGxarmssc7OAmoyPIAyq7zjCrNPzcxiqLiplrET+ij9HX t8EspYAPCo4NLpifautZ2DTKHrbpPV+8gjVY58WbIk/XlTsyaNulK4MMMvdrCj4EGZ/r uW0A== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:in-reply-to:message-id :date:subject:cc:to:from:dkim-signature:dkim-signature; bh=32MmV7Af8SI9o2LQZGI6LZQGXaTSQyqVttjyukn0kuI=; fh=zRvtD0viTvS65deMmSLJHuMGflctGx+8M+0li3tXURQ=; b=Vb2nc/5eOqwi5Doe3oHJvD/4Ios3yy56dq3fZrUhFCX0q9wzBXx7hWkbwAsUDnPPL2 +NlWZBXJ6JYM55WdfWCcP0ZN1tKhGyFLFHSuTWytAHUZ2zIm8bMtsZh1eenz2w5jQa7w uSRjocHSODQ4uLP71ssEbsAKkZVGSWzLO6Od2M3UVNxWfGixXDDlYnBFx+s2twDeK3qd rq67435wgXT3BgfqrT0A5m4NPo2KZUocJtr1gKwyGffhJPckuHJtjD5qBZnspzH31NDO 9D1HrmjZvML8xpxmTHaYPPVdRZnBtwJBdcmCQgV7MkLdD+MLltOXh4Mh6hznlxS2JJwB mmdA==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@tq-group.com header.s=key1 header.b=FlYJqt0h; dkim=temperror (no key for signature) header.i=@ew.tq-group.com header.s=dkim header.b=gl7th0py; arc=pass (i=1 spf=pass spfdomain=ew.tq-group.com dkim=pass dkdomain=tq-group.com dmarc=pass fromdomain=ew.tq-group.com); spf=pass (google.com: domain of linux-kernel+bounces-201835-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-201835-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=tq-group.com Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [147.75.199.223]) by mx.google.com with ESMTPS id d75a77b69052e-4402f8c15e0si5643411cf.74.2024.06.05.00.05.40 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 05 Jun 2024 00:05:40 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-201835-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) client-ip=147.75.199.223; Authentication-Results: mx.google.com; dkim=pass header.i=@tq-group.com header.s=key1 header.b=FlYJqt0h; dkim=temperror (no key for signature) header.i=@ew.tq-group.com header.s=dkim header.b=gl7th0py; arc=pass (i=1 spf=pass spfdomain=ew.tq-group.com dkim=pass dkdomain=tq-group.com dmarc=pass fromdomain=ew.tq-group.com); spf=pass (google.com: domain of linux-kernel+bounces-201835-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-201835-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=tq-group.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ny.mirrors.kernel.org (Postfix) with ESMTPS id 5A0671C249E6 for ; Wed, 5 Jun 2024 07:05:40 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 7D08018F2D9; Wed, 5 Jun 2024 07:04:49 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=tq-group.com header.i=@tq-group.com header.b="FlYJqt0h"; 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="gl7th0py" 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 AD34618C321 for ; Wed, 5 Jun 2024 07:04:46 +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=1717571088; cv=none; b=qzEK5cZJ4AOGnIyecg7cnuzuhndoaR2HaCLYiFyLuU4MFfA8zFw/wYHumXksTGYsI/IqGcvG7Z3e+n6gt7mcL8cAEjFdpWs9PRauLTN6DSfXq81HfzEF5DOMgw6uQvSbDrBSU5vPsgwtBb1NNa1lWeR0+tNpbKQThAGHts0bHas= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717571088; c=relaxed/simple; bh=bX23BzlAIyUwv5XaT5UEHsPZU+heRgXBUj97RkhaTBg=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=CeXWuwrJvOAieIR+GNa/0oslhwf3UjMVEFBxrsfeGXgdNRbjWajLQqsz2iPCu950s7I4Sr4/njI0Nn6p9DXLtE0vzyeeVQlb/XvN2IObsfy0UjvFi9xB68gEbOSMx47kDNVm43fmTBRdiDp5eEoFrziH2a+X6xCghhAtL6uuVqY= 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=FlYJqt0h; dkim=fail (0-bit key) header.d=ew.tq-group.com header.i=@ew.tq-group.com header.b=gl7th0py 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 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=tq-group.com; i=@tq-group.com; q=dns/txt; s=key1; t=1717571086; x=1749107086; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=32MmV7Af8SI9o2LQZGI6LZQGXaTSQyqVttjyukn0kuI=; b=FlYJqt0hpNYQwcFwbVVsJbdU3bRpXPXMshHCSwGOwzzqZ2lmVhKXfQEp rEyjBWFj2YKsXp2tlGf1wegKaNEJ/+c8eYVtgFsu75JOMBFMO28j7F5Kh dvQGqxYqQcXE4UmEpxy2D/bXr+qjaolShD6pVdgp8T/r2dqPYytghXkHL 0GAfQCrI1Jr98S4k8WgvSZfT7NwsEktrDgK5u9UI5b+Sb66lzrpm8aGLN oilTb41KlHP5UJ8JRNVZG3biBabCQnlAPVTRGFykAm1olozK/Y1c8eKWS ofmhGHCVtFfE7LYTxrUZmrwP2h9hQ39Ia6YRmkHWlbgn+oE6PYDjpKSa3 Q==; X-CSE-ConnectionGUID: fTPc0MBpTO250mz0zFOcdg== X-CSE-MsgGUID: abk4GJFOQEO0Pr3fAdHI7w== X-IronPort-AV: E=Sophos;i="6.08,215,1712613600"; d="scan'208";a="37226802" Received: from vmailcow01.tq-net.de ([10.150.86.48]) by mx1.tq-group.com with ESMTP; 05 Jun 2024 09:04:46 +0200 Received: from [127.0.0.1] (localhost [127.0.0.1]) by localhost (Mailerdaemon) with ESMTPSA id E8B9E172D69; Wed, 5 Jun 2024 09:04:41 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ew.tq-group.com; s=dkim; t=1717571082; h=from:subject:date:message-id:to:cc:mime-version:content-type: content-transfer-encoding:in-reply-to:references; bh=32MmV7Af8SI9o2LQZGI6LZQGXaTSQyqVttjyukn0kuI=; b=gl7th0pyr0W5M59+mV6znVnu6ka6fBBLQj94UPN0fYNMTIe51ySs93dVmG1IQUeJJNsJRZ /dIgPEVrar1Z83H+org4dvyuXtmTRN1eGw5kT082WcTZddAvnopvH3Bvz785HT2xaqp24S Q7VESn8B68NgG/8QKNQB8/3vt8wJECdinWXSL1n7HDtJ/EJihWPm2tkP0RcWcsz2jE1aeq ZLC8o7KrEONfL/lYQBEnSOXIo8xKOiFlm/hstPmwN4kxwYl+XIMLkCpInNQIxmn8LSM+Tv MNvy4xLWIXDu8QtACltalkFQWW1bgafnMf3CPRcS/k8cx2D8zyC7fdD8D4cw7w== From: Matthias Schiffer To: Lee Jones Cc: linux-kernel@vger.kernel.org, Gregor Herburger , linux@ew.tq-group.com, Matthias Schiffer Subject: [PATCH 4/4] mfd: tqmx86: add I2C IRQ support Date: Wed, 5 Jun 2024 09:04:03 +0200 Message-ID: <18d0348f2f7b70329e44f7759bad7e6fe231dba0.1717499766.git.matthias.schiffer@ew.tq-group.com> X-Mailer: git-send-email 2.45.1 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: 8bit 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 --- drivers/mfd/tqmx86.c | 20 +++++++++++++++++++- 1 file changed, 19 insertions(+), 1 deletion(-) diff --git a/drivers/mfd/tqmx86.c b/drivers/mfd/tqmx86.c index cf27497245322..b96af7091b6bc 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 @@ -60,7 +61,12 @@ static uint gpio_irq; module_param(gpio_irq, uint, 0); MODULE_PARM_DESC(gpio_irq, "GPIO IRQ number (7, 9, 12)"); -static const struct resource tqmx_i2c_soft_resources[] = { +static uint i2c_irq; +module_param(i2c_irq, uint, 0); +MODULE_PARM_DESC(i2c_irq, "I2C IRQ number (7, 9, 12)"); + +static struct resource tqmx_i2c_soft_resources[] = { + DEFINE_RES_IRQ(0), DEFINE_RES_IO(TQMX86_IOBASE_I2C, TQMX86_IOSIZE_I2C), }; @@ -271,6 +277,18 @@ static int tqmx86_probe(struct platform_device *pdev) ocores_platform_data.clock_khz = tqmx86_board_id_to_clk_rate(dev, board_id); if (i2c_det == TQMX86_REG_I2C_DETECT_SOFT) { + if (i2c_irq) { + err = tqmx86_setup_irq(dev, "I2C", i2c_irq, io_base, + TQMX86_REG_IO_EXT_INT_I2C_SHIFT); + if (err) + i2c_irq = 0; + } + + if (i2c_irq) + tqmx_i2c_soft_resources[0].start = i2c_irq; + else + tqmx_i2c_soft_resources[0].flags = 0; + err = devm_mfd_add_devices(dev, PLATFORM_DEVID_NONE, tqmx86_i2c_soft_dev, ARRAY_SIZE(tqmx86_i2c_soft_dev), -- TQ-Systems GmbH | Mühlstraße 2, Gut Delling | 82229 Seefeld, Germany Amtsgericht München, HRB 105018 Geschäftsführer: Detlef Schneider, Rüdiger Stahl, Stefan Schneider https://www.tq-group.com/