From patchwork Mon Dec 23 13:59:38 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dzmitry Sankouski X-Patchwork-Id: 853114 Received: from mail-ej1-f48.google.com (mail-ej1-f48.google.com [209.85.218.48]) (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 3D28C1F16B; Mon, 23 Dec 2024 13:59:56 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.218.48 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1734962398; cv=none; b=lr7mQwEaGqKEJmMEp9QdZZ8wsMIQ825pOKK2IiQamXK4QaPA3AYiPEtg7uWbA2fIglJtZQVVOAOiZU8hAZtItkrxd8dNIMtqIyBEFu87Zjd8nk7IFsQbGIbUR0PnkIUWSeQCzyFMLn2t6wvj30x/qODYK/S421VBZBlTzDW6Avc= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1734962398; c=relaxed/simple; bh=rXMMoUEBWsz761qBBGBqdbWKIdj1EFYCUeoxnRId9F4=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=u4GuaGLmGkrrX78FRwz9R7Zfz2dFeKNkU0+DnAt9r3k3LXknLLvW0GuppQhLJRsUaryF7cWvQ3dduBlMKscdtLvJxh953VUIG0aA4yjuxHWMsX9ATQPO6Z2aK4qPRMkQMdlocB9Hvpvet2QLT7M4vcMk1t+cHhZoUgSMqNNLKIs= 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=keKU8rvK; arc=none smtp.client-ip=209.85.218.48 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="keKU8rvK" Received: by mail-ej1-f48.google.com with SMTP id a640c23a62f3a-aa543c4db92so510281066b.0; Mon, 23 Dec 2024 05:59:55 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1734962394; x=1735567194; 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=EemsH4Zp9goG/DvipUIIJ+D3oeBJrKh5E5A6/JLDo5M=; b=keKU8rvKGx6nZBMxPFkhjAw9PRYqXl4kVGZ4ldcQfv/dYOqlYZBXrCotSeUmrWoeO7 ndOAGMnyqZ1Sn1OM8gv016M8iBqPTO7La40FX8bFxrKs2ixWoQdKTDZ+BKdBuauxGuMt CASuGGzOVw6sBLYj638jYX/mh+rNo2Ho/OAkpEapsrvMLG4gw9scd7ZAMvck6RQ0+12p 3NgJY8mcDz/uoPHyOtXG9khRoQOgNlvjW8bzHLQtyDhpi0pndKKa9sD08yFsoJoRHZyy 7PGsTjYITXV4Y0+r3T//5dNjaT3NmCNwgh6iQO8hoF75SzNUYm23nB/nGRlJD6BLgAMs aSUA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1734962394; x=1735567194; 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=EemsH4Zp9goG/DvipUIIJ+D3oeBJrKh5E5A6/JLDo5M=; b=Cqw4iSRh/GjReote8xBvHLl7TO2x7i2VJEVLZLwoYtAv78e/Lcj75ThTFcTaltqiiY jcVPcViWNDu4AXWzSCXDp9su5hDfsGsu/mS16ZuRZWfDLsIsqqQxUU3rZsJzoZ291mU1 4M4i3M/inD7qdrw5NyBfBUDzlMzUhU19aCgViPs5/yDAFVD1gRowkaMIbr3oC7L9h2sU sMbvM2LW35lM2o3t4YJbqNxNiKk+gC5TGhTlA3JLGZyO5lFyNa22bOT/VXC2aAOUa8do VO/re6Iv7FrPBTF4+CMIuAH+QTtvGwU6m3zk/KDQGtnO6dl+OpLUvsRW1IeQe5dEsLe2 +QQw== X-Forwarded-Encrypted: i=1; AJvYcCUymDn6R0SzVsvqNfgqOeZykFNfF9sb3+kcZyble206AhCX9FSsjkCx5hkNpf+k85Z0tW6pEzWcLt7kT4mr@vger.kernel.org, AJvYcCVK6PXqyqCuXv6uoQlmd4qhZn4mi1ADe8t6NKTmq4oyMakooDKAKdDG5lNI0pEusM9EORJIU35YozEC@vger.kernel.org, AJvYcCX9I59kIWr+qFFI+3+F2l4O2igmo27ht/nnRD19KvOMzOnZYNGV2wnCxt6dpfWks9B+qYSlRlutPostGQ==@vger.kernel.org, AJvYcCXYI/R2atIHZ80/jTZ9y3GwN4Tyw9/jE4m7FNIlCqL31Lv8aGjuQA3rqECc/+1UyviC4RSwOTJeA/zsCQY=@vger.kernel.org X-Gm-Message-State: AOJu0YwHwi45TO+qXgM/9ZgcqT/kTybcJQaL/oeFSXgvveeaGfmkGbzA DnuOEQQjY5DU6K9CxFEIpeSckkMLAewYhLS/2beOTDEJWE4leG9nhI5rHA== X-Gm-Gg: ASbGncun7r16QhAmZhbqu4V2eXS6wxbXFoFya/+d5oYbcwGguUtwUMn+cBkT4PYeCWn oS2anbKqO9qyw/VEtwQKDBliG3DQuPeYhasYQrDcRQ7QhmTjFhBcW3fBpDX+yO5QQ5m+xbaOVN9 SrxVcc79cyrWQ71hz540Gi6N8Jtn1tMXjkZYaDR9/EF0M3P4sUUq+HHEyK/Ohg4ZfL1+VEOD1QY Lozgk6AG34rtAtgkTwHoYeQpftI4edICUR4XWCtUGfrWM4wzbA+1r8v1U3v6Bym61MySK3N4POT pMsVjz6p8BH9eCkLWveraG2vpg== X-Google-Smtp-Source: AGHT+IF0EbdUr/tJzpVwdi1m5M2HcJk6VLrzISyRN02kI778SSneOk1QaXf9+pybPSYjkL5mVa8DWQ== X-Received: by 2002:a17:907:2d29:b0:aa6:9503:aa73 with SMTP id a640c23a62f3a-aac3378bb24mr1110351566b.51.1734962394159; Mon, 23 Dec 2024 05:59:54 -0800 (PST) Received: from [127.0.1.1] (nat6-minsk-pool-46-53-210-232.telecom.by. [46.53.210.232]) by smtp.googlemail.com with ESMTPSA id 4fb4d7f45d1cf-5d80701ca31sm4911485a12.88.2024.12.23.05.59.52 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 23 Dec 2024 05:59:53 -0800 (PST) From: Dzmitry Sankouski Date: Mon, 23 Dec 2024 16:59:38 +0300 Subject: [PATCH v13 01/10] power: supply: add undervoltage health status property Precedence: bulk X-Mailing-List: linux-leds@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-Id: <20241223-starqltechn_integration_upstream-v13-1-fbc610c70832@gmail.com> References: <20241223-starqltechn_integration_upstream-v13-0-fbc610c70832@gmail.com> In-Reply-To: <20241223-starqltechn_integration_upstream-v13-0-fbc610c70832@gmail.com> To: Sebastian Reichel , Chanwoo Choi , Krzysztof Kozlowski , Lee Jones , Rob Herring , Conor Dooley , Dmitry Torokhov , Pavel Machek , Hans de Goede , Marek Szyprowski , Sebastian Krzyszkowiak , Purism Kernel Team , Krzysztof Kozlowski Cc: linux-pm@vger.kernel.org, linux-kernel@vger.kernel.org, devicetree@vger.kernel.org, linux-input@vger.kernel.org, linux-leds@vger.kernel.org, Dzmitry Sankouski X-Mailer: b4 0.14.0 X-Developer-Signature: v=1; a=ed25519-sha256; t=1734962389; l=2343; i=dsankouski@gmail.com; s=20240619; h=from:subject:message-id; bh=rXMMoUEBWsz761qBBGBqdbWKIdj1EFYCUeoxnRId9F4=; b=R0CTiByOwCpn2ajKwfow2P3ccBfioOfzIcXuNCmHH7ekm6fLRXch7MHrPG65WHKorMHjnXN5D bYo54tmz09fA7ln5bT2IGXBbXhiWpiqcadnK2jD5eHoXKm9OMdydZn0 X-Developer-Key: i=dsankouski@gmail.com; a=ed25519; pk=YJcXFcN1EWrzBYuiE2yi5Mn6WLn6L1H71J+f7X8fMag= Add POWER_SUPPLY_HEALTH_UNDERVOLTAGE status for power supply to report under voltage lockout failures. Signed-off-by: Dzmitry Sankouski --- Changes for v5: - update Documentation/ABI/testing/sysfs-class-power and drivers/power/supply/power_supply_sysfs.c --- Documentation/ABI/testing/sysfs-class-power | 2 +- drivers/power/supply/power_supply_sysfs.c | 1 + include/linux/power_supply.h | 1 + 3 files changed, 3 insertions(+), 1 deletion(-) diff --git a/Documentation/ABI/testing/sysfs-class-power b/Documentation/ABI/testing/sysfs-class-power index cb53dde20a80..2a5c1a09a28f 100644 --- a/Documentation/ABI/testing/sysfs-class-power +++ b/Documentation/ABI/testing/sysfs-class-power @@ -453,7 +453,7 @@ Description: Valid values: "Unknown", "Good", "Overheat", "Dead", - "Over voltage", "Unspecified failure", "Cold", + "Over voltage", "Under voltage", "Unspecified failure", "Cold", "Watchdog timer expire", "Safety timer expire", "Over current", "Calibration required", "Warm", "Cool", "Hot", "No battery" diff --git a/drivers/power/supply/power_supply_sysfs.c b/drivers/power/supply/power_supply_sysfs.c index 9ce5eda24093..edb058c19c9c 100644 --- a/drivers/power/supply/power_supply_sysfs.c +++ b/drivers/power/supply/power_supply_sysfs.c @@ -99,6 +99,7 @@ static const char * const POWER_SUPPLY_HEALTH_TEXT[] = { [POWER_SUPPLY_HEALTH_OVERHEAT] = "Overheat", [POWER_SUPPLY_HEALTH_DEAD] = "Dead", [POWER_SUPPLY_HEALTH_OVERVOLTAGE] = "Over voltage", + [POWER_SUPPLY_HEALTH_UNDERVOLTAGE] = "Under voltage", [POWER_SUPPLY_HEALTH_UNSPEC_FAILURE] = "Unspecified failure", [POWER_SUPPLY_HEALTH_COLD] = "Cold", [POWER_SUPPLY_HEALTH_WATCHDOG_TIMER_EXPIRE] = "Watchdog timer expire", diff --git a/include/linux/power_supply.h b/include/linux/power_supply.h index c3ce9f2b17d4..6ed53b292162 100644 --- a/include/linux/power_supply.h +++ b/include/linux/power_supply.h @@ -60,6 +60,7 @@ enum { POWER_SUPPLY_HEALTH_OVERHEAT, POWER_SUPPLY_HEALTH_DEAD, POWER_SUPPLY_HEALTH_OVERVOLTAGE, + POWER_SUPPLY_HEALTH_UNDERVOLTAGE, POWER_SUPPLY_HEALTH_UNSPEC_FAILURE, POWER_SUPPLY_HEALTH_COLD, POWER_SUPPLY_HEALTH_WATCHDOG_TIMER_EXPIRE, From patchwork Mon Dec 23 13:59:40 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dzmitry Sankouski X-Patchwork-Id: 853113 Received: from mail-ed1-f53.google.com (mail-ed1-f53.google.com [209.85.208.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 A3AD41B3934; Mon, 23 Dec 2024 14:00:01 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.208.53 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1734962403; cv=none; b=NPgutRha8lBhR7uGFIfP/SNn6lCl1FfRPrtqWtceQ7en1xBL2hPpHva7S/VcpxgRKcqSVBIJdrbnjzVvVdd8ynajbj4ToSMIK4eWo7J1I1okgTk0Gtr/GcPdGXc0lnLc7JuHIFr6VEYOb7JAhhErdT+f0tkJlpbi4jo7Z5FScyY= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1734962403; c=relaxed/simple; bh=W3R0sAEsh89KI9k2TtMER4sOCc8bejuu1Gu7C+v3ml0=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=ayuK6Wi7nkDj9jUumS3pR1xDyF4DfNLfZea0muyEB8dIg8pIB55WWnMxu82iaBHGUCiwNEIjdcOC6eR3dGYQLmHla49LQOCBppvaqw8DNJvARat+OfYK+uOT80YN5mJzPJAaiNmGnzp23315Z4XqTaculxJ0W1tRPN/JdUjjZfE= 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=C4RyGF54; arc=none smtp.client-ip=209.85.208.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="C4RyGF54" Received: by mail-ed1-f53.google.com with SMTP id 4fb4d7f45d1cf-5d647d5df90so6923657a12.2; Mon, 23 Dec 2024 06:00:01 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1734962400; x=1735567200; 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=LyNrH/v1nn6Cpsrp8y8ejskaGapYhbwc7aBDhXiWAeU=; b=C4RyGF54ue8KfzxBGyD75NFi1YXF5ZN7J5UyhSl2eyTQaq++bpdH+MUgiEYXjKxeW9 YLbs5XPhA7vkFDY1opOiximLXYzy8o/8PfLuTFDsyzGypEzRJhrPIA5Z8Qximefrjqxa AWahmO9vyRjf+60YqGnfFRWVF6lUqjnag7pYBf/mHm7BuGFsw9DMi/73DkH4TlBnWkUJ fJjCutPByYA5ELpFVzXomc3RHu4k1TvqgapZjhKUliSOcucpvw+Dhl5XBzmzqePuHaeC PAE0oYISF8NTRf0V0lShJ9wsR8hziVOsa8ynJDK+p0w6Ix2H4vqkZouJ2XiugWIVn8P8 cHzg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1734962400; x=1735567200; 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=LyNrH/v1nn6Cpsrp8y8ejskaGapYhbwc7aBDhXiWAeU=; b=RmcOYurzDFRwzGQ9TVMFX+0NrPQRqOAMH+22ZVIPTx6aMW0AwUYs8ocbKGu1XbBRhw n1nyKe7JsAmx6N80aacfM4eu/sBfyMprxBitDxNL5ms+EOTl8FkHTFBAcAo4dIE7pxZv hyw7kLWDsaxdSXzJ0QpSJcYLkj3ZuStmIIVJCw7BNE0bHkuksfkZpNzWbCOH926xMVHb YVPstgcb1WAgobp4i7fEQExODd8wgwFG+xSFZugglP4F+0DDkvlaujc5KzYUeuoG7Jk3 iVF+1mBQANr+mQBpne2bg4XHldCg+pINXjGJitgp/YC/q73PzizsrqKi3VKDiJnLeeyD hAww== X-Forwarded-Encrypted: i=1; AJvYcCUD42q39DYzyfFEC207ttzmj1O+EeWveAptK5q52nm1hf4oj0ekwiBSVTjuKwK3dXIStrq1MSvFGQmsIg==@vger.kernel.org, AJvYcCV+DiNLIO0IXXT9XSn5Xf4jdHADEDhSaYTwDNXynrNGMCJg4vYcGT6f/Q2+lMTYcroS5MOCEeBpLLUpwh8=@vger.kernel.org, AJvYcCVB9gLZa1ELlbMKODZtLglmuNenzvMTwDbr1uzWLr7j5J6POkffZkbikBovKnm9DkB+Zf1cM2ID9o5M@vger.kernel.org, AJvYcCW4hO+rLC3bZ85dGU3T9XJCunBbFrx/8/Fz5zlz1WevmgmyGYPubKHNNldBROy3Y49NUBmukNfHaFwefMbo@vger.kernel.org X-Gm-Message-State: AOJu0Yy6BQStm6VJiFLe2g8+BSo11BoWzMZ58r4NHrU/RxMHd2zs5zqx hfy67tZI5aHl0cxjhsMjkRiq5aQawzv0+DUM5K6OO1NoxPLgpai78kZCWw== X-Gm-Gg: ASbGncuI31DVUnm5kZb2BeBHCuQZpY4emWAiGq9Bpd8Dq7Zrx/FdAWWmAbSi13TTKlJ vqjySs7zI3wcLd99pLAYN2Dk8dKHNwXVxHsmoN0ZytZy5UkQpO47DVmfsEuHffqLitEPmaYLVDV atW7OCyWMHdYyLM+QVIIE7QR9fLmLKtNn0U2IzcljGGDyZrOz5admCI1MuDd9Xvz+ngZiLKSjHe VbsBVwQy1OGlsu5eCn7u9yTWCOo18ECfpDQSEubjOZMDhIr7jICh2wtgeVkPwMtj7QryM1m83Ow g7rkHBjGxfBqZlkUVpzrGQk99Q== X-Google-Smtp-Source: AGHT+IF3EI3aiS8peDHQvCudeSD7IYB3OD6m/HHX6VoBtBuSM4Fb26SypNlJLZ8cqf1R2z5wkXVtaA== X-Received: by 2002:a05:6402:51cf:b0:5d0:d18f:cc64 with SMTP id 4fb4d7f45d1cf-5d81dd64086mr11269286a12.4.1734962399439; Mon, 23 Dec 2024 05:59:59 -0800 (PST) Received: from [127.0.1.1] (nat6-minsk-pool-46-53-210-232.telecom.by. [46.53.210.232]) by smtp.googlemail.com with ESMTPSA id 4fb4d7f45d1cf-5d80701ca31sm4911485a12.88.2024.12.23.05.59.56 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 23 Dec 2024 05:59:58 -0800 (PST) From: Dzmitry Sankouski Date: Mon, 23 Dec 2024 16:59:40 +0300 Subject: [PATCH v13 03/10] dt-bindings: power: supply: add maxim,max77705 charger Precedence: bulk X-Mailing-List: linux-leds@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-Id: <20241223-starqltechn_integration_upstream-v13-3-fbc610c70832@gmail.com> References: <20241223-starqltechn_integration_upstream-v13-0-fbc610c70832@gmail.com> In-Reply-To: <20241223-starqltechn_integration_upstream-v13-0-fbc610c70832@gmail.com> To: Sebastian Reichel , Chanwoo Choi , Krzysztof Kozlowski , Lee Jones , Rob Herring , Conor Dooley , Dmitry Torokhov , Pavel Machek , Hans de Goede , Marek Szyprowski , Sebastian Krzyszkowiak , Purism Kernel Team , Krzysztof Kozlowski Cc: linux-pm@vger.kernel.org, linux-kernel@vger.kernel.org, devicetree@vger.kernel.org, linux-input@vger.kernel.org, linux-leds@vger.kernel.org, Dzmitry Sankouski X-Mailer: b4 0.14.0 X-Developer-Signature: v=1; a=ed25519-sha256; t=1734962389; l=1700; i=dsankouski@gmail.com; s=20240619; h=from:subject:message-id; bh=W3R0sAEsh89KI9k2TtMER4sOCc8bejuu1Gu7C+v3ml0=; b=ZChh0VTDwOaZjm1PVOpEbL/9xASm6oG1B+pqr51srt6I2107IUk1rGinPBLHPGyO21F8obdWo y57PadPDp1jDZyNK+rYwECheWQz3RTddXYdoUbZRz6EsDS0Sr++MtgG X-Developer-Key: i=dsankouski@gmail.com; a=ed25519; pk=YJcXFcN1EWrzBYuiE2yi5Mn6WLn6L1H71J+f7X8fMag= Add maxim,max77705 charger binding. Signed-off-by: Dzmitry Sankouski --- Documentation/devicetree/bindings/power/supply/maxim,max77705.yaml | 50 ++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 50 insertions(+) diff --git a/Documentation/devicetree/bindings/power/supply/maxim,max77705.yaml b/Documentation/devicetree/bindings/power/supply/maxim,max77705.yaml new file mode 100644 index 000000000000..e42dbd48d838 --- /dev/null +++ b/Documentation/devicetree/bindings/power/supply/maxim,max77705.yaml @@ -0,0 +1,50 @@ +# SPDX-License-Identifier: GPL-2.0-only OR BSD-2-Clause +%YAML 1.2 +--- +$id: http://devicetree.org/schemas/power/supply/maxim,max77705.yaml# +$schema: http://devicetree.org/meta-schemas/core.yaml# + +title: Maxim MAX777705 charger + +maintainers: + - Dzmitry Sankouski + +description: | + This is a device tree bindings for charger found in Maxim MAX77705 chip. + +allOf: + - $ref: power-supply.yaml# + +properties: + compatible: + const: maxim,max77705-charger + + interrupts: + maxItems: 1 + + reg: + maxItems: 1 + +required: + - reg + - compatible + - monitored-battery + +unevaluatedProperties: false + +examples: + - | + #include + + i2c { + #address-cells = <1>; + #size-cells = <0>; + + charger@69 { + compatible = "maxim,max77705-charger"; + reg = <0x69>; + monitored-battery = <&battery>; + interrupt-parent = <&pm8998_gpios>; + interrupts = <11 IRQ_TYPE_LEVEL_LOW>; + }; + }; From patchwork Mon Dec 23 13:59:42 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dzmitry Sankouski X-Patchwork-Id: 853112 Received: from mail-ed1-f44.google.com (mail-ed1-f44.google.com [209.85.208.44]) (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 A9EB71AB528; Mon, 23 Dec 2024 14:00:05 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.208.44 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1734962407; cv=none; b=YiISThugCO7WQDLH7CCqgR77Z77hn1NpREHQ0+8eMwt+pixiPH+ts6qs+UTSp0L2aiPlUd65g+drn3ua38srYqn585PA6TBfrF+nLf83WtWHrZboxoMTS3Hg8zIhUSl0oFIZhRYNrkZCfe9m7FM6VISKp0I5ICRnhEYTevblTMQ= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1734962407; c=relaxed/simple; bh=iiRnf4Wt6mhhESchgHXjPJDU1ILplxAAXBKmr7mHB+o=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=tp0EX3Glyivuz6oM/ND51tDFy3qf0uXbSEMLV2PkIMqrS7rhS3oy9iee+FV5128Cs+NlWhf0GVnZTmQge/zE8D710Kv4ygjpIQnjrR7qC1NNqHo4gPGCKHhvg8tm2bZKXTjvHkr3k8I1Xy5s6WIuRqq2M/D5vUtQHvTJY+Gw8jg= 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=b6+9kZNb; arc=none smtp.client-ip=209.85.208.44 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="b6+9kZNb" Received: by mail-ed1-f44.google.com with SMTP id 4fb4d7f45d1cf-5d647d5df90so6923761a12.2; Mon, 23 Dec 2024 06:00:05 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1734962403; x=1735567203; 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=ny34XKwUX+MJKcT29KzUxMJWJuevNw9zT0IEL+SXaPw=; b=b6+9kZNbj00VRJHzFDKKexYsC58KoAUkfDye5yWmIUprC3BU4NF3Jy0E4GcZACOgbU JbGaVPK1nJxG6xOeUV3IWiqIR6G8jOnwOPAfq1BmcyAPubhtYwMTKDJfzjmtVSH+jd+R qug9++vwzBJgC/nzg9agMCnK+DfHquN7Pfrl60UAXwDxNbkbdtSZtOPlYNt6/zyahyxr BBg9D7S6eIBW6d2gblDudMs2ohrdfnZTgj23W5T5pdyCnwAXrRIsMzZF2YfhDj0Zreb/ udLjj5kKRRuMwe541urWdYiTVXgB2DQ9zW1xcN8mn5mtwmAnMMTcvoXJLr0aV604+xii mSzw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1734962403; x=1735567203; 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=ny34XKwUX+MJKcT29KzUxMJWJuevNw9zT0IEL+SXaPw=; b=g3euoXxw7tPa/kz2YxPkX9m1WxJ0CmIdMd01r03O81N1aVdPuS5SkPpoNhAFo3pjiH guS3v7ZTvHvmrisRZRTsb0kWlFXeuN07Mo1/UmoxlSQMX7k6pkTSjCsOLwhg5YaRHEg3 QtbqsFHHKCXyYWUtVDfzTAYO6VdRFlOGBponjwafJEBYseDYoe0LGYGeetAAV4WEoxK1 NeeIzzSSpJCR7RESuiyZVeRSWv3kCL4hWqA3UTgcmEWgzpyNU4O0P2Pv/PmAHWmm52zf /v++EADlDA1GeldoA6e2ec2PzKSHCgZU29LV9x7BwDyS2WZEO00DolUfqh6804nQuP7a lpsQ== X-Forwarded-Encrypted: i=1; AJvYcCUA5Tv7kqNv9PktDGiLYD4rxNU2pdFkD/Pcxp9u8chjFUEe89mlVo7YJusXAEOGfeHJj1TPAiCbQOkvqA==@vger.kernel.org, AJvYcCVmN/emcZSw3fZNAEgmkD78He5c3FZ9CofXG33Bl3rd4j5zhLyQICwSMjK5P2HmkgtKi3Mi5hSeB7dylFU=@vger.kernel.org, AJvYcCWXR/mhBS0zaUt++qo6FjJ/YCpA5/qPFgmaytzs0sQJxxjhWIdXs1AcYGy6GrrZKFytjL84RuBDzWb4@vger.kernel.org, AJvYcCWyahWQDA1L0W2S1igin/LHvqWQJLB+UZghqe1ojnNs884pegGnY44YxoZIgzxMCYWPvO7mGK1vl7Kjb5mm@vger.kernel.org X-Gm-Message-State: AOJu0YwA7QFWYARtT9EoY8HOjRr6wjK9MS1Bccxm/W63DJSl11u94ZE1 DnyE9henSNY5MlUnk3QiQK3s0EfAGVkJb7Lx/Bamc2bEvGBj1pAYn85+SA== X-Gm-Gg: ASbGncsmPHJil0UBp6HC31Bgub7XD64GKBPLT455Oceb9RSS6U4eE1p2SafAr5PNlX1 cQHdMNJ6yxREe7tRji3wPUH+12YnnbFjeoWMcVkAK6DgZjUfPS/HqL2bLMa50/Hf1khdajTfg3R TEFf7dzxxTlILlELFDUyCNbVNhq0oFKsqjO3YNTrEq+KVl8rRRpSWuVK3E2u6zKJ921UkqmgO5v jGRHHYPurdVXwhyP4TU9LYDOGctDv14FulM5YtvFuIimWxp6Jn1isXjAtwc5Wrx18yEejO1XAvh nu7u57fnDDl0rA6PG93lexDzjQ== X-Google-Smtp-Source: AGHT+IGpn5wHrBJunR1KMzyucrBTjlRpbJha9jZ1iPfl8wogGhhi4lxWlgScM2CfhFfDWR4udtEPYA== X-Received: by 2002:a05:6402:2344:b0:5d0:e410:468b with SMTP id 4fb4d7f45d1cf-5d81dd64032mr9926960a12.2.1734962403472; Mon, 23 Dec 2024 06:00:03 -0800 (PST) Received: from [127.0.1.1] (nat6-minsk-pool-46-53-210-232.telecom.by. [46.53.210.232]) by smtp.googlemail.com with ESMTPSA id 4fb4d7f45d1cf-5d80701ca31sm4911485a12.88.2024.12.23.06.00.01 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 23 Dec 2024 06:00:03 -0800 (PST) From: Dzmitry Sankouski Date: Mon, 23 Dec 2024 16:59:42 +0300 Subject: [PATCH v13 05/10] power: supply: max17042: add max77705 fuel gauge support Precedence: bulk X-Mailing-List: linux-leds@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-Id: <20241223-starqltechn_integration_upstream-v13-5-fbc610c70832@gmail.com> References: <20241223-starqltechn_integration_upstream-v13-0-fbc610c70832@gmail.com> In-Reply-To: <20241223-starqltechn_integration_upstream-v13-0-fbc610c70832@gmail.com> To: Sebastian Reichel , Chanwoo Choi , Krzysztof Kozlowski , Lee Jones , Rob Herring , Conor Dooley , Dmitry Torokhov , Pavel Machek , Hans de Goede , Marek Szyprowski , Sebastian Krzyszkowiak , Purism Kernel Team , Krzysztof Kozlowski Cc: linux-pm@vger.kernel.org, linux-kernel@vger.kernel.org, devicetree@vger.kernel.org, linux-input@vger.kernel.org, linux-leds@vger.kernel.org, Dzmitry Sankouski X-Mailer: b4 0.14.0 X-Developer-Signature: v=1; a=ed25519-sha256; t=1734962389; l=1366; i=dsankouski@gmail.com; s=20240619; h=from:subject:message-id; bh=iiRnf4Wt6mhhESchgHXjPJDU1ILplxAAXBKmr7mHB+o=; b=R4Hatde9fNd2nAj2joX9Unc4pmaSd8KkOnjVS/EwE3gEKrZHiv97Dteh0FTGnDrZ800oS0HZE nn3ers4mzZqD2KqkXRyIhtDFE1PzGevSveIQybwdycA9XUPFkLSZmzp X-Developer-Key: i=dsankouski@gmail.com; a=ed25519; pk=YJcXFcN1EWrzBYuiE2yi5Mn6WLn6L1H71J+f7X8fMag= Add max77705 fuel gauge support. Signed-off-by: Dzmitry Sankouski --- Changes in v12: - add only to platform version IDs Changes in v11: - add device type to compatible Changes in v10: - keep alphabetical order --- drivers/power/supply/max17042_battery.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/drivers/power/supply/max17042_battery.c b/drivers/power/supply/max17042_battery.c index 4037843e25bb..655b3f25dbd7 100644 --- a/drivers/power/supply/max17042_battery.c +++ b/drivers/power/supply/max17042_battery.c @@ -1234,6 +1234,8 @@ static const struct of_device_id max17042_dt_match[] __used = { .data = (void *) MAXIM_DEVICE_TYPE_MAX17050 }, { .compatible = "maxim,max17055", .data = (void *) MAXIM_DEVICE_TYPE_MAX17055 }, + { .compatible = "maxim,max77705-battery", + .data = (void *) MAXIM_DEVICE_TYPE_MAX17047 }, { .compatible = "maxim,max77849-battery", .data = (void *) MAXIM_DEVICE_TYPE_MAX17047 }, { }, @@ -1256,6 +1258,7 @@ static const struct platform_device_id max17042_platform_id[] = { { "max17047", MAXIM_DEVICE_TYPE_MAX17047 }, { "max17050", MAXIM_DEVICE_TYPE_MAX17050 }, { "max17055", MAXIM_DEVICE_TYPE_MAX17055 }, + { "max77705-battery", MAXIM_DEVICE_TYPE_MAX17047 }, { "max77849-battery", MAXIM_DEVICE_TYPE_MAX17047 }, { } }; From patchwork Mon Dec 23 13:59:44 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dzmitry Sankouski X-Patchwork-Id: 853111 Received: from mail-ed1-f45.google.com (mail-ed1-f45.google.com [209.85.208.45]) (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 4E8651BD000; Mon, 23 Dec 2024 14:00:10 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.208.45 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1734962412; cv=none; b=G54DejTeiQfiDUcxoU93sEcOf9NCbF/YDSBUbgHhEZ+MQ5vC5lL5guGqY9bwjqRHucyKW5avLpgu3Kbt6WtxXu4V93zL97uwxkIaMZhJpfZPEGezIo4rU60+vFOCqUi13tCnoIomQmpar8ktu7oWFI/mxQwgn/nLCW1+h1pyRTM= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1734962412; c=relaxed/simple; bh=I7mtjfCVJ1O2Vg6443qyW0B5WFDFjRpanCU/ThHHH0E=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=X+1QZICxcPmH/yIC0SR/9RrdIbcVCMWz+7/GS13lPIeBqBgC3dhRM9fk4BHd1slKMYGGbzsD/6ldBF9lBc+NiTa6h9rvSt3j033am5yzpBT6hInBEC/2hAa7n/nFrsYDGedpn2McixQhCorMvK2vNAGvcqWePGNicEvWck2l5Vw= 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=CRBLigh3; arc=none smtp.client-ip=209.85.208.45 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="CRBLigh3" Received: by mail-ed1-f45.google.com with SMTP id 4fb4d7f45d1cf-5d3d14336f0so887388a12.3; Mon, 23 Dec 2024 06:00:10 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1734962408; x=1735567208; 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=QAsrsTp1vVx4HKavdMezqlK1BcLoKSQ4OHEn1+GzS2A=; b=CRBLigh3Yg7vdvpXNvr7+E0tG3EmZ3Uc6V4uhsyUPsQpDDzT0OEnEh604rQYygMCz4 GUr1o9G6AIDJZUE9kCBr+mUtCUOCHK3qDuYwuj4pM4CYRGlQ3rKpW/dpXSopEnrUNTTC ADdpBj0iTE+Vsqb8Q41y3xhvkLoouXj5y7+4A0DTJG+1KRkZZjdoCvbibf7Lynctn+tV fUWQ928j9npAG2G0oViMfRg9yqqVbhkl1cW+s+n62nH5RTGEzbl4f5IrOoLP1dajVQiK Lp0YYJOCw054HGRWQ8fJ+fEZOgg233ObqIcEIc3lD0XxHeeoQ3twsHzo+mWvSiGmKS1W nIRA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1734962408; x=1735567208; 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=QAsrsTp1vVx4HKavdMezqlK1BcLoKSQ4OHEn1+GzS2A=; b=gWcLwos07uq4xnugpzI/xsqx247SfwSHIFfF1pDpSfrKCPlU6t7G35kAo1RqBxNl+J aCJnlVmwfoRQChPiPJrlGzLF8yDx5odFM1/bDcowfQT41AEllGxHSAc8rZJo2zlJmwS3 6aAqSiAKt3apcFoYL+VCnXaZaxZP0ToQqrqTDynFfRFiUpmR7RU7TluAO1NPqvNiZOEc 8yvsVquCFD/K80WySF3anRZqLG0pI3D424ihwkK6ZVe4xZbS/zqfdmmlr+onTN6AMz9G DxobYqWyEVb4jP6KUGk+py5egVY+Ap/tVVZmFMubiqpuB3D0lzVwa/gagCOQHi7G+HwR TCfg== X-Forwarded-Encrypted: i=1; AJvYcCV57rqFjaxr5Sb5oO6zEg8eiXZ97OwZqDiAnc9p5gSBanYo+3d4DCo5bZv0imD8tbimVUrmb+RoGiSRxw==@vger.kernel.org, AJvYcCVK6Bqvtc3Vx3y2Hu1aP85hDi10Vn3OSL8nYAaYjpdV/HKnNwWo9brC94Q0gvHC/IJQmH3Lvks3J5iX@vger.kernel.org, AJvYcCVzlvI2YgyanvF73dq5UFLiwWDe7hx7Q0qgyFIjGu/rucX9/S0zXtdvLvpzm8fhop4HUwNyQNHvzUtc22Q6@vger.kernel.org, AJvYcCXCsTvjUCjAu/TXbENMkcnDzn9Ybexa2u4WdoHB68bwKcsNMBJa5OgzCfRlYpVAtV2+6qBCa3LXdajwcBU=@vger.kernel.org X-Gm-Message-State: AOJu0Yx9lsA2pgxSrlJX34uUcA5U66yqfXMqH5hAF+Nf7ELMJHZ0N5Fd af7MjFvB7sEh+kkhCAge9X4sZnM+6r9mhxdQVvi6tK4UzPVG9aNR1Jg4mg== X-Gm-Gg: ASbGnctRn7y7h+ZLQBBEqaUb7KvAiOpEz78S4iSNI4AFDuZVTknhpGbCySFxRAb/QEz 0vsEJNAckgpJb3EICk5igf1x7R9/sDeuvNhG/BCRPsUjXf7FRsTlSICg+ffsBx1xreyORVPM9H7 8iiMbFfEIZsvF+kXrrJcEnIssWUgdioUKnG6JJ/TwyE7EpgI3ZYNFOvTVIFABTkDBrzPswbJYxJ QDXRPnNUN3QdQ9rcPQhJIYSWu7yM/WOG0r+F6EAzuRXItf+Nt6PqKn6Lfpc5UP8iiWaloTqg6tk b7WF+57Szc7rR3Tvh7qWt24r+g== X-Google-Smtp-Source: AGHT+IGkX2twjYykPfvrcevPR5SmL9ufGNABslDrIHQ3V0lMHPJD3pH/auJVtXptIdL4bIYPQe+pOg== X-Received: by 2002:a05:6402:270d:b0:5d1:2652:42ba with SMTP id 4fb4d7f45d1cf-5d81dd9a22amr11538622a12.16.1734962408175; Mon, 23 Dec 2024 06:00:08 -0800 (PST) Received: from [127.0.1.1] (nat6-minsk-pool-46-53-210-232.telecom.by. [46.53.210.232]) by smtp.googlemail.com with ESMTPSA id 4fb4d7f45d1cf-5d80701ca31sm4911485a12.88.2024.12.23.06.00.05 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 23 Dec 2024 06:00:07 -0800 (PST) From: Dzmitry Sankouski Date: Mon, 23 Dec 2024 16:59:44 +0300 Subject: [PATCH v13 07/10] mfd: simple-mfd-i2c: Add MAX77705 support Precedence: bulk X-Mailing-List: linux-leds@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-Id: <20241223-starqltechn_integration_upstream-v13-7-fbc610c70832@gmail.com> References: <20241223-starqltechn_integration_upstream-v13-0-fbc610c70832@gmail.com> In-Reply-To: <20241223-starqltechn_integration_upstream-v13-0-fbc610c70832@gmail.com> To: Sebastian Reichel , Chanwoo Choi , Krzysztof Kozlowski , Lee Jones , Rob Herring , Conor Dooley , Dmitry Torokhov , Pavel Machek , Hans de Goede , Marek Szyprowski , Sebastian Krzyszkowiak , Purism Kernel Team , Krzysztof Kozlowski Cc: linux-pm@vger.kernel.org, linux-kernel@vger.kernel.org, devicetree@vger.kernel.org, linux-input@vger.kernel.org, linux-leds@vger.kernel.org, Dzmitry Sankouski X-Mailer: b4 0.14.0 X-Developer-Signature: v=1; a=ed25519-sha256; t=1734962389; l=1436; i=dsankouski@gmail.com; s=20240619; h=from:subject:message-id; bh=I7mtjfCVJ1O2Vg6443qyW0B5WFDFjRpanCU/ThHHH0E=; b=F62UIeWI7IWnW8geVb+Negvf0pgv3ZePjOicrYlLicIi/pJdoe2BXXt77hd90QPoRrzRo+O3M ogs5lq+ur8WCZ+kNUTS3KU4kY+je6r6gv93jatMMFVCy2AWSLNZ7EPM X-Developer-Key: i=dsankouski@gmail.com; a=ed25519; pk=YJcXFcN1EWrzBYuiE2yi5Mn6WLn6L1H71J+f7X8fMag= Add MAX77705 support - fuel gauge and hwmon devices. Hwmon provides charger input and system bus measurements. Signed-off-by: Dzmitry Sankouski --- Changes in v13: - remove compatible from cells - change mfd compatible to match max77705 fuel gauge node --- drivers/mfd/simple-mfd-i2c.c | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/drivers/mfd/simple-mfd-i2c.c b/drivers/mfd/simple-mfd-i2c.c index 6eda79533208..22159913bea0 100644 --- a/drivers/mfd/simple-mfd-i2c.c +++ b/drivers/mfd/simple-mfd-i2c.c @@ -83,11 +83,22 @@ static const struct simple_mfd_data maxim_max5970 = { .mfd_cell_size = ARRAY_SIZE(max5970_cells), }; +static const struct mfd_cell max77705_sensor_cells[] = { + { .name = "max77705-battery" }, + { .name = "max77705-hwmon", }, +}; + +static const struct simple_mfd_data maxim_mon_max77705 = { + .mfd_cell = max77705_sensor_cells, + .mfd_cell_size = ARRAY_SIZE(max77705_sensor_cells), +}; + static const struct of_device_id simple_mfd_i2c_of_match[] = { { .compatible = "kontron,sl28cpld" }, { .compatible = "silergy,sy7636a", .data = &silergy_sy7636a}, { .compatible = "maxim,max5970", .data = &maxim_max5970}, { .compatible = "maxim,max5978", .data = &maxim_max5970}, + { .compatible = "maxim,max77705-battery", .data = &maxim_mon_max77705}, {} }; MODULE_DEVICE_TABLE(of, simple_mfd_i2c_of_match); From patchwork Mon Dec 23 13:59:46 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dzmitry Sankouski X-Patchwork-Id: 853110 Received: from mail-ed1-f52.google.com (mail-ed1-f52.google.com [209.85.208.52]) (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 2B1381C1F29; Mon, 23 Dec 2024 14:00:14 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.208.52 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1734962417; cv=none; b=mzYGy6g3qwJBBGY33HdPs0KeddU7qrp9twgEDFUEJdnKGXkwyOYuk//6Z9eo9y1D9DSak5z4YUSPBNK4RqCS/OQdA8EcIEAIAITsYqugoFlRHtmnx44AWwXgrPpOX5nkPDoCucNeKr+vKu2f0qcq/LZGPl52hZfUi/G8rGIeDwQ= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1734962417; c=relaxed/simple; bh=8tiL9gYxosgDGJy5CegOZ2k8C1ERDVZ0anDBBusV6lo=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=BCSZcVmUNzK6k1SbsA4SaL0+VwvU8DIH0cCMgikWcnaTtgDS04CkBfkoNb3Y4+rgKFzrpLd4vY8DWcLj/cuKH80UeETij5Y3Qt+P9SaoSaJa7EHoeX96c5hm4LKm44Vg5CQUeEbNBXMTJ25+b64TnUR2wd6mL5BFACuIweZtbt4= 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=kor+upiB; arc=none smtp.client-ip=209.85.208.52 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="kor+upiB" Received: by mail-ed1-f52.google.com with SMTP id 4fb4d7f45d1cf-5d3ecae02beso5040408a12.0; Mon, 23 Dec 2024 06:00:14 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1734962413; x=1735567213; 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=AFNHeHsI4W8KDDXKoBZPMpG1EACtJr6dX29X+XrkhzM=; b=kor+upiBFjDTTH8aYLvxxHFjBCGiZBnQGLsoegs+wWIi8UG8o1oCow8IjrQnE8NPI+ FWzOnTBWS8BaK8Ilo60mjU1VCr+yskSjESxnGLu43VrmlmrFqFYBKhkuL0k45nW3lWhg +oWML3aPsoNfOQwrTjElKfZTXPtGhZeNPzPRiktoqkxcv6am5bbOMWn69LCFKm6yp3f/ VDwbXvgYDETKCOrH5aI2xtZU90Oo3zEziRpkQnlx5Dc75QX4iy5G+9mjZfIclHChIJTN C07ajB4tNGVWf8FSglCyIGj2gqqm+ofzV1T+T1sK0EviKowOrUehZB6qicFdbahjU8av +nFA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1734962413; x=1735567213; 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=AFNHeHsI4W8KDDXKoBZPMpG1EACtJr6dX29X+XrkhzM=; b=ApiYoCUE3MIUWrKI+doVUHmJzbWQOKEScAQ0x+DJXwbZzasVRPFgXdyvhuKvA6KX0g SQXfL89bk564EIpdPjVqSykM43wSjqHVr17iO/RCTynNvSo+nJ2WjYPs8vwoshpJhGS/ 1TGvcSkdi/jAgogsUl/NN7WgM4+9QXVfAH7Oc7ZJ05t0oIfgXTBWU6SttZtpi4kZhWOQ aFalaROguWThGMSl6DeuFG6t9GaoukPoRpT37Wklk9gpk91CdAxRicJpWEzqwr8hmrFK HzMmxw0rzi3lNsoUqETTpZvReZ6EpFWjIZmZvUKe1/elTMnfSEbLH7iidow7ch/zNkWb l91Q== X-Forwarded-Encrypted: i=1; AJvYcCV4KenF1O1yvVkNrgvONhuHxw8tN3O+ktYx3JIJs40i2M+qJLrcEcSfx0syX6difJdHwjGZgUGxAKKd@vger.kernel.org, AJvYcCV67yOiv3c5C9Z9FAsD8pTjhJGx3VhxyhfSMq3YdZRFaerRBAA2IwJHSx9X3LHDo/u/H4kFbxN7eXuZFt8=@vger.kernel.org, AJvYcCWO+Rvu2wUFdoxnre0vfXTf7D6Cb286dG0kOmswH+cIbX7OLyn8X5NMU0tieC2oZzViqfAa4R+O9ctD3g==@vger.kernel.org, AJvYcCXxmCevms1ADEbCOrRtiuja1Squ0s3TCawwFFfBGJ9v+Iik7c1CwV57f2MaWTtyk9HIbb1ZXRB/DqV5ROLg@vger.kernel.org X-Gm-Message-State: AOJu0Yz7UmyXfu+u0aSPBoulEpS3MiIHvzgWQefmMrZH54LyMVfciFgV WzQK/cx/sQDf52RuzZWCr3WanBZUoI91SnCtxKhEwO6QE36UImIVvGWFsA== X-Gm-Gg: ASbGncsH/1QCvHewCw9O6pm5lTDJo/7i3R9RMk4nFoezf0OVEpWggK6gKeAaUdjUtX1 leNtPE73eHc3KEEGpqX39yeKiSJ02CF602GcgJsTVrKtV7SM3CG4vI0TJHEOp1IH7MGmFKvkNXm +5eOtQcvdqxQc6lMHd3y9oYI+IdTryY0AD4/O4i5Ua22IDNppKvAzJ2Rgt/4tdeGP5uLI+mK8Lv NPVYDsmeuZ1vL3lKG5VHUhFCivby22gw8LdFlF7C2eJce5EIdYDoLKNkMtp5uuVd6S6NW5l/2fj 6VUAU8x0zXZZRhERjRPFS1915w== X-Google-Smtp-Source: AGHT+IEg61zEwDjPgzo8LK6a+eOlKVS1A0Ga4gpCDsVLKFS0Yws4ZyaLb+sCVfhID9KHdNSEFh55Bw== X-Received: by 2002:a17:907:d88:b0:aa6:86d1:c3fe with SMTP id a640c23a62f3a-aac27130bf5mr1169690866b.4.1734962412990; Mon, 23 Dec 2024 06:00:12 -0800 (PST) Received: from [127.0.1.1] (nat6-minsk-pool-46-53-210-232.telecom.by. [46.53.210.232]) by smtp.googlemail.com with ESMTPSA id 4fb4d7f45d1cf-5d80701ca31sm4911485a12.88.2024.12.23.06.00.11 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 23 Dec 2024 06:00:12 -0800 (PST) From: Dzmitry Sankouski Date: Mon, 23 Dec 2024 16:59:46 +0300 Subject: [PATCH v13 09/10] input: max77693: add max77705 haptic support Precedence: bulk X-Mailing-List: linux-leds@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-Id: <20241223-starqltechn_integration_upstream-v13-9-fbc610c70832@gmail.com> References: <20241223-starqltechn_integration_upstream-v13-0-fbc610c70832@gmail.com> In-Reply-To: <20241223-starqltechn_integration_upstream-v13-0-fbc610c70832@gmail.com> To: Sebastian Reichel , Chanwoo Choi , Krzysztof Kozlowski , Lee Jones , Rob Herring , Conor Dooley , Dmitry Torokhov , Pavel Machek , Hans de Goede , Marek Szyprowski , Sebastian Krzyszkowiak , Purism Kernel Team , Krzysztof Kozlowski Cc: linux-pm@vger.kernel.org, linux-kernel@vger.kernel.org, devicetree@vger.kernel.org, linux-input@vger.kernel.org, linux-leds@vger.kernel.org, Dzmitry Sankouski X-Mailer: b4 0.14.0 X-Developer-Signature: v=1; a=ed25519-sha256; t=1734962389; l=4280; i=dsankouski@gmail.com; s=20240619; h=from:subject:message-id; bh=8tiL9gYxosgDGJy5CegOZ2k8C1ERDVZ0anDBBusV6lo=; b=K1UTD9G46syR4BLMtnY0dNcQUXDZpJcH7IuhPHxBxW+GlLEQZNFzliT+4P9cpkqQD/C2kNQAn buYXvdODMoxAjzcY2vTpwZixum2ffZMd/YDGfOa3ZM+PGNLtN+cfjug X-Developer-Key: i=dsankouski@gmail.com; a=ed25519; pk=YJcXFcN1EWrzBYuiE2yi5Mn6WLn6L1H71J+f7X8fMag= Add support for haptic controller on MAX77705 Multifunction device. This driver supports external pwm and LRA (Linear Resonant Actuator) motor. User can control the haptic device via force feedback framework. Acked-by: Dmitry Torokhov Signed-off-by: Dzmitry Sankouski --- Changes in v4: - add max77705 haptic support to max77693 driver - delete max77705-haptic --- drivers/input/misc/Kconfig | 4 ++-- drivers/input/misc/Makefile | 1 + drivers/input/misc/max77693-haptic.c | 15 ++++++++++++++- 3 files changed, 17 insertions(+), 3 deletions(-) diff --git a/drivers/input/misc/Kconfig b/drivers/input/misc/Kconfig index 13d135257e06..b9db5abcde08 100644 --- a/drivers/input/misc/Kconfig +++ b/drivers/input/misc/Kconfig @@ -241,11 +241,11 @@ config INPUT_MAX77650_ONKEY config INPUT_MAX77693_HAPTIC tristate "MAXIM MAX77693/MAX77843 haptic controller support" - depends on (MFD_MAX77693 || MFD_MAX77843) && PWM + depends on (MFD_MAX77693 || MFD_MAX77705 || MFD_MAX77843) && PWM select INPUT_FF_MEMLESS help This option enables support for the haptic controller on - MAXIM MAX77693 and MAX77843 chips. + MAXIM MAX77693, MAX77705 and MAX77843 chips. To compile this driver as module, choose M here: the module will be called max77693-haptic. diff --git a/drivers/input/misc/Makefile b/drivers/input/misc/Makefile index 6d91804d0a6f..e70164dd73c2 100644 --- a/drivers/input/misc/Makefile +++ b/drivers/input/misc/Makefile @@ -53,6 +53,7 @@ obj-$(CONFIG_INPUT_KXTJ9) += kxtj9.o obj-$(CONFIG_INPUT_M68K_BEEP) += m68kspkr.o obj-$(CONFIG_INPUT_MAX77650_ONKEY) += max77650-onkey.o obj-$(CONFIG_INPUT_MAX77693_HAPTIC) += max77693-haptic.o +obj-$(CONFIG_INPUT_MAX77705_HAPTIC) += max77705-haptic.o obj-$(CONFIG_INPUT_MAX8925_ONKEY) += max8925_onkey.o obj-$(CONFIG_INPUT_MAX8997_HAPTIC) += max8997_haptic.o obj-$(CONFIG_INPUT_MC13783_PWRBUTTON) += mc13783-pwrbutton.o diff --git a/drivers/input/misc/max77693-haptic.c b/drivers/input/misc/max77693-haptic.c index 0e646f1b257b..c3b9d33608d7 100644 --- a/drivers/input/misc/max77693-haptic.c +++ b/drivers/input/misc/max77693-haptic.c @@ -23,6 +23,7 @@ #include #include #include +#include #include #define MAX_MAGNITUDE_SHIFT 16 @@ -115,6 +116,13 @@ static int max77693_haptic_configure(struct max77693_haptic *haptic, MAX77693_HAPTIC_PWM_DIVISOR_128); config_reg = MAX77693_HAPTIC_REG_CONFIG2; break; + case TYPE_MAX77705: + value = ((haptic->type << MAX77693_CONFIG2_MODE) | + (enable << MAX77693_CONFIG2_MEN) | + (haptic->mode << MAX77693_CONFIG2_HTYP) | + MAX77693_HAPTIC_PWM_DIVISOR_128); + config_reg = MAX77705_PMIC_REG_MCONFIG; + break; case TYPE_MAX77843: value = (haptic->type << MCONFIG_MODE_SHIFT) | (enable << MCONFIG_MEN_SHIFT) | @@ -312,6 +320,9 @@ static int max77693_haptic_probe(struct platform_device *pdev) case TYPE_MAX77693: haptic->regmap_haptic = max77693->regmap_haptic; break; + case TYPE_MAX77705: + haptic->regmap_haptic = max77693->regmap; + break; case TYPE_MAX77843: haptic->regmap_haptic = max77693->regmap; break; @@ -407,6 +418,7 @@ static DEFINE_SIMPLE_DEV_PM_OPS(max77693_haptic_pm_ops, static const struct platform_device_id max77693_haptic_id[] = { { "max77693-haptic", }, + { "max77705-haptic", }, { "max77843-haptic", }, {}, }; @@ -414,6 +426,7 @@ MODULE_DEVICE_TABLE(platform, max77693_haptic_id); static const struct of_device_id of_max77693_haptic_dt_match[] = { { .compatible = "maxim,max77693-haptic", }, + { .compatible = "maxim,max77705-haptic", }, { .compatible = "maxim,max77843-haptic", }, { /* sentinel */ }, }; @@ -432,5 +445,5 @@ module_platform_driver(max77693_haptic_driver); MODULE_AUTHOR("Jaewon Kim "); MODULE_AUTHOR("Krzysztof Kozlowski "); -MODULE_DESCRIPTION("MAXIM 77693/77843 Haptic driver"); +MODULE_DESCRIPTION("MAXIM 77693/77705/77843 Haptic driver"); MODULE_LICENSE("GPL");