From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mx0b-0031df01.pphosted.com (mx0b-0031df01.pphosted.com [205.220.180.131]) (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 AA9C038737F for ; Wed, 14 Jan 2026 10:04:38 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=205.220.180.131 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1768385080; cv=none; b=tT60WDw4yuLF30jj79O9Z2hNgaCOpVQ3KgUZSja55eQLTxnFNZxFpjZlVXey4PG06D5q5e9Uay3cHhimH3pmEH2Dl30/vVOpy0Tz0RqL7oDDiU9F5a2M87d7vpWGgYV+LhIJTnK3X5FVVHaxcwSDWQcqqSn4hb4Nr8YbS0hR48Q= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1768385080; c=relaxed/simple; bh=bk5+NHu/P6gafqqhb4aOu+UXDpyWuvNVnGbIOZ2XFnI=; h=Message-ID:Date:MIME-Version:Subject:To:Cc:References:From: In-Reply-To:Content-Type; b=Yo0Hb8m/Ah2QtI+uvvxiWsTvuG/r0RzQv72nLQkVngG5aOk/Fnjw2juONJV0CO6sruXmfDg3hBTYBW1++FB3gmdqGA1XIfPk5Mfp83yNpfLO73dQmwRsuEPvd85iJ0q0f+CpvMZFdA8oizyWD0NY3f3HjddEHlpLyaDLpMQvzB4= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=oss.qualcomm.com; spf=pass smtp.mailfrom=oss.qualcomm.com; dkim=pass (2048-bit key) header.d=qualcomm.com header.i=@qualcomm.com header.b=nRlFufa3; dkim=pass (2048-bit key) header.d=oss.qualcomm.com header.i=@oss.qualcomm.com header.b=dbxT9Qrl; arc=none smtp.client-ip=205.220.180.131 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=oss.qualcomm.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=oss.qualcomm.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=qualcomm.com header.i=@qualcomm.com header.b="nRlFufa3"; dkim=pass (2048-bit key) header.d=oss.qualcomm.com header.i=@oss.qualcomm.com header.b="dbxT9Qrl" Received: from pps.filterd (m0279871.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.18.1.11/8.18.1.11) with ESMTP id 60E9jv2R3296429 for ; Wed, 14 Jan 2026 10:04:37 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=qualcomm.com; h= cc:content-transfer-encoding:content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to; s=qcppdkim1; bh= LwJOhAcoLnubcI+OpTANBa1Q6k/a05uNgL+zKTmJFTM=; b=nRlFufa38/C8KQB+ t7XdLj/CP9XUzHX6kWnl2Rlc1rwX9KIJjikY9wM/5Q9iySLu2B4fkeoDvqn516oK uyod7fBAZCc0pYL9Y8MLdxf+/T0cG1b9rZClV0BFouqc1pjgowpokTlVjo5zqXUw Y1fjQRDlfBDN/RxQtxSL6x+icmC6Hr8WfrKHDm3Ymz1mhqD4qQZWf2V4rtaZsXAB TIX8MX7TcSdmk3/LcXDPpKdGIK1crmazxy22Fha9ntRaQT1xPYvkwIquWSlXrOcJ CiIA48AHc1QvRap1tDjZv5yL7dZmMsIpi/02o7vhIhh2VvgP3ketv7mM5NDUpx8M XC4/+Q== Received: from mail-qk1-f197.google.com (mail-qk1-f197.google.com [209.85.222.197]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 4bp8t2r33w-1 (version=TLSv1.3 cipher=TLS_AES_128_GCM_SHA256 bits=128 verify=NOT) for ; Wed, 14 Jan 2026 10:04:37 +0000 (GMT) Received: by mail-qk1-f197.google.com with SMTP id af79cd13be357-8b5ff26d6a9so175798085a.0 for ; Wed, 14 Jan 2026 02:04:37 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oss.qualcomm.com; s=google; t=1768385077; x=1768989877; darn=vger.kernel.org; h=content-transfer-encoding:in-reply-to:from:content-language :references:cc:to:subject:user-agent:mime-version:date:message-id :from:to:cc:subject:date:message-id:reply-to; bh=LwJOhAcoLnubcI+OpTANBa1Q6k/a05uNgL+zKTmJFTM=; b=dbxT9Qrlsu8STGabohs2U37KxDN5fPQZUcMDxWczvGoYhF/WUBsKa3oUVUwErN4osp 0czA9CvIqK2sqbVjHkCDc2ERac9SYQJv/vVDPieBUPeZU8lrNim0CB9f+OQZU0nn3WUx L6Tr4R/78YaekpL8EXaqiJluRxQ7qcGiN3D2R/nku5HmPKI2vtjgtUO9BwjfvEMTJ/sQ EQJ0UdH95xVKGFLyY1UDi+t1SgLI4+AU1SUk8zCfP+6cQurA7csvhsuTwn9kkmJ8hTDE 7XgcS1gL/BECi6l6cCCbZ46BDwV/OZorPaod2f1iW63bgZqNhXtTpctF3nzwvAbzxCPK hQsQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1768385077; x=1768989877; h=content-transfer-encoding:in-reply-to:from:content-language :references:cc:to:subject:user-agent:mime-version:date:message-id :x-gm-gg:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=LwJOhAcoLnubcI+OpTANBa1Q6k/a05uNgL+zKTmJFTM=; b=rB7PhUD9DeBPkRyS0N6lhuSJEZBUPmPUHNke8yriRTPFFChTRFJLXdJ7z+oPCHyLbn 8kAyweuT5J6JiCN/WvWj3kv5kTzXID5PNp4WDUBfSl+pGao0/mQzOC2tAiWwz86mWB3w OLMs4YxYbXedR68pezju8kKHAztHjgQZ0CgWuoEXPbOfpa0lvjo16AI8cbOuxAnmfK0+ oTg019sbNNL04bMtz/zhcOEXrt1J1eezstrMQmAO5NaI+iSGKhvMJc4OW7tFjA1ylqnz Mb1/WxmwMY/BiIudO5fRmNoE+/KtSUolI501z7F1YMAhyYzOtSr/1zZZ62UiXdSbvwgb uQUQ== X-Forwarded-Encrypted: i=1; AJvYcCWGdQDYS4q3YN9UmWEfWqtUxop7NccCgtf0+j5G/L+Uck0gY3QbvWeJicwauB1V8ZncTgAq3WHxinvA3R0=@vger.kernel.org X-Gm-Message-State: AOJu0YyxusBaawkb/v8FzGloelZG6nm5dpczljeFYY5G6b6Qr52NXj0i DujOjSywrMznimu/fhWIE3cf/lqHRmKmxVoatP5t8i1rF99/M9jXDXo5x9UBg12zAMAAKAmWLHe rfvFbsYvSI2/c25kgRS5xVE9N23SSyZTme3u0jzJe/fWw9cRxA3BAyZyQBdicqzyw5YQ= X-Gm-Gg: AY/fxX7ODDyHS0V2K4/WL43PZdHXdF0v5Rjn4nsOTwk8IE9Nu0wvFrtN1kK/uiM/pMz GJqSCaGLClSwtVCtEfpeXPntWw7jP7SRFpDdMQlHmEug/HPfnWc0MPCvDEJuWgdyUIeUqTUBoES ebEAw8zJVAp4s5vUXBcdzSMhdZR/cDAzc4sZmXYx1GYPltFvrhbxYRzFm69kgS/7jk+Opge7vYQ c1XEFjdCXi67vy6EMgTH1ApYxOlMZyCYhx/qc6d+4bwv/rSZ+FDbZK/X5WtpjK6iCIMe79BJjTh w2YI3x1g4Au0J/POmPtQQmg7g0UQWFIsG0ASkVHmTGOPcn1RSvnMSqYzd5+syNhwZ1iETiG0zc6 OuYY6dogX14bMkaP9CwxnlIhUrgdz5Xx83P9ilkpPi1RI7cYpOXL64HdAxXtaf3c/M4g= X-Received: by 2002:a05:620a:4411:b0:8b9:e0ea:af3b with SMTP id af79cd13be357-8c52fb74bd4mr221993785a.5.1768385076959; Wed, 14 Jan 2026 02:04:36 -0800 (PST) X-Received: by 2002:a05:620a:4411:b0:8b9:e0ea:af3b with SMTP id af79cd13be357-8c52fb74bd4mr221982985a.5.1768385075013; Wed, 14 Jan 2026 02:04:35 -0800 (PST) Received: from [192.168.119.254] (078088045245.garwolin.vectranet.pl. [78.88.45.245]) by smtp.gmail.com with ESMTPSA id 4fb4d7f45d1cf-6507b22c3absm22533208a12.0.2026.01.14.02.04.31 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Wed, 14 Jan 2026 02:04:34 -0800 (PST) Message-ID: Date: Wed, 14 Jan 2026 11:04:30 +0100 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH v7 05/10] nvmem: qcom-spmi-sdam: Migrate to devm_spmi_subdevice_alloc_and_add() To: Andy Shevchenko Cc: AngeloGioacchino Del Regno , jic23@kernel.org, dlechner@baylibre.com, nuno.sa@analog.com, andy@kernel.org, arnd@arndb.de, gregkh@linuxfoundation.org, srini@kernel.org, vkoul@kernel.org, neil.armstrong@linaro.org, sre@kernel.org, sboyd@kernel.org, krzk@kernel.org, dmitry.baryshkov@oss.qualcomm.com, quic_wcheng@quicinc.com, melody.olvera@oss.qualcomm.com, quic_nsekar@quicinc.com, ivo.ivanov.ivanov1@gmail.com, abelvesa@kernel.org, luca.weiss@fairphone.com, mitltlatltl@gmail.com, krishna.kurapati@oss.qualcomm.com, linux-arm-msm@vger.kernel.org, linux-iio@vger.kernel.org, linux-kernel@vger.kernel.org, linux-phy@lists.infradead.org, linux-pm@vger.kernel.org, kernel@collabora.com References: <20260114083957.9945-1-angelogioacchino.delregno@collabora.com> <20260114083957.9945-6-angelogioacchino.delregno@collabora.com> <8bf79979-0946-4ed9-b8d4-c442a6e54833@collabora.com> <401c5e7b-ff33-44e8-98a5-8cc6af4f2a87@collabora.com> <647b4acc-3310-4329-ac7a-77e86bab74a3@collabora.com> Content-Language: en-US From: Konrad Dybcio In-Reply-To: Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Authority-Analysis: v=2.4 cv=YPaSCBGx c=1 sm=1 tr=0 ts=69676a35 cx=c_pps a=50t2pK5VMbmlHzFWWp8p/g==:117 a=FpWmc02/iXfjRdCD7H54yg==:17 a=IkcTkHD0fZMA:10 a=vUbySO9Y5rIA:10 a=s4-Qcg_JpJYA:10 a=VkNPw1HP01LnGYTKEx00:22 a=K6O-kMeRs0nb6JyVbzgA:9 a=3ZKOabzyN94A:10 a=QEXdDO2ut3YA:10 a=IoWCM6iH3mJn3m4BftBB:22 X-Proofpoint-Spam-Details-Enc: AW1haW4tMjYwMTE0MDA4MiBTYWx0ZWRfXzDlHPCF0AmTZ lX1C+5me69Li26zKVHSX/GXQYavDF92bLRZbJ/nT28+M1oGQjG2OUHReQT150n4O7PwW/7ezCAY VKGexkYLggq70T6CWoDoA8xicpVGLYG5Fim2Ssjr5Fj9OFwsvDzGk4Duda86m/Wih1e9YmvnrNK NsfDsq6Qm0CgKTjBpuFyxyKJYJNHdO+l5+AvFdMN0tGFPNe1XiDhZbUds+kOwi27sdQ8MHOt+SJ YC/7gjAMkeCCsqSRExDKDX+nwwq+CdA4xZW1rjiV2DThkH9yIzO7/0dyo3wn7JKUiERwBIvyVPB 6/hZT45T2Pc4H7dugmczXU7UIjWD8MuRSeFn3AWRj9TY0j9csBfTjvKU9Xp31fHAeRuRrtGumKx DvrlXp9CXkkPgVoP+quUfN3TCcOsf9IuMlmTfYkPZK1avbI39pHF8my0LTJBBi06K00h+jUGY8p 9PxURhRzyqAODQhSDHA== X-Proofpoint-GUID: mFad7kMlgdA6f3QYKXb72_RYPuD-7dAU X-Proofpoint-ORIG-GUID: mFad7kMlgdA6f3QYKXb72_RYPuD-7dAU X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1121,Hydra:6.1.9,FMLib:17.12.100.49 definitions=2026-01-14_03,2026-01-09_02,2025-10-01_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 clxscore=1015 bulkscore=0 impostorscore=0 suspectscore=0 malwarescore=0 phishscore=0 lowpriorityscore=0 priorityscore=1501 spamscore=0 adultscore=0 classifier=typeunknown authscore=0 authtc= authcc= route=outbound adjust=0 reason=mlx scancount=1 engine=8.22.0-2512120000 definitions=main-2601140082 On 1/14/26 10:55 AM, Andy Shevchenko wrote: > On Wed, Jan 14, 2026 at 10:47:20AM +0100, Konrad Dybcio wrote: >> On 1/14/26 10:42 AM, Andy Shevchenko wrote: >>> On Wed, Jan 14, 2026 at 10:09:45AM +0100, AngeloGioacchino Del Regno wrote: >>>> Il 14/01/26 10:07, Andy Shevchenko ha scritto: >>>>> On Wed, Jan 14, 2026 at 10:03:57AM +0100, AngeloGioacchino Del Regno wrote: >>>>>> Il 14/01/26 10:00, Andy Shevchenko ha scritto: >>>>>>> On Wed, Jan 14, 2026 at 09:59:40AM +0100, AngeloGioacchino Del Regno wrote: >>>>>>>> Il 14/01/26 09:56, Andy Shevchenko ha scritto: >>>>>>>>> On Wed, Jan 14, 2026 at 09:39:52AM +0100, AngeloGioacchino Del Regno wrote: > > ... > >>>>>>>>>> + struct regmap_config sdam_regmap_config = { >>>>>>>>>> + .reg_bits = 16, >>>>>>>>>> + .val_bits = 8, >>>>>>>>> >>>>>>>>>> + .max_register = 0x100, >>>>>>>>> >>>>>>>>> Are you sure? This might be a bad naming, but here max == the last accessible. >>>>>>>>> I bet it has to be 0xff (but since the address is 16-bit it might be actually >>>>>>>>> 257 registers, but sounds very weird). >>>>>>>> >>>>>>>> Yes, I'm sure. >>>>>>> >>>>>>> So, what is resided on address 0x100 ? >>>>>> >>>>>> I don't remember, this is research from around 5 months ago, when I've sent >>>>>> the v1 of this. >>>>>> >>>>>> If you really want though, I can incorrectly set max_register to 0xff. >>>>> >>>>> Why incorrectly? Can you dig into the datasheet and check, please? We don't >>>>> know what is the 0x100 address means. >>>> >>>> I don't have any datasheets for Qualcomm IPs. >>> >>> Hmm... Can we have somebody from QC to check on this? >>> Perhaps Dmitry? >> >> 0xe6 is the last usable register today > > Thanks for checking! > >> But I wouldn't mind either 0xff or 0x100 because I don't want >> anyone to pull their hair out if a regmap access is dropped some day.. > > There is actually about the exact window size where registers are belong to the > same entity (subdevice). As in the HW world most of the things are stuck with > power-of-two numbers, and taking into account the naming of the field, I do not > believe one provides a 257 (256 + 1 = 2⁸ + 1) register _windows_ ("s" is also > important here, as it points out to the pattern) for the subdevices. I bet the > 0xff, i.e. 256, is the *correct* window from the HW perspective. Right, [0x100n, 0x100n + 0xff] inclusive is the reserved register window for all Qualcomm PMIC peripherals, so I guess 0xff is the correct choice here If a peripheral is more complex, it's split into a couple of these same-sized blocks Konrad