Received: by 2002:a05:7412:8d10:b0:f3:1519:9f41 with SMTP id bj16csp1863293rdb; Thu, 7 Dec 2023 10:39:47 -0800 (PST) X-Google-Smtp-Source: AGHT+IEvYvDILOLYCDLsPm8RuCOcxb9pN9ea8dY8xecCmZ0gGxMAcT11xsM82LG7vpRkDRelUY44 X-Received: by 2002:a17:90b:3851:b0:286:59d0:7ff with SMTP id nl17-20020a17090b385100b0028659d007ffmr2551595pjb.21.1701974387363; Thu, 07 Dec 2023 10:39:47 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1701974387; cv=none; d=google.com; s=arc-20160816; b=fxCytPtI1h0v03+aMhpamPchYnB+yjT0Ni2YAcv8PrGmpmvsOiJQTULn85Qz3kXcAm sg74XnTpTkYmqXphywS6n51lKCsiu6XdLTUh7oDhgcLHk+BH9bJbNQM7kIj3/Dqc7il3 8Nb0QlGkR8j9rH5F30KIrQZp/5eErS0s3fGtH1D1vBzsIpZnobIPSRcGWgU4w9t3K0td 7TkOaUGGfos5tda1KurlWP/rX/Faqvlt7/HAJyb7ATdSRaoXVCxCRziSVycc7ZcBed+m uy3FKpLQEdj6beTnrbgsNEYyeDAsTUB+NG8ehejRnHPmp+PRM7E9GwtvKcxJ7UR18fZ1 94jQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from; bh=GEl0nxt8uBLmBHczu0HnU1XRxCN0W9S3cn3sCq4v7+c=; fh=EXgg9YqnApgKKZYhZSosPcHJkz7G44hkaqfseiwxB60=; b=fkA4/n8zuUOYa9PdVFx0omd0Kuh/+1bbwqW3kN2luUlXhX+TqmNAOM4rwglW0b64M5 9psdhY0YX4oC5kM2yKBgGi26LaV/WDy4OSYZFd+E8Y8GMBY8XfpRBVvRWqKntynkONZf OQepkBZjvSi6ZNjcdn+3K7NDnX0I8DxB9M5P3NA4GU3jXYIxPfc/kQpyo6GuC/Ctz3g0 47HuR18TelQ4H/rIQGeWVa7oYfh8P5BmdYIVDo7S3tMEAnKjlF2hTLgyuTmaMOHj2EXK Rb6obrJEGoFBavIpcLiPTqlfSmaAXmJIaFpVHF7U3MAa1lilNeS+q9u6wC4wRR1qcreE tKiQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:2 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=analog.com Return-Path: Received: from agentk.vger.email (agentk.vger.email. [2620:137:e000::3:2]) by mx.google.com with ESMTPS id w8-20020a17090aad4800b002869d259846si1482530pjv.46.2023.12.07.10.39.46 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 07 Dec 2023 10:39:47 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:2 as permitted sender) client-ip=2620:137:e000::3:2; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:2 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=analog.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by agentk.vger.email (Postfix) with ESMTP id 0F57A8026DA8; Thu, 7 Dec 2023 10:39:45 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at agentk.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1443377AbjLGSj1 (ORCPT + 99 others); Thu, 7 Dec 2023 13:39:27 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:52810 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230061AbjLGSj1 (ORCPT ); Thu, 7 Dec 2023 13:39:27 -0500 Received: from mx0a-00128a01.pphosted.com (mx0a-00128a01.pphosted.com [148.163.135.77]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E6F079A; Thu, 7 Dec 2023 10:39:33 -0800 (PST) Received: from pps.filterd (m0167088.ppops.net [127.0.0.1]) by mx0a-00128a01.pphosted.com (8.17.1.24/8.17.1.24) with ESMTP id 3B7Ga6L5023834; Thu, 7 Dec 2023 13:39:14 -0500 Received: from nwd2mta4.analog.com ([137.71.173.58]) by mx0a-00128a01.pphosted.com (PPS) with ESMTPS id 3utd12hkrx-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Thu, 07 Dec 2023 13:39:14 -0500 (EST) Received: from ASHBMBX9.ad.analog.com (ASHBMBX9.ad.analog.com [10.64.17.10]) by nwd2mta4.analog.com (8.14.7/8.14.7) with ESMTP id 3B7IdDDV056299 (version=TLSv1/SSLv3 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=FAIL); Thu, 7 Dec 2023 13:39:13 -0500 Received: from ASHBMBX9.ad.analog.com (10.64.17.10) by ASHBMBX9.ad.analog.com (10.64.17.10) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.986.14; Thu, 7 Dec 2023 13:39:12 -0500 Received: from zeus.spd.analog.com (10.66.68.11) by ashbmbx9.ad.analog.com (10.64.17.10) with Microsoft SMTP Server id 15.2.986.14 via Frontend Transport; Thu, 7 Dec 2023 13:39:12 -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 3B7IcsuA015144; Thu, 7 Dec 2023 13:38:57 -0500 From: Marcelo Schmitt To: , , , , , , , , , , , , CC: , , Subject: [PATCH v3 03/13] iio: adc: ad7091r: Set alert bit in config register Date: Thu, 7 Dec 2023 15:38:53 -0300 Message-ID: X-Mailer: git-send-email 2.30.2 In-Reply-To: References: MIME-Version: 1.0 Content-Transfer-Encoding: 7BIT Content-Type: text/plain; charset=US-ASCII X-ADIRuleOP-NewSCL: Rule Triggered X-Proofpoint-ORIG-GUID: qsdUkKCk4j2_We1zOzYsusrytAYXDDUe X-Proofpoint-GUID: qsdUkKCk4j2_We1zOzYsusrytAYXDDUe 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 lowpriorityscore=0 impostorscore=0 malwarescore=0 mlxlogscore=999 bulkscore=0 suspectscore=0 spamscore=0 mlxscore=0 clxscore=1015 adultscore=0 priorityscore=1501 phishscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.19.0-2311290000 definitions=main-2312070154 X-Spam-Status: No, score=-0.8 required=5.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on agentk.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (agentk.vger.email [0.0.0.0]); Thu, 07 Dec 2023 10:39:45 -0800 (PST) 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 0f192fbecbd4..6056a66d756c 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; + dev_set_drvdata(st->dev, iio_dev); ret = devm_request_threaded_irq(dev, irq, NULL, ad7091r_event_handler, -- 2.42.0