From patchwork Tue Dec 10 13:13:48 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Marcus Folkesson X-Patchwork-Id: 13901421 Received: from mail-lj1-f180.google.com (mail-lj1-f180.google.com [209.85.208.180]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 29A251AA1C0; Tue, 10 Dec 2024 13:14:20 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.208.180 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1733836462; cv=none; b=V9cu+bIafObYvAWhPFdfG53ViLXQDz9vLKbjqQ3P/PGtBwCBN/RqPmrlP4TQTFwnkgsqG8x0hwfsjvFv13WWYvABJyPhstYNAbcSLndlEkBcyHMMOMA0hHZggVF6ed04xB2z4oCWzEwzzGf3ezK8u1YikTTpBFqcHwtIEhZJevI= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1733836462; c=relaxed/simple; bh=8p62SIBj9xA9S/s2NGpsuQaZLOVV+vtzKIxOZDeXSy8=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=fYzmSv/hsMjToDku4yd3ijKozsRYlonW9XUAVU8fLVQI0ezx82PyewuK5rzory/yks5+bDd1guDgObYO1UFJRjqKpj7nrMHtfApGo1yaXsMdytDnZp1mD6JLJsqBCWfES7fdMqIiQ6Gp0rFqmsC6KcVJQkEki433lC39o1abm8o= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=OV/JeHZn; arc=none smtp.client-ip=209.85.208.180 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="OV/JeHZn" Received: by mail-lj1-f180.google.com with SMTP id 38308e7fff4ca-2ffd6af012eso59367131fa.2; Tue, 10 Dec 2024 05:14:20 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1733836459; x=1734441259; darn=vger.kernel.org; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:from:to:cc:subject:date:message-id :reply-to; bh=uO2Jsjs/yK61act41gYgzTBxs+CYecIxBDcgFhBolBU=; b=OV/JeHZnwzPRdsjFuW92giYUJZDpeGxI1+yTV3SE9/+vsHZtx0fdXKbmhv9/e3a/vm RSXSm3WBGZ3mElSWTooFhSksPhhq385js056JhZw1xrc0BND6WNLqfW5bQXW4cDT86FX lHysDkw5zzaO7T5JJuiTrSVvliZ0lONykTcD4fDtYPrRIZxOJH/i9lXb/F9iqv2p5813 DUFmcUoUMZCpp2cv7tqr9v2YaobHsIabvWyBk5EKA+70ZSSvbRrqI9ulYS9/xIP7LMxN 41BClbmIYC1M5EDSEdGBzg3ylmlOrPC40K0paH91G33ew2LGIP2MjFRmkgo2QoncrVMU R1PQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1733836459; x=1734441259; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=uO2Jsjs/yK61act41gYgzTBxs+CYecIxBDcgFhBolBU=; b=tq5VnF6C6ar/zeN4sVGaFQQxdcVM/XKUOKgQDBMV9U1t4JP/h1gXWV9u8DXGSUMfXu hgA473PYHttS8o4lgLi4xpY0vbbrw/poiPcLTT8dI3DuFEN3OL2a4eCicXEepl8kRmFu yDpxhWNMBDnNYtxDUX5FpCauavL5XGDIjRTt74AL7EdrAZ5NTnOAjt2Nw30Zjc0KVIYV qRiEvKIgdrS3uAV4ffLs35up1C24h2QD5JmwVxWwGFXE0R/G9XrxQviITNkDfrLvlGIw 9vZLx7BSxdgkhfR1ql+ngCaYFRFSJJ+2HDqhD1bsZSDHzrWWPg1vrxepJf2CG9zfQYap rtbg== X-Forwarded-Encrypted: i=1; AJvYcCUwg1qjvvOGYpSHvhXssgnXSkl66wQgZA96/pR3w68xTEEuKc8C1hwasjzG7yIbp7c4IenI8wDuxQjZxkPhRQ==@vger.kernel.org X-Gm-Message-State: AOJu0YxS0YRvwuCZ8iKvVEFil4fL7pQTO9Bt+38AqPj1zTLQsbQwmFXv Y5CPWsDWtstWRjZf2Rexxy4UxbWLverbcM/dQ61Zd2UvCIhqAtQm X-Gm-Gg: ASbGnctw+DI7/iXaCzNMTktNUIbuhQMSGU2GMF0+m42J4cL8O0CX4Gp9WaT23p+2x+A cZzzQSfurRJlLdPGtnP3NkO1ME+NBi6PuMyBl30FtGHSLvAnE7OXFH6DfCDBVhyWCjGJ6sQKx7G 6G05XkXR3HE69oulF+QYAPqcVK8DsnKJt2LASXztJZSIgO20QtJBmdS+GMjIPkLonjASVa5IunH Jw5xiiN2biquj2wTuzpMzw0/yrUXQw9lPtu/LFSRVvYRYOYsgeNjU/ICYtE2YbVJyd9GUG9rODK /qJgdOSChbbswWTb35o= X-Google-Smtp-Source: AGHT+IHPW4OGzKVFUrU47f9n/ojFWKiH5ctUgroOY+FaaCPw6hcDUS/tjeKcT7USTmzvs75xK0Ve+A== X-Received: by 2002:a05:651c:199e:b0:300:3de4:ff90 with SMTP id 38308e7fff4ca-3022fb3e31fmr14868011fa.5.1733836458979; Tue, 10 Dec 2024 05:14:18 -0800 (PST) Received: from [172.17.0.1] (83-233-6-197.cust.bredband2.com. [83.233.6.197]) by smtp.gmail.com with ESMTPSA id 2adb3069b0e04-53ef5085b8csm1037589e87.3.2024.12.10.05.14.16 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 10 Dec 2024 05:14:17 -0800 (PST) From: Marcus Folkesson Date: Tue, 10 Dec 2024 14:13:48 +0100 Subject: [PATCH 1/2] mfd: da9052: store result from fault_log Precedence: bulk X-Mailing-List: linux-watchdog@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-Id: <20241210-da9052-wdt-v1-1-d026e0158688@gmail.com> References: <20241210-da9052-wdt-v1-0-d026e0158688@gmail.com> In-Reply-To: <20241210-da9052-wdt-v1-0-d026e0158688@gmail.com> To: Support Opensource , Lee Jones , Wim Van Sebroeck , Guenter Roeck Cc: linux-kernel@vger.kernel.org, linux-watchdog@vger.kernel.org, Marcus Folkesson X-Mailer: b4 0.14.2 X-Developer-Signature: v=1; a=openpgp-sha256; l=2844; i=marcus.folkesson@gmail.com; h=from:subject:message-id; bh=8p62SIBj9xA9S/s2NGpsuQaZLOVV+vtzKIxOZDeXSy8=; b=owEBbQKS/ZANAwAIAYiATm9ZXVIyAcsmYgBnWD6ckm7tNqMF/13u8rGlUtpeHAlDA7eQIfSMY ftr0nXHiP6JAjMEAAEIAB0WIQQFUaLotmy1TWTBLGWIgE5vWV1SMgUCZ1g+nAAKCRCIgE5vWV1S MmQfD/4lZ+prQdpVN20LunKlnFiiHSeF6lR5GH7bZNq7s8UNoEd8ncB/zUJaqgnFB8KnV0ObWAb llRz8DgjBEv3DtdoMkEA+xamagPAjUwjnYG+DvLohm1OlplHdzUcGgqdVjvB8+vLKFCej235Js8 sDrr1zt939khUICb9VJ+ZOLQ4JlCZMx86SRW+Txj4vl3VGJWJl2qlVPP70uFA2HH+86N2P3gAYK S0Fe6j61f2MXgip0LAoW+BQgc0TpDEljRHOj5fyT8bejSDTcP3P19ieY05rOdAuNANa9w1OdjFZ eHvtMdgkSUjHcsdRpf69H/sr02Q1CnbelBu5myqjx2/fEhOB28iHVc2fqt79o5epLL/mmI3Ma+x l57iw/gCgl4DFrgXOkhouCVx3WWXP+UJRmh7WfK61trILWhtCtAnSLZGGQxRetTKS+TlQbnU4g5 UDdOfjy39mcBZa1WhsbJ/hZjnY2ROAFqSYGo6+pSNFzGfoGqCOIuI8A4VKn68+zdZSobLEvlFMB StbRP9AKFy023FcehVadHHie4qYpF3pGEWIOgEpqpqshblnPdLnNECy0xGITJoEJPQGaumNTrz4 bnE3MqXvrAjs6Ye3AMZ/nUePPHeGe1Ifg2VcbvBLD20upzOyneeRuj5F4zTo2IbDzcY45XUULYl fJmpZPp66zfq+hw== X-Developer-Key: i=marcus.folkesson@gmail.com; a=openpgp; fpr=AB91D46C7E0F6E6FB2AB640EC0FE25D598F6C127 Other sub-components (da9052-wdt) could use the result to determine reboot cause. Expose the result by make it part of the da9052 structure. Signed-off-by: Marcus Folkesson --- drivers/mfd/da9052-core.c | 26 +++++++++++++------------- include/linux/mfd/da9052/da9052.h | 2 ++ 2 files changed, 15 insertions(+), 13 deletions(-) diff --git a/drivers/mfd/da9052-core.c b/drivers/mfd/da9052-core.c index dc85801b9fa0850fe4dbc351014b7f2981460f02..17baf02b68d60198ff7ec69bf49102423b822d0b 100644 --- a/drivers/mfd/da9052-core.c +++ b/drivers/mfd/da9052-core.c @@ -545,35 +545,35 @@ EXPORT_SYMBOL_GPL(da9052_regmap_config); static int da9052_clear_fault_log(struct da9052 *da9052) { int ret = 0; - int fault_log = 0; + int *fault_log = &da9052->fault_log; - fault_log = da9052_reg_read(da9052, DA9052_FAULTLOG_REG); - if (fault_log < 0) { + *fault_log = da9052_reg_read(da9052, DA9052_FAULTLOG_REG); + if (*fault_log < 0) { dev_err(da9052->dev, - "Cannot read FAULT_LOG %d\n", fault_log); - return fault_log; + "Cannot read FAULT_LOG %d\n", *fault_log); + return *fault_log; } - if (fault_log) { - if (fault_log & DA9052_FAULTLOG_TWDERROR) + if (*fault_log) { + if (*fault_log & DA9052_FAULTLOG_TWDERROR) dev_dbg(da9052->dev, "Fault log entry detected: TWD_ERROR\n"); - if (fault_log & DA9052_FAULTLOG_VDDFAULT) + if (*fault_log & DA9052_FAULTLOG_VDDFAULT) dev_dbg(da9052->dev, "Fault log entry detected: VDD_FAULT\n"); - if (fault_log & DA9052_FAULTLOG_VDDSTART) + if (*fault_log & DA9052_FAULTLOG_VDDSTART) dev_dbg(da9052->dev, "Fault log entry detected: VDD_START\n"); - if (fault_log & DA9052_FAULTLOG_TEMPOVER) + if (*fault_log & DA9052_FAULTLOG_TEMPOVER) dev_dbg(da9052->dev, "Fault log entry detected: TEMP_OVER\n"); - if (fault_log & DA9052_FAULTLOG_KEYSHUT) + if (*fault_log & DA9052_FAULTLOG_KEYSHUT) dev_dbg(da9052->dev, "Fault log entry detected: KEY_SHUT\n"); - if (fault_log & DA9052_FAULTLOG_NSDSET) + if (*fault_log & DA9052_FAULTLOG_NSDSET) dev_dbg(da9052->dev, "Fault log entry detected: nSD_SHUT\n"); - if (fault_log & DA9052_FAULTLOG_WAITSET) + if (*fault_log & DA9052_FAULTLOG_WAITSET) dev_dbg(da9052->dev, "Fault log entry detected: WAIT_SHUT\n"); diff --git a/include/linux/mfd/da9052/da9052.h b/include/linux/mfd/da9052/da9052.h index 76feb3a7066dd4ea2f7768794b8920f67726b211..9cb2fc2938cecf6ddb76da401ae3a098525c380e 100644 --- a/include/linux/mfd/da9052/da9052.h +++ b/include/linux/mfd/da9052/da9052.h @@ -93,6 +93,8 @@ struct da9052 { int chip_irq; + int fault_log; + /* SOC I/O transfer related fixes for DA9052/53 */ int (*fix_io) (struct da9052 *da9052, unsigned char reg); }; From patchwork Tue Dec 10 13:13:49 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Marcus Folkesson X-Patchwork-Id: 13901422 Received: from mail-lf1-f53.google.com (mail-lf1-f53.google.com [209.85.167.53]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 11CE81AA1D9; Tue, 10 Dec 2024 13:14:23 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.167.53 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1733836465; cv=none; b=OgI6jYmjH3tbqBCtPXfZ9WNrxbj1VKYnziIA57AnM3+QWR3pQLz2iudawmUgoPJMgkZI81BnVgxwyLp1jnqTeTTTkwrsmCvbQESuMW8kiRTnzvVcycSm7NGU5dKz7oR37eDKU4TLkc5Ofao0xSOvDd9lpRMa1UyBdkCSHNB4zJI= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1733836465; c=relaxed/simple; bh=I1kMuxalrG1tOiGG0XNUf3MZl+lBoT6EfqxAWJlD0Ko=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=eEHtX3NYSwTjuQ8khxCjtV3qwas/sNci7sfF/9tHs64AdWKVgx9jKFrQQpijkQNksaazumWtyee4kovDVHG5i9mYvJ0IAJM0WAeaykbDwWj/EB2zm9sEfkrRXAOQNd8exTe8Xwq6BAgHEZzV3JBu3VpGN9PV6dauqzkE0kzjX3o= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=KaxNCZeO; arc=none smtp.client-ip=209.85.167.53 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="KaxNCZeO" Received: by mail-lf1-f53.google.com with SMTP id 2adb3069b0e04-53e3a90336eso3179759e87.3; Tue, 10 Dec 2024 05:14:23 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1733836462; x=1734441262; darn=vger.kernel.org; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:from:to:cc:subject:date:message-id :reply-to; bh=3gqpWJBq7pNV+Z5/8wJrRuTCi2gLfz4ysR6a191O5dI=; b=KaxNCZeO3jXn+aMufghiyN7T78dzlSa2G9TynWdPsKZTaV7gB4BXB3qQ0qwiNo0QRu h4MYBcsPtNdrjVrneiopKNdDF1nOOox57Q7WkAB/RsGmV0SSwm1GeS/rz90dr6bIPQG3 xktWCHO3yyD1wEuIzJ+xX2QwZLXAFKCZAsZKt/Rq2VsImmiouXQZ4/hHykJHZTO/M0xA 2y5KtScGEetRpwRcYzID8p3upg65CLhETmmeEV4QO1aX2kY8tXxVmwQd8fkfFFrRikMk Re4MgexidbW9gz9bl98kczoVn745dZwBIePMU4hRDPSUmtnBfR+9sBkksDxSh9ZPAk3x Z1/Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1733836462; x=1734441262; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=3gqpWJBq7pNV+Z5/8wJrRuTCi2gLfz4ysR6a191O5dI=; b=FKh7woazkl3ZeBRMFfPebIc2eBFa2FqzdWXnRRuPYDb3C/iuM/3Q9IWKY70vu43wC+ JbjC7HfEtUXzsk9arnIY9CzrcFwL6NzW/N9xWbMItanyLHNIbTxYYI6ajouibUu1gJHB o+88++Sjz5+uKgrVyrAYfAvbAihuwK7wEvhCOs0e34qD0ymTpeV5/VmsEaHLctIiC/JH xWUbHIvA/PUK8ReIVn070FwcUhs7CcSXep4THIFkj3PcXXZoYhz/X1Mz8M7qnP3nh/Ln 8yO39qmAFayqaMrTtpRysN+GemV50AR5dMLRGw0PPRikrye/B31jEU4olLrkeCFvUtbF BNaQ== X-Forwarded-Encrypted: i=1; AJvYcCXYlx18kKO4BGncqnZxxlqbV3UQ5v99gtwErvC4kb5kf8dcXzI/n4SRiE3EpdXdDo5zCrfLTFqhdGPQnJ0ybw==@vger.kernel.org X-Gm-Message-State: AOJu0Ywj8mL6VTe1jvqesrk3Nr9T37Muj+GfQ5SF1V6Rgp3KCqKF5rDY vo2BeZzrWMz0+7PzTJhQfBgikGVDHj7XXHTzKIm9IVCFvOYmtS5e X-Gm-Gg: ASbGncuBdKx4ztP99pJ1o0xbR9++wGdJqkYuN0h7OVwyjOkKbjvK88w1heEqK2g2L8r ikxrt9xr5p96Ts+ZCDKWAaW4zBKPuJ2/cmJ0MWWJ7bJ81i6zJRy7HAuSpxlqRRVy8moTO+MbpL8 SdetoCJxn+5Tngj68W/rmbm57CAWl22pnMQkVSNJTxZxpYEG/a+J8M91LUoryl9P3pnz/DaM9bx 2fiPjSIaRZNSTdHGOwD1qYAdCkcUSoxZynYHYrajRXdh5qQ8xJUzIB2Oi2pJbYA61jCVvocvQ3F gUpYTat50Xfmk5G/FQQ= X-Google-Smtp-Source: AGHT+IF4PO4VVaM0fiSh4QGDnSFP/uyzaa5O/nzFOYsnJHWVIRUGYWIrfEDhD9ZvlBKFp4cB5F/WZQ== X-Received: by 2002:a05:6512:15a2:b0:540:1abe:d6d2 with SMTP id 2adb3069b0e04-54024107498mr1596626e87.35.1733836462010; Tue, 10 Dec 2024 05:14:22 -0800 (PST) Received: from [172.17.0.1] (83-233-6-197.cust.bredband2.com. [83.233.6.197]) by smtp.gmail.com with ESMTPSA id 2adb3069b0e04-53ef5085b8csm1037589e87.3.2024.12.10.05.14.19 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 10 Dec 2024 05:14:20 -0800 (PST) From: Marcus Folkesson Date: Tue, 10 Dec 2024 14:13:49 +0100 Subject: [PATCH 2/2] watchdog: da9052_wdt: add support for bootstatus bits Precedence: bulk X-Mailing-List: linux-watchdog@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-Id: <20241210-da9052-wdt-v1-2-d026e0158688@gmail.com> References: <20241210-da9052-wdt-v1-0-d026e0158688@gmail.com> In-Reply-To: <20241210-da9052-wdt-v1-0-d026e0158688@gmail.com> To: Support Opensource , Lee Jones , Wim Van Sebroeck , Guenter Roeck Cc: linux-kernel@vger.kernel.org, linux-watchdog@vger.kernel.org, Marcus Folkesson X-Mailer: b4 0.14.2 X-Developer-Signature: v=1; a=openpgp-sha256; l=1485; i=marcus.folkesson@gmail.com; h=from:subject:message-id; bh=I1kMuxalrG1tOiGG0XNUf3MZl+lBoT6EfqxAWJlD0Ko=; b=owEBbQKS/ZANAwAIAYiATm9ZXVIyAcsmYgBnWD6haJoS/1xj8V5EEZL8UpW5m9vxBH5Bw19R0 LfeUHfZpW6JAjMEAAEIAB0WIQQFUaLotmy1TWTBLGWIgE5vWV1SMgUCZ1g+oQAKCRCIgE5vWV1S MhwnD/9Cw40YpimcM/K2QWid9RxQL+W4oeWoF+PxVsRduAkOLkuniNGNo08qgFYTVtHOQ2rTz1a rfpGUx3FTGbe0nskuKnExDwaibK4/VaCpldk7wGiuWx5hjr05zcn/I12gxX7zW3klzZXRGDVGQk C+sdSBMsx4p0LTs91MyF5RotamumgGjc6sp1c+9o/A0EP2gMwi1EFQUQH0CGBaEfudoQ3+slQdI 2lZCZm5rwi/w7672Uf2LUjlhk75BequTnOAfRat1GpzsYzLgEbwdIqZlovk5Nt1xtVjZUP8SLuM hV7FdmqZsqMBBkj6Rin0MR7IC0FJCmArf708hC9YgNw3eU8KXKNrYAWKSmwlmN0Kti3cBg6TRXT ek5+TOGEwXxMPv9bj6oNuh7uRx6XBdsez4SCmV2l6RXq8MxbBKXaYJgei2twnICtXLWNn/biAC8 QJmgXzI1o60EBSC1YQaxAx+/oLIynKoRTOrQUcy9Y1HBdbnYzQQ773G/21ZVlwy5UGTUZ0MA3BS USuHX99qy2SkE7SY4iFXe2Vr5G5zsfkWc7bkDq0aIb41UQTjRMkSpkgu7zj33a6WBNAiUUpTgzn 5OpffbFcvAVkp6Ju0lpGm5Vt0lei5d1PtijmhsOLBguYucO+hjJG6IvIX4b3b98m24bazio2wDz fiNqJ9evMY6ulYA== X-Developer-Key: i=marcus.folkesson@gmail.com; a=openpgp; fpr=AB91D46C7E0F6E6FB2AB640EC0FE25D598F6C127 Enable support for these bootstatus bits: WDIOF_CARDRESET WDIOF_OVERHEAT WDIOF_POWERUNDER Signed-off-by: Marcus Folkesson --- drivers/watchdog/da9052_wdt.c | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/drivers/watchdog/da9052_wdt.c b/drivers/watchdog/da9052_wdt.c index d708c091bf1b1e3327a134d4d2244d4b883d14e4..77039f2f0be54273df1666fe40c413b6c89285a1 100644 --- a/drivers/watchdog/da9052_wdt.c +++ b/drivers/watchdog/da9052_wdt.c @@ -135,7 +135,11 @@ static int da9052_wdt_ping(struct watchdog_device *wdt_dev) } static const struct watchdog_info da9052_wdt_info = { - .options = WDIOF_SETTIMEOUT | WDIOF_KEEPALIVEPING, + .options = WDIOF_SETTIMEOUT | + WDIOF_KEEPALIVEPING | + WDIOF_CARDRESET | + WDIOF_OVERHEAT | + WDIOF_POWERUNDER, .identity = "DA9052 Watchdog", }; @@ -169,6 +173,13 @@ static int da9052_wdt_probe(struct platform_device *pdev) da9052_wdt->parent = dev; watchdog_set_drvdata(da9052_wdt, driver_data); + if (da9052->fault_log & DA9052_FAULTLOG_TWDERROR) + da9052_wdt->bootstatus |= WDIOF_CARDRESET; + if (da9052->fault_log & DA9052_FAULTLOG_TEMPOVER) + da9052_wdt->bootstatus |= WDIOF_OVERHEAT; + if (da9052->fault_log & DA9052_FAULTLOG_VDDFAULT) + da9052_wdt->bootstatus |= WDIOF_POWERUNDER; + ret = da9052_reg_update(da9052, DA9052_CONTROL_D_REG, DA9052_CONTROLD_TWDSCALE, 0); if (ret < 0) {