From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from phobos.denx.de (phobos.denx.de [85.214.62.61]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id C867FC636D3 for ; Tue, 31 Jan 2023 12:52:42 +0000 (UTC) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 2D6EC85A5A; Tue, 31 Jan 2023 13:52:40 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Authentication-Results: phobos.denx.de; dkim=pass (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="JdsMbwge"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 298A385A7B; Tue, 31 Jan 2023 13:51:46 +0100 (CET) Received: from mail-pj1-x102e.google.com (mail-pj1-x102e.google.com [IPv6:2607:f8b0:4864:20::102e]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id 1E49E8561C for ; Tue, 31 Jan 2023 13:51:28 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=jh80.chung@gmail.com Received: by mail-pj1-x102e.google.com with SMTP id m11so14145123pji.0 for ; Tue, 31 Jan 2023 04:51:28 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:user-agent:mime-version:date:message-id :from:to:cc:subject:date:message-id:reply-to; bh=IJL2qwhuR6lT/IXIAPJuZyXRtmyE4tfemLOgLA1fn8M=; b=JdsMbwge3sqWfBfx4lcxr5tJxNN4zAVGshF5wIHi6WPmPGpwxBbfkgyny/B3UYO9ou b4whnA1uneLQYdjl6U3RQmUWtQ2oUvNyXhxaBTnEtDAb6fEoLYSrozut/Dgiypd2vaRc Xi5pLxax4PkFVt8RBX0/70Z62g6LVzt/bkoctSQnL+nUIYH7u5cnsSma5KGbdqwz7jts rtRLELp5N9n3dGTjHvakbUmg1G7l/dGsdVRf/mrbr7FgmTlGbzgIEnvhru1b0Mcb4F36 1PANDq1VqAH2X0pdEB6qxJNmfu+/sBPxViVywOhBLcllfKGKxtjqNRo5zzYpynUv26g1 alag== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:user-agent:mime-version:date:message-id :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=IJL2qwhuR6lT/IXIAPJuZyXRtmyE4tfemLOgLA1fn8M=; b=HisptdeBwWeO3RKlfKr5d8pnNjqBmovBSyzYT0vMapc+uwj6VMWCkAXWFQEL8VYwjp rzP4xmSJCjol4pzh4KcTKytpoNUMihK/Gr73Zpm4SQdESikTLnajHFtHMxuKqFhDGGWC QD6otEenZykqOYtuvocgnSWiRN7Cp2mpLcIgC7P5wPqE0uUPlSEwauzNRC3MeaYu6qZr makbFpGvTHFQglOKNN6uJBLVOhi1awCJmqQmkIGa9Bz4r3MiARoqANpdHYyX3r9vWeT/ EXct3NJHbKnhfcw3YkhhLzJBdbrrI+bJQCiYRNj6DZ1ktwECFfLR53XQd761h3Gde2cU wCIQ== X-Gm-Message-State: AFqh2krN92E6HfvF0wVCSzQOE6qqKOaIB/AOPkHOKCT+AR4Ziv75rnq+ 612OCnQnNy20DO4SNdfUiEo= X-Google-Smtp-Source: AMrXdXsU0VKrBh2DGdLV3Lv+ptA2LmEQhgrMvRiUAHyvg0zCMWPlm4SzXmkiekl54EDAMWUmvF5bIw== X-Received: by 2002:a05:6a21:910a:b0:b9:46a1:7f14 with SMTP id tn10-20020a056a21910a00b000b946a17f14mr40608545pzb.56.1675169486364; Tue, 31 Jan 2023 04:51:26 -0800 (PST) Received: from [192.168.0.19] ([183.99.112.216]) by smtp.gmail.com with ESMTPSA id z189-20020a6265c6000000b0058da56167b7sm9348319pfb.127.2023.01.31.04.51.24 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Tue, 31 Jan 2023 04:51:25 -0800 (PST) Message-ID: <7d7540ce-5161-71fc-7b69-4b655f26a716@gmail.com> Date: Tue, 31 Jan 2023 21:51:23 +0900 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.4.2 Subject: Re: [PATCH 03/88] power: Drop fg_max77693 Content-Language: en-US To: Simon Glass , u-boot@lists.denx.de Cc: Tom Rini , Jaehoon Chung References: <20230123220031.3540724-1-sjg@chromium.org> <20230123220031.3540724-4-sjg@chromium.org> From: Jaehoon Chung In-Reply-To: <20230123220031.3540724-4-sjg@chromium.org> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.39 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" X-Virus-Scanned: clamav-milter 0.103.6 at phobos.denx.de X-Virus-Status: Clean On 1/24/23 06:59, Simon Glass wrote: > This is not used in U-Boot. Drop it. > > Signed-off-by: Simon Glass Reviewed-by: Jaehoon Chung Best Regards, Jaehoon Chung > --- > > drivers/power/mfd/Makefile | 1 - > drivers/power/mfd/fg_max77693.c | 137 -------------------------------- > 2 files changed, 138 deletions(-) > delete mode 100644 drivers/power/mfd/fg_max77693.c > > diff --git a/drivers/power/mfd/Makefile b/drivers/power/mfd/Makefile > index a8eb7f81e72..5dfbdbd1b0f 100644 > --- a/drivers/power/mfd/Makefile > +++ b/drivers/power/mfd/Makefile > @@ -5,4 +5,3 @@ > > obj-$(CONFIG_POWER_PMIC_MAX77693) += pmic_max77693.o > obj-$(CONFIG_POWER_MUIC_MAX77693) += muic_max77693.o > -obj-$(CONFIG_POWER_FG_MAX77693) += fg_max77693.o > diff --git a/drivers/power/mfd/fg_max77693.c b/drivers/power/mfd/fg_max77693.c > deleted file mode 100644 > index 983a6d4a2bd..00000000000 > --- a/drivers/power/mfd/fg_max77693.c > +++ /dev/null > @@ -1,137 +0,0 @@ > -// SPDX-License-Identifier: GPL-2.0+ > -/* > - * Copyright (C) 2013 Samsung Electronics > - * Piotr Wilczek > - */ > - > -#include > -#include > -#include > -#include > -#include > -#include > -#include > -#include > -#include > - > -static int max77693_get_vcell(u32 *vcell) > -{ > - u16 value; > - u8 ret; > - > - ret = i2c_read(MAX77693_FUEL_I2C_ADDR, MAX77693_VCELL, 1, > - (u8 *)&value, 2); > - if (ret) > - return ret; > - > - *vcell = (u32)(value >> 3); > - *vcell = *vcell * 625; > - > - return 0; > -} > - > -static int max77693_get_soc(u32 *soc) > -{ > - u16 value; > - u8 ret; > - > - ret = i2c_read(MAX77693_FUEL_I2C_ADDR, MAX77693_VFSOC, 1, > - (u8 *)&value, 2); > - if (ret) > - return ret; > - > - *soc = (u32)(value >> 8); > - > - return 0; > -} > - > -static int power_update_battery(struct pmic *p, struct pmic *bat) > -{ > - struct power_battery *pb = bat->pbat; > - int ret; > - > - if (pmic_probe(p)) { > - puts("Can't find max77693 fuel gauge\n"); > - return -ENODEV; > - } > - > - ret = max77693_get_soc(&pb->bat->state_of_chrg); > - if (ret) > - return ret; > - > - max77693_get_vcell(&pb->bat->voltage_uV); > - > - return 0; > -} > - > -static int power_check_battery(struct pmic *p, struct pmic *bat) > -{ > - struct power_battery *pb = bat->pbat; > - unsigned int val; > - int ret = 0; > - > - if (pmic_probe(p)) { > - puts("Can't find max77693 fuel gauge\n"); > - return -ENODEV; > - } > - > - ret = pmic_reg_read(p, MAX77693_STATUS, &val); > - if (ret) > - return ret; > - debug("fg status: 0x%x\n", val); > - > - ret = pmic_reg_read(p, MAX77693_VERSION, &pb->bat->version); > - if (ret) > - return ret; > - > - ret = power_update_battery(p, bat); > - if (ret) > - return ret; > - debug("fg ver: 0x%x\n", pb->bat->version); > - printf("BAT: state_of_charge(SOC):%d%%\n", > - pb->bat->state_of_chrg); > - > - printf(" voltage: %d.%6.6d [V] (expected to be %d [mAh])\n", > - pb->bat->voltage_uV / 1000000, > - pb->bat->voltage_uV % 1000000, > - pb->bat->capacity); > - > - if (pb->bat->voltage_uV > 3850000) > - pb->bat->state = EXT_SOURCE; > - else if (pb->bat->voltage_uV < 3600000 || pb->bat->state_of_chrg < 5) > - pb->bat->state = CHARGE; > - else > - pb->bat->state = NORMAL; > - > - return 0; > -} > - > -static struct power_fg power_fg_ops = { > - .fg_battery_check = power_check_battery, > - .fg_battery_update = power_update_battery, > -}; > - > -int power_fg_init(unsigned char bus) > -{ > - static const char name[] = "MAX77693_FG"; > - struct pmic *p = pmic_alloc(); > - > - if (!p) { > - printf("%s: POWER allocation error!\n", __func__); > - return -ENOMEM; > - } > - > - debug("Board Fuel Gauge init\n"); > - > - p->name = name; > - p->interface = PMIC_I2C; > - p->number_of_regs = FG_NUM_OF_REGS; > - p->hw.i2c.addr = MAX77693_FUEL_I2C_ADDR; > - p->hw.i2c.tx_num = 2; > - p->sensor_byte_order = PMIC_SENSOR_BYTE_ORDER_BIG; > - p->bus = bus; > - > - p->fg = &power_fg_ops; > - > - return 0; > -}