Received: by 2002:ac0:946b:0:0:0:0:0 with SMTP id j40csp3263643imj; Mon, 18 Feb 2019 23:54:49 -0800 (PST) X-Google-Smtp-Source: AHgI3IYi+mdUWIvVQnao04/MhhltmvWD/zmFw9R3AEik8DG4kS9C1Ey5jV003ug6tlbOgCy0Fhr8 X-Received: by 2002:a17:902:8f83:: with SMTP id z3mr28910457plo.328.1550562889114; Mon, 18 Feb 2019 23:54:49 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1550562889; cv=none; d=google.com; s=arc-20160816; b=TWwxbUWyZVD4pMBEu/robwkwkZVxobY2KLhnImTalmM88TLzxzUBr9jYJYPHBjkZ5w l/Oc0MNbPO8W4o5lefgAhROGf6vloolsmEcuYGrS5opMOQgv9qsoE585DCRTMDJiIrg7 hhQ/uDKEBj8Jsm0FNydiLvBSK9KUrMHYLEGUMBIXhrRjw8ulwnbFET6twyeBHWYtYla/ nAT8kQIUoK96Z3TqT3zJIauqyVm1ua7RnRffW2qevP9dTEOqMLjd95gGCoC8NpApvXK3 VwS+dOy+J2ZeIulwcmq9ILmlS+NE4mHG4ol0IkzmNRyXxq105zrjCt3ULEy8OmjfzRAj gDHA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version; bh=3BHJGuzFre5EqeiGJ9VmPuQJ9pzCKiKw3d/t5MFk0qY=; b=Ymky+Bez6rsm99cJvzzAC/cZvR5fD/HG4RxeDsvmjMxvyGOYuLNqhNbSxGO5XeohVo s226kEwytIof7AjKMmwwlzb33ozjCVojP3fZOV31a/IJETFdK1iPIZP0r75pgrx+R4/T NElzOPr4hGfGi7cN3+1ZSOKsA5wbSdc8pAlBloJdGYGXJ424lpZ8kYbUWkDWifFjjO/I 4juP04QKhd+/vwFJo/RUg1BzRNOf1qqD4ZLbH6erVYN59FmYMJmu5z14AlAi/Kc5MxT4 D3AYxgjbMBQFDqU4+FRmbt8sHdO48TnDwoKabJV25rDidAPGNDfOGfWGFVoHDTDABZHG ah4g== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id v12si7516156pfj.72.2019.02.18.23.54.34; Mon, 18 Feb 2019 23:54:49 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727389AbfBSHyO (ORCPT + 99 others); Tue, 19 Feb 2019 02:54:14 -0500 Received: from mail-ed1-f46.google.com ([209.85.208.46]:36211 "EHLO mail-ed1-f46.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726330AbfBSHyO (ORCPT ); Tue, 19 Feb 2019 02:54:14 -0500 Received: by mail-ed1-f46.google.com with SMTP id g9so5367010eds.3; Mon, 18 Feb 2019 23:54:12 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=3BHJGuzFre5EqeiGJ9VmPuQJ9pzCKiKw3d/t5MFk0qY=; b=p2qQTPZqLJz9Lw+gb1AjieMzRo2JrcNu3PKhQIXTsPNsro0IXmynTdRtPh1RH2ylXr 2AfDvTn73RYi1v82+nBQc2IdP9NDvC0fgg3b7nHmxR2DgvY/2u+VmbTJJqLfMrsCM74a m6F3zla2pNcUXV+bmUlIYFagqoDpOrr7G0XLQP0I7IAuKHzVM4UwO5I87cfKEwwp0kYO OuRsPep+vIevDNG1+2BxVbkek9EyjN1QzEZjYyBuBrbZfVZGnP3pxVHhJ1AZcuS6rkqx fSuQV9GKjFxT1eiENMN3WDWsMDoXtCvfmht9BoLkInJs0htYLnOodInUPW3eY86Ky8Xt qjQQ== X-Gm-Message-State: AHQUAubevjAYFRaANgJzK2HJOGmDCOAQLrpHUawHjJZjQ3sEyq8QdoLR JUx69cSTVN5rDnCb/UsUoj63hKh79f8= X-Received: by 2002:aa7:cb52:: with SMTP id w18mr11179307edt.257.1550562851822; Mon, 18 Feb 2019 23:54:11 -0800 (PST) Received: from mail-wr1-f52.google.com (mail-wr1-f52.google.com. [209.85.221.52]) by smtp.gmail.com with ESMTPSA id l15sm1540750edb.79.2019.02.18.23.54.11 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 18 Feb 2019 23:54:11 -0800 (PST) Received: by mail-wr1-f52.google.com with SMTP id c8so21035441wrs.4; Mon, 18 Feb 2019 23:54:11 -0800 (PST) X-Received: by 2002:a5d:498a:: with SMTP id r10mr20209960wrq.188.1550562850798; Mon, 18 Feb 2019 23:54:10 -0800 (PST) MIME-Version: 1.0 References: <20180830154518.29507-1-embed3d@gmail.com> <20180830154518.29507-28-embed3d@gmail.com> <20180904184623.e4386b8e6b657b1b25e90c09@bidouilliste.com> <55579dd6-625d-e71b-1482-4592dccac665@gmail.com> <20180906115114.inc6dhqhy47obo25@flea> In-Reply-To: <20180906115114.inc6dhqhy47obo25@flea> From: Chen-Yu Tsai Date: Tue, 19 Feb 2019 15:54:00 +0800 X-Gmail-Original-Message-ID: Message-ID: Subject: Allwinner SID THS calibration data cell representation? To: Maxime Ripard Cc: Philipp Rossak , Emmanuel Vadot , Rob Herring , Mark Rutland , Jonathan Cameron , Quentin Schulz , Icenowy Zheng , linux-iio@vger.kernel.org, devicetree , linux-sunxi , linux-kernel , linux-arm-kernel Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Sorry for resurrecting an old discussion, but since someone posted patches for H5 and H6, I thought we should resolve this. I'm working on patches to fix / replace the big-endian issue. On Thu, Sep 6, 2018 at 7:51 PM Maxime Ripard wrote: > > On Thu, Sep 06, 2018 at 01:47:47PM +0200, Philipp Rossak wrote: > > On 04.09.2018 18:46, Emmanuel Vadot wrote: > > > > + /* Data cells */ > > > > + thermal_calibration: calib@234 { > > > > + reg = <0x234 0x8>; > > > > + }; > > > You are declaring 8 bytes of calibration data but to my knowledge it's > > > only 2 bytes per sensor, so 2 bytes for H3. > > > Am I missing something ? > > > > > > Thanks, > > > > Emmanuel you are right, it is 2 bytes per Sensor and should be 2 bytes for > > H3, but the thermal calibration data field is on all chips 64 bit wide - so > > 8 bytes. So I'm reading here the complete calibration data field. > > Having one cell per channel would make more sense I guess. Would it? The 2 32-bit words directly map onto the registers 0x74 / 0x78 in the THS. As far as the SID is concerned, their is just one consumer for this data, the thermal sensor. How the thermal sensor uses that data is really not its concern. And the thermal sensor is really just copying the data from the e-fuses into its registers. Nothing more. Furthermore, with the register access interface, the e-fuses are read/write 32 bits at a time. Seems to me it would make more sense to enforce a 32-bit word size, so cells should be multiples of 32 bits. Regards ChenYu