Received: by 2002:a05:6a10:5bc5:0:0:0:0 with SMTP id os5csp63242pxb; Mon, 8 Nov 2021 09:47:02 -0800 (PST) X-Google-Smtp-Source: ABdhPJy2/lJUMs0+wPFKWT6LE+HE98+WTN8yf+n/EsvWqHyYBkpp66BTrQXT0oJx8eq+6RiT1nJg X-Received: by 2002:a05:6e02:1b0f:: with SMTP id i15mr563229ilv.191.1636393621851; Mon, 08 Nov 2021 09:47:01 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1636393621; cv=none; d=google.com; s=arc-20160816; b=raUEmlbnP+7mxM+sSf4Dr+hdoLgT9fA/zdP06uY2WFrmbYbbC1tJJ7YYYL086XwPMn UYSeeZMLK97EguncVY3XiC07+uQ2rJJyL+z5DTLT5S28eynuaActQTCiI1hWEv7DjkDn Jj5sG2hjkwxM6yRECAtGHTVqL4URaQzuKIcoyZ5YppmR3TfQWahajMNZP1IlfxgtToS4 +HIQMPESuO/4mH40dQk6PG6aQ/gNewgSHQOIX2BJCvEHBeSB57tBx8WIRJCiZHmmyRjg RMEYuMDkpuzPztTkkhq27iZZgci9qgHS181ps5lN/6lPwRkVbf7ZHRlHP64lvadGeyWa ZWsg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to:from :references:to:content-language:subject:user-agent:mime-version:date :message-id:dkim-signature; bh=5XRwho7+z/7vhTPwvicBMtPsRE4HAHnRBBlx0Po33V4=; b=nmD3K4FCp/SXKAa9+iVY8lRA4SvQwtQAdM/TevnGrq635b4qpfEAdQGpVs+/7E113G iLbQOgz40YbdYqMGPJdjW1aZmr2ypbjUOv1ExENVlb4uP8sallGn79pUyjlUtY2Fbf32 Z6dEibp1DB1rHCGfkbog59hGjufESeZ4+UluRS6dYELxkdRo7qX5Z9fvBf1OVKNYCNyW gbewSgslJCkfx7gxzat/X2+ArVV942s10mfAc/s7oZ1Jwzn4thT5rsc9W18A/3H17P/3 QCnATejIryDc797jNSCY4rDYLi468g5WG8E82+obGNAjXAO1kAfOXZZTBEQ+KxBlGsn7 qAIg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=Pjgxay+d; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id k5si32104687iov.114.2021.11.08.09.46.16; Mon, 08 Nov 2021 09:47:01 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=Pjgxay+d; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S239448AbhKHQGX (ORCPT + 99 others); Mon, 8 Nov 2021 11:06:23 -0500 Received: from us-smtp-delivery-124.mimecast.com ([216.205.24.124]:52058 "EHLO us-smtp-delivery-124.mimecast.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S238035AbhKHQGW (ORCPT ); Mon, 8 Nov 2021 11:06:22 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1636387417; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=5XRwho7+z/7vhTPwvicBMtPsRE4HAHnRBBlx0Po33V4=; b=Pjgxay+dl/KE5k8REkqHD4mdxx44RFAZv4Bt74jFZWfaqNjO7Hc2t+OCT4Snq68nfSIUmI Al/yN8v2lIeE6nkld7A7gmpVGWvaKQXAMXJDnvEAWgi7S7hmIEPermBzKlLv7mRKgFBeFn JX4pQmK0pTR4S8+/Zil23x1SKoxvXbE= Received: from mail-ed1-f70.google.com (mail-ed1-f70.google.com [209.85.208.70]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-425-2yFx9L-PNMmVhn3zB5zFTA-1; Mon, 08 Nov 2021 11:03:36 -0500 X-MC-Unique: 2yFx9L-PNMmVhn3zB5zFTA-1 Received: by mail-ed1-f70.google.com with SMTP id f20-20020a0564021e9400b003e2ad3eae74so15271298edf.5 for ; Mon, 08 Nov 2021 08:03:35 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:message-id:date:mime-version:user-agent:subject :content-language:to:references:from:in-reply-to :content-transfer-encoding; bh=5XRwho7+z/7vhTPwvicBMtPsRE4HAHnRBBlx0Po33V4=; b=6SYMo3x68we4slmcGmqXO+BJ1bexv4QadiG4KqznXq/5l9eekb1MbJUwnCS/dtfMBq rIEGjIeYZ+8kaqemcO7DjSmsd5vlkdqTalGJAZ6g4e0ox2dxNTyZmWtyjKfUcnNy3glS ZkgA8jubUj0acV+xP72X5MJqnvDxqAd7kfeQ8e7l0yf02BCJHbBPIv06Xbq3ulTZvAEz SsEdr28p3OxhxuQjXxEVwjIm7EXPDYb2aJKgQyjbxdawVpYRURbKmkDdOeF3i6OC2hxx f5MNjhPymiidPQREbeC08EFBmNqXY6kWlXyLTv729bhdHq/I40O1CAFjfKMaVF6ZwSMg sTGg== X-Gm-Message-State: AOAM533hHYaQTd/rtYCFbYLJHLF7h1TmPd6tx8YU3N0zKHhYoHmRHDHw svE7jqa3zxTKKhtGdPVLguM9Pm/Ae0VEe2l9LeU8brsPsEaaxB95ixJzjvyy1RBGqWTnfZJ8Y/r cPy8CXRtFkdqRp5VSpR86ddMt X-Received: by 2002:a05:6402:27ca:: with SMTP id c10mr257983ede.53.1636387414866; Mon, 08 Nov 2021 08:03:34 -0800 (PST) X-Received: by 2002:a05:6402:27ca:: with SMTP id c10mr257946ede.53.1636387414596; Mon, 08 Nov 2021 08:03:34 -0800 (PST) Received: from [10.40.1.223] ([81.30.35.201]) by smtp.gmail.com with ESMTPSA id gb2sm8401303ejc.52.2021.11.08.08.03.33 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Mon, 08 Nov 2021 08:03:34 -0800 (PST) Message-ID: Date: Mon, 8 Nov 2021 17:03:33 +0100 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.2.0 Subject: Re: [PATCH 11/13] i2c: cht-wc: Add support for devices using a bq25890 charger Content-Language: en-US To: Wolfram Sang , Mark Gross , Andy Shevchenko , Sebastian Reichel , MyungJoo Ham , Chanwoo Choi , Ard Biesheuvel , Yauhen Kharuzhy , Tsuchiya Yuto , platform-driver-x86@vger.kernel.org, linux-i2c@vger.kernel.org, linux-pm@vger.kernel.org, linux-kernel@vger.kernel.org, linux-efi@vger.kernel.org References: <20211030182813.116672-1-hdegoede@redhat.com> <20211030182813.116672-12-hdegoede@redhat.com> From: Hans de Goede In-Reply-To: Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi, On 10/31/21 18:58, Wolfram Sang wrote: > On Sat, Oct 30, 2021 at 08:28:11PM +0200, Hans de Goede wrote: >> The i2c-controller on the Cherry Trail - Whiskey Cove PMIC is special >> in that it is always connected to the I2C charger IC of the board on >> which the PMIC is used; and the charger IC is not described in ACPI, >> so the i2c-cht-wc code needs to instantiate an i2c-client for it itself. >> >> So far there has been a rudimentary check to make sure the ACPI tables >> are at least somewhat as expected by checking for the presence of an >> INT33FE device and sofar the code has assumed that if this INT33FE >> device is present that the used charger then is a bq24290i. >> >> But some boards with an INT33FE device in their ACPI tables use a >> different charger IC and some boards don't have an INT33FE device at all. >> >> Since the information about the used charger + fuel-gauge + other chips is >> necessary in other places too, the kernel now adds a "intel,cht-wc-setup" >> string property to the Whiskey Cove PMIC i2c-client based on DMI matching, >> which reliably describes the board's setup of the PMIC. >> >> Switch to using the "intel,cht-wc-setup" property and add support for >> instantiating an i2c-client for either a bq24292i or a bq25890 charger. >> >> This has been tested on a GPD pocket (which uses the old bq24292i setup) >> and on a Xiaomi Mi Pad 2 with a bq25890 charger. >> >> Signed-off-by: Hans de Goede > > In general, fine with me from the I2C side: > > Acked-by: Wolfram Sang Thank you for v2 I've refactored things a bit, enough that I'm going to drop your Ack, sorry. >> + else if (!strcmp(str, "bq24292i,max17047,fusb302,pi3usb30532")) >> + board_info = &bq24190_board_info; >> + else if (!strcmp(str, "bq25890,bq27520")) >> + board_info = &bq25890_board_info; > > Very minor nit: I prefer 'strcmp() == 0' because the above could be read > as 'if not strcmp()' which is sadly misleading. But I am not strict with > it. All the strcmp-s are gone in the refactored version. Regards, Hans