Received: by 2002:a05:7412:8d23:b0:f7:29d7:fb05 with SMTP id bj35csp329078rdb; Sat, 16 Dec 2023 09:47:32 -0800 (PST) X-Google-Smtp-Source: AGHT+IHgILf5xTs9AO32EDHZP5kAhT8TCcgbdvG7acSlqff+plX8LHjm19j/V7lLddeE4TrnMR5z X-Received: by 2002:a0c:d691:0:b0:67a:2431:39de with SMTP id k17-20020a0cd691000000b0067a243139demr14017900qvi.50.1702748851956; Sat, 16 Dec 2023 09:47:31 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1702748851; cv=none; d=google.com; s=arc-20160816; b=m1IZ1k4VYrunX1auFq5qntyWbSviY2W94/sYj5X0+NfBxsr0nQCIv+4IbFVaNnXaDB lxONJCMnaxrnX21lu0YSCAydCV7+17hen9Yp8tPjbr/8Nt1FXki6relP/loXbo39IQD9 FAsaHAi+CA1/qNKDd6gHuF0xMM/Wl/ng8CUsXjabMNSzN8XJOiOrF1iwsW3U7lD6Fdpu bRS/HFJ4Qr805DbAHX8XGSMEchSExKoCb9qeuirI3rr/lHszdMgswL5MiYt+fKbkbSi0 V/ZXPO3FEKsmOkk+DyPf25j6wsP65kwz6ec5uRXk0Au5C4PpVooUEwgFKYolCJkJz7bd K+nQ== ARC-Message-Signature: i=1; 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; bh=Y91VuoxtAwKNd4rQhPOHi3h5QXHk8Zy5yB+wcecO9kQ=; fh=QwEOK/MZnBUTBQAzGwecl0DPfALWXdlHbxPQlQn9VIw=; b=DxUw7/b9fFY2h3ZCaaenp2N95lmBI6P38W2WfH6y340w9hDM3855S9AYdwU7WqyeAO 3kYiiW/AngffF3oLPeGGSWgwdu9wrc2oQIOxRzXeuC16K3dxeijf+wFjcAPiFMhBb4hA mU/xPjdy3fVA4jGPiEe0fVR1K1v+HIVgr75WWUGWjcyvPKvd+lVxCnq5BuVp+cyNvFDz wTc6/O8/flNIAjQs7DqNYJuIcyW5b4nXZ4jzZJCo/G4k/AJ/wePJWIzkg/cRx3fwmCT7 6IkZYHsOP46mMwGPA9O9u22MpJmhD+mLybhK1XD2HZOBTCi1lO4ZPv+syC0S+INy+DRz MyeQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel+bounces-2301-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-2301-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=analog.com Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [147.75.199.223]) by mx.google.com with ESMTPS id k17-20020a05620a415100b0076eeed38118si21448321qko.131.2023.12.16.09.47.31 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 16 Dec 2023 09:47:31 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-2301-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; spf=pass (google.com: domain of linux-kernel+bounces-2301-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-2301-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=analog.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 B21DA1C21929 for ; Sat, 16 Dec 2023 17:47:31 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 9D93730FB5; Sat, 16 Dec 2023 17:47:23 +0000 (UTC) X-Original-To: linux-kernel@vger.kernel.org Received: from mx0b-00128a01.pphosted.com (mx0a-00128a01.pphosted.com [148.163.135.77]) (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 E5DC530F95; Sat, 16 Dec 2023 17:47:21 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=analog.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=analog.com Received: from pps.filterd (m0375855.ppops.net [127.0.0.1]) by mx0b-00128a01.pphosted.com (8.17.1.24/8.17.1.24) with ESMTP id 3BGEYQkf002174; Sat, 16 Dec 2023 12:47:02 -0500 Received: from nwd2mta3.analog.com ([137.71.173.56]) by mx0b-00128a01.pphosted.com (PPS) with ESMTPS id 3v1526spha-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Sat, 16 Dec 2023 12:47:01 -0500 (EST) Received: from ASHBMBX8.ad.analog.com (ASHBMBX8.ad.analog.com [10.64.17.5]) by nwd2mta3.analog.com (8.14.7/8.14.7) with ESMTP id 3BGHl0BA033944 (version=TLSv1/SSLv3 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=FAIL); Sat, 16 Dec 2023 12:47:00 -0500 Received: from ASHBMBX8.ad.analog.com (10.64.17.5) by ASHBMBX8.ad.analog.com (10.64.17.5) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.986.14; Sat, 16 Dec 2023 12:46:59 -0500 Received: from zeus.spd.analog.com (10.66.68.11) by ashbmbx8.ad.analog.com (10.64.17.5) with Microsoft SMTP Server id 15.2.986.14 via Frontend Transport; Sat, 16 Dec 2023 12:46:59 -0500 Received: from work.ad.analog.com (HYB-hERzalRezfV.ad.analog.com [10.65.205.129]) by zeus.spd.analog.com (8.15.1/8.15.1) with ESMTP id 3BGHkdOt015780; Sat, 16 Dec 2023 12:46:42 -0500 From: Marcelo Schmitt To: , , , , , , , , , , , , , CC: , , Subject: [PATCH v4 03/15] iio: adc: ad7091r: Set alert bit in config register Date: Sat, 16 Dec 2023 14:46:37 -0300 Message-ID: X-Mailer: git-send-email 2.30.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-Transfer-Encoding: 8bit Content-Type: text/plain X-ADIRuleOP-NewSCL: Rule Triggered X-Proofpoint-GUID: P6uLodtCuPTUZwLfQoxbu3OtgSMr_GB_ X-Proofpoint-ORIG-GUID: P6uLodtCuPTUZwLfQoxbu3OtgSMr_GB_ X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.272,Aquarius:18.0.997,Hydra:6.0.619,FMLib:17.11.176.26 definitions=2023-12-02_01,2023-11-30_01,2023-05-22_02 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 mlxlogscore=999 priorityscore=1501 phishscore=0 impostorscore=0 lowpriorityscore=0 malwarescore=0 bulkscore=0 suspectscore=0 mlxscore=0 adultscore=0 clxscore=1015 spamscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.19.0-2311290000 definitions=main-2312160137 The ad7091r-base driver sets up an interrupt handler for firing events when inputs are either above or below a certain threshold. However, for the interrupt signal to come from the device it must be configured to enable the ALERT/BUSY/GPO pin to be used as ALERT, which was not being done until now. Enable interrupt signals on the ALERT/BUSY/GPO pin by setting the proper bit in the configuration register. Signed-off-by: Marcelo Schmitt --- drivers/iio/adc/ad7091r-base.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/drivers/iio/adc/ad7091r-base.c b/drivers/iio/adc/ad7091r-base.c index 0e5d3d2e9c98..8aaa854f816f 100644 --- a/drivers/iio/adc/ad7091r-base.c +++ b/drivers/iio/adc/ad7091r-base.c @@ -28,6 +28,7 @@ #define AD7091R_REG_RESULT_CONV_RESULT(x) ((x) & 0xfff) /* AD7091R_REG_CONF */ +#define AD7091R_REG_CONF_ALERT_EN BIT(4) #define AD7091R_REG_CONF_AUTO BIT(8) #define AD7091R_REG_CONF_CMD BIT(10) @@ -232,6 +233,11 @@ int ad7091r_probe(struct device *dev, const char *name, iio_dev->channels = chip_info->channels; if (irq) { + ret = regmap_update_bits(st->map, AD7091R_REG_CONF, + AD7091R_REG_CONF_ALERT_EN, BIT(4)); + if (ret) + return ret; + ret = devm_request_threaded_irq(dev, irq, NULL, ad7091r_event_handler, IRQF_TRIGGER_FALLING | IRQF_ONESHOT, name, iio_dev); -- 2.42.0