From patchwork Sun Jan 10 14:01:59 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Linus Walleij X-Patchwork-Id: 360178 Delivered-To: patch@linaro.org Received: by 2002:a17:906:4755:0:0:0:0 with SMTP id j21csp1823234ejs; Sun, 10 Jan 2021 06:06:05 -0800 (PST) X-Google-Smtp-Source: ABdhPJxjV3R2+c6B3MW/dY7fmBkQWr0BfjWzNKptxGptRg4Sv4/Vr7F71nEM3kATk6BnsftXklYs X-Received: by 2002:a50:fc83:: with SMTP id f3mr11443338edq.219.1610287565219; Sun, 10 Jan 2021 06:06:05 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1610287565; cv=none; d=google.com; s=arc-20160816; b=TO+jA4jfenrYk9x9VHKuo/IMtfIaVQN098XFmtK28WhRB4jTLDzzljuTtR/luxcIZp RcM6+NmNy/Mzr7XX+SNbhrjQDR9odOKuh56/tB0xYSuhbdXp87LDRDm6CGd1gnK6+z9W RhAvZH9zxvEjabWmaijnNADks8YUGs078X9ISNeeQUsUqtd24iDb9JyX0N8S2hQMCJG7 0XVjMYJxgLLlppd8/zAUJ3rMWlcR53f0Bl9bGlhagOGL2UfWkcJ3cU2GmUzMs3IdMssK pc7m0UTD0TEy/coXG8hKTawch98/cNZJkYMkFpg1FdfZWji933es6yKuIfpLX51ZwGnV Y4lQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from:dkim-signature; bh=mLjbjqwTG6XEAazNOXknqaBgeFZRwnpR9bYyyAV3nHw=; b=wKrru+bdVnhR61YAHNI26kN9PMKJPR3nwN4kiMR+E7FbV52wY0ijZz5fX1hqxk2ebf AWYxQQOOOWEArgq/6ug05RPpkvVkbKVUwU2soh0mBOXtQ3U+HplNP2XhI6thUW8cint4 zlpGlhn6cTXrvYwN1PO0Z50G3J3deXtggTuXifwcr71AbcqGoBckBilMhJCMxutH5I2l 9p6Fix3KZb7l7ufMvcS2PG0677aVq+iCpxGq5SD04TlS+hZLIjcVBEnIQ3xPP7+LvV45 4bo+x+VAzCmhNGtgNd7fL0QpdY7HqXf7yuQTimXDfsxfBsc5wFiMS6D+nQMW6fpgFUju uqiQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=Wgz8RLsm; spf=pass (google.com: domain of linux-pm-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-pm-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id zc2si5391155ejb.427.2021.01.10.06.06.04; Sun, 10 Jan 2021 06:06:05 -0800 (PST) Received-SPF: pass (google.com: domain of linux-pm-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=@linaro.org header.s=google header.b=Wgz8RLsm; spf=pass (google.com: domain of linux-pm-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-pm-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726534AbhAJOEp (ORCPT + 7 others); Sun, 10 Jan 2021 09:04:45 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:35826 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726250AbhAJOEo (ORCPT ); Sun, 10 Jan 2021 09:04:44 -0500 Received: from mail-lf1-x12e.google.com (mail-lf1-x12e.google.com [IPv6:2a00:1450:4864:20::12e]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id DEC3BC061794 for ; Sun, 10 Jan 2021 06:04:03 -0800 (PST) Received: by mail-lf1-x12e.google.com with SMTP id o10so23143228lfl.13 for ; Sun, 10 Jan 2021 06:04:03 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=mLjbjqwTG6XEAazNOXknqaBgeFZRwnpR9bYyyAV3nHw=; b=Wgz8RLsmSPzqlDJoHKYia63FUD9V1Yx2bJ6GPoiBLqlKiTv887lHUdHzyM5QXQQP1g r7/nM3LgXNRZFjdQMhgfKgxxA9zWEE5BgFc9L6rpCnfv0VQAOeyPJ32NDlp1z+8wxjRq XFYdFCxiN0SW8RS5n9Uq6Zf5B6b5Lh2oSQlKhn/Z0r6KytGWXPN38XTMCW8BcPTcPwlf tikx5l7FQ4ub8jJAfNe4Yg2qFanix0+0PSR0F7TI++/EFOT6qGYMBaVT2cJTENuPjbCB LxPnv5A1immC5vfC3G5fPRuZ4lErGDaNraXQzcLVfEIkA4UrkUieeT5H3KTymnrbbljl dQcA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=mLjbjqwTG6XEAazNOXknqaBgeFZRwnpR9bYyyAV3nHw=; b=tB+wGOwcW3M3b7hVZ6iBkaCxQf1J6Xh2ZVJHxwYcbYzx/dUfmdjKwmS/mshGpZPZWn MgE+wnuflXIvLRh/lyZoI2AnLy0q9bX1LOy0DZEkm7XGdUlhf5spmiQ+zmkrrBttDwTh 6bQeWYqZM7yWkoLDu0plwTPh9z8cRJvwGJquYnLoZ/xjuL2P4/Zh32FqJFEfJR4/vWOe kJDHuI0a1KllnjnEMp+ln/o9Juu44ZSnWJJjMeyPihW6IBOvXCQVXQbyIAVSR+KVE7W7 +1St6aQBVLoQSM/xp+xdSLbWoK35ZRlWs8IyuoKwW+2hhSS7t+1zld5P01qtxW336utK ipRQ== X-Gm-Message-State: AOAM531pDtVHXCnTuZw+TB9fpS9SuNamrYxUvxO563v6AS3DWC1kdYjt i4Gsw43mD3dXf3i74dZwPO7ZnA== X-Received: by 2002:ac2:4149:: with SMTP id c9mr4196944lfi.385.1610287442404; Sun, 10 Jan 2021 06:04:02 -0800 (PST) Received: from localhost.localdomain (c-92d7225c.014-348-6c756e10.bbcust.telenor.se. [92.34.215.146]) by smtp.gmail.com with ESMTPSA id y26sm2981150ljh.63.2021.01.10.06.04.01 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 10 Jan 2021 06:04:01 -0800 (PST) From: Linus Walleij To: Sebastian Reichel Cc: linux-pm@vger.kernel.org, Linus Walleij , Chris Lapa , MyungJoo Ham Subject: [PATCH 1/2] power: supply: max8903: Absorb pdata header Date: Sun, 10 Jan 2021 15:01:59 +0100 Message-Id: <20210110140200.127123-1-linus.walleij@linaro.org> X-Mailer: git-send-email 2.29.2 MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-pm@vger.kernel.org The platform data header is not included by any other file in the kernel but the driver itself. Decomission the stand-alone header and absorb it into the driver itself. Cc: Chris Lapa Cc: MyungJoo Ham Signed-off-by: Linus Walleij --- drivers/power/supply/max8903_charger.c | 32 ++++++++++++++++++- include/linux/power/max8903_charger.h | 43 -------------------------- 2 files changed, 31 insertions(+), 44 deletions(-) delete mode 100644 include/linux/power/max8903_charger.h -- 2.29.2 diff --git a/drivers/power/supply/max8903_charger.c b/drivers/power/supply/max8903_charger.c index 0bd39b0cc257..ab1aa7df985e 100644 --- a/drivers/power/supply/max8903_charger.c +++ b/drivers/power/supply/max8903_charger.c @@ -15,7 +15,37 @@ #include #include #include -#include + +struct max8903_pdata { + /* + * GPIOs + * cen, chg, flt, dcm and usus are optional. + * dok and uok are not optional depending on the status of + * dc_valid and usb_valid. + */ + int cen; /* Charger Enable input */ + int dok; /* DC(Adapter) Power OK output */ + int uok; /* USB Power OK output */ + int chg; /* Charger status output */ + int flt; /* Fault output */ + int dcm; /* Current-Limit Mode input (1: DC, 2: USB) */ + int usus; /* USB Suspend Input (1: suspended) */ + + /* + * DC(Adapter/TA) is wired + * When dc_valid is true, + * dok should be valid. + * + * At least one of dc_valid or usb_valid should be true. + */ + bool dc_valid; + /* + * USB is wired + * When usb_valid is true, + * uok should be valid. + */ + bool usb_valid; +}; struct max8903_data { struct max8903_pdata *pdata; diff --git a/include/linux/power/max8903_charger.h b/include/linux/power/max8903_charger.h deleted file mode 100644 index 02f94a1b323b..000000000000 --- a/include/linux/power/max8903_charger.h +++ /dev/null @@ -1,43 +0,0 @@ -/* SPDX-License-Identifier: GPL-2.0-or-later */ -/* - * max8903_charger.h - Maxim 8903 USB/Adapter Charger Driver - * - * Copyright (C) 2011 Samsung Electronics - * MyungJoo Ham - */ - -#ifndef __MAX8903_CHARGER_H__ -#define __MAX8903_CHARGER_H__ - -struct max8903_pdata { - /* - * GPIOs - * cen, chg, flt, dcm and usus are optional. - * dok and uok are not optional depending on the status of - * dc_valid and usb_valid. - */ - int cen; /* Charger Enable input */ - int dok; /* DC(Adapter) Power OK output */ - int uok; /* USB Power OK output */ - int chg; /* Charger status output */ - int flt; /* Fault output */ - int dcm; /* Current-Limit Mode input (1: DC, 2: USB) */ - int usus; /* USB Suspend Input (1: suspended) */ - - /* - * DC(Adapter/TA) is wired - * When dc_valid is true, - * dok should be valid. - * - * At least one of dc_valid or usb_valid should be true. - */ - bool dc_valid; - /* - * USB is wired - * When usb_valid is true, - * uok should be valid. - */ - bool usb_valid; -}; - -#endif /* __MAX8903_CHARGER_H__ */