From patchwork Thu Oct 15 10:06:48 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Peng Fan X-Patchwork-Id: 317767 Delivered-To: patch@linaro.org Received: by 2002:a92:d603:0:0:0:0:0 with SMTP id w3csp300810ilm; Thu, 15 Oct 2020 02:40:05 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzhyOp5wp2G6HixacsgQHq4iJp5xBmmtqrTlYBHjhXgPKdcQzHbG92jb1Dz4vMAUT+IdEAY X-Received: by 2002:aa7:cd09:: with SMTP id b9mr3310225edw.55.1602754804965; Thu, 15 Oct 2020 02:40:04 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1602754804; cv=pass; d=google.com; s=arc-20160816; b=uPorrYQ3fDhInJGKcFYuXDawGqA4hCCBG0ivBpKlXaWj/WWAtXm4IzQjLOUXFVsLoU HH1KFr7WQB9zIP/UsloLdlwpgw6Ye+jQD6XlpnzSBjyE4RfaY/ehN8iadnQGqfcB4J34 h+3KdSbJR1hcf+svR2igcjgEQfyzZ/ypafDDLOpqTIDUpbNFG/dNxpape3C4DAsDuPHo d5eCY0rFnqpxiLSeeDF2h+mMLBf4PAjztgkkmGOlnC7i1WksURDpGO8y4SLoW3c+szt7 snjauSvva7ujyXc80mU+WCQr/IFjqvDTXt3PvnAjw4iiyUoHl/JDBKkfcZtLdoZZM7vl JkTw== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:mime-version :content-transfer-encoding:message-id:date:subject:cc:to:from :dkim-signature; bh=BPZwurhqYqgLbBlt4T1fEXL81xskjmoryT3xOw5KbFE=; b=oOBR5WILLXxNZjf8lg6fhldN9XFtaufGnslbkHY6+lEtGyfA8yW+04NE2FvMoF13vd 3vPnFyoqTeTEHj3aEZr4Z8P7ML1fiorAKKfaWxtQVimR025GaXHLiHKKv7psN5lSffNW tgDPY7A6YPzp7xZIAfmxJUfB6uoSpomt502e3nCZjzbUft4wq5w6XzeX49egVl1F1B0P lj0uqeJmDaS9GSh9/dewVwSZ09yaCK0QXVH+fc3Rl4PH63LkO+DLqfc6f6W1cIFSALy5 Io7pVRkmQli3K0KggifE6LXYHvQzFs7uqz/uWqgY6KjHnYkhHaTfMosb6pVpeh+qfEP8 lj8w== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@nxp.com header.s=selector2 header.b=AzNxxxI3; arc=pass (i=1 spf=pass spfdomain=nxp.com dkim=pass dkdomain=nxp.com dmarc=pass fromdomain=nxp.com); spf=pass (google.com: domain of u-boot-bounces@lists.denx.de designates 85.214.62.61 as permitted sender) smtp.mailfrom=u-boot-bounces@lists.denx.de; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=nxp.com Return-Path: Received: from phobos.denx.de (phobos.denx.de. [85.214.62.61]) by mx.google.com with ESMTPS id z9si1562271edr.522.2020.10.15.02.40.04 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 15 Oct 2020 02:40:04 -0700 (PDT) Received-SPF: pass (google.com: domain of u-boot-bounces@lists.denx.de designates 85.214.62.61 as permitted sender) client-ip=85.214.62.61; Authentication-Results: mx.google.com; dkim=pass header.i=@nxp.com header.s=selector2 header.b=AzNxxxI3; arc=pass (i=1 spf=pass spfdomain=nxp.com dkim=pass dkdomain=nxp.com dmarc=pass fromdomain=nxp.com); spf=pass (google.com: domain of u-boot-bounces@lists.denx.de designates 85.214.62.61 as permitted sender) smtp.mailfrom=u-boot-bounces@lists.denx.de; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=nxp.com Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 28B9A81281; Thu, 15 Oct 2020 11:40:04 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=nxp.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Authentication-Results: phobos.denx.de; dkim=pass (1024-bit key; unprotected) header.d=nxp.com header.i=@nxp.com header.b="AzNxxxI3"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id DA372821ED; Thu, 15 Oct 2020 11:40:02 +0200 (CEST) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on phobos.denx.de X-Spam-Level: X-Spam-Status: No, score=-1.0 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FORGED_SPF_HELO,MSGID_FROM_MTA_HEADER, SPF_HELO_PASS,URIBL_BLOCKED autolearn=no autolearn_force=no version=3.4.2 Received: from EUR05-DB8-obe.outbound.protection.outlook.com (mail-db8eur05on20620.outbound.protection.outlook.com [IPv6:2a01:111:f400:7e1a::620]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id 6BDB3806C5 for ; Thu, 15 Oct 2020 11:40:00 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=nxp.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=peng.fan@nxp.com ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=amCpqH++PMLWQn+Ibf5jjzgjcuuC/Le1KBC4LVNT2EbYSToMDy9MxxpulVm4Qk8ziYpk8LXHJvc0+qZ14fB0xmHmlM0rS8xtUKtaa4L1kt++YMHOM20BGDfqy5BXk0v+ermwQxsF5x01Y9RTsDMgmr2pEtVaMswbF1q3gzmySziqSqQXClL89VYLbrXvxfoPokJTq6LQYS1yaRnxahXq3Lt+k5SaDpVKuwMtQ23vB+Lui2xeadBD9HIwBBrHcDZqnen44MedS+tB0ahaQsuPr1+kXOXzBkuOJYlahPKxc7RGj1T05cXfJCmhXIn38w/UV1Ekua4dUcRuohWQ9N/EcQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=BPZwurhqYqgLbBlt4T1fEXL81xskjmoryT3xOw5KbFE=; b=MIyeTewKrZdv9duw+cJpU38VEw8kgOPFUGdSagwWK0SoQG0FQywjBePM6gV+dDADQokwrFJxB8mPxehRW43tmOiKDfa2VgIMWbAxJWaYwlielfL21iVbKhOEosUx9agIUIz7ZlW/2nY8urxyiBN/4aodIOAS6z1bV4Z1YFEBQ6KSzlAy9c1ifwbUXBTMlqCIj8T6cQ8ULq2wLTQRwlMgaxLuOrSps2VVPWMYg9IS7SGR01lL4bYsSZbGskNp6wuBO5P4GnbMW9qdl+aPJLtiMnzGhcWEGBdb0tLpNtMmyZlEQ3YyV+xNv0z9sIzYrNfxl3sTYZnx65LlMh5VM5+Cfw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=nxp.com; dmarc=pass action=none header.from=nxp.com; dkim=pass header.d=nxp.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nxp.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=BPZwurhqYqgLbBlt4T1fEXL81xskjmoryT3xOw5KbFE=; b=AzNxxxI3FWi/RjdOjtJcZyyHiudY/MCCqU4ruB2m1qM4IsNiINlkST09hpsBXR7UgdZxuR1753kQz3klUdWbe2Htb4JvHIOZrn6FziIkURh60PZU3pKtymQ0n5eCGxIt5hZTrDbzQo5dz+9OrKn+9V8A/mtrJ0S/tD31FgLMYHc= Authentication-Results: denx.de; dkim=none (message not signed) header.d=none;denx.de; dmarc=none action=none header.from=nxp.com; Received: from DB6PR0402MB2760.eurprd04.prod.outlook.com (2603:10a6:4:a1::14) by DB8PR04MB7050.eurprd04.prod.outlook.com (2603:10a6:10:129::24) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3455.24; Thu, 15 Oct 2020 09:39:59 +0000 Received: from DB6PR0402MB2760.eurprd04.prod.outlook.com ([fe80::35c5:8c71:91f3:6bc6]) by DB6PR0402MB2760.eurprd04.prod.outlook.com ([fe80::35c5:8c71:91f3:6bc6%12]) with mapi id 15.20.3455.031; Thu, 15 Oct 2020 09:39:59 +0000 From: Peng Fan To: sbabic@denx.de, festevam@gmail.com, trini@konsulko.com Cc: uboot-imx@nxp.com, u-boot@lists.denx.de, Peng Fan Subject: [PATCH] power: regulator: add dummy helper Date: Thu, 15 Oct 2020 18:06:48 +0800 Message-Id: <20201015100648.2789-1-peng.fan@nxp.com> X-Mailer: git-send-email 2.28.0 X-Originating-IP: [119.31.174.71] X-ClientProxiedBy: SG2PR02CA0032.apcprd02.prod.outlook.com (2603:1096:3:18::20) To DB6PR0402MB2760.eurprd04.prod.outlook.com (2603:10a6:4:a1::14) MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 Received: from linux-1xn6.ap.freescale.net (119.31.174.71) by SG2PR02CA0032.apcprd02.prod.outlook.com (2603:1096:3:18::20) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3477.21 via Frontend Transport; Thu, 15 Oct 2020 09:39:57 +0000 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-HT: Tenant X-MS-Office365-Filtering-Correlation-Id: 4ea8b71a-64a4-483c-2e9d-08d870ee484b X-MS-TrafficTypeDiagnostic: DB8PR04MB7050: X-MS-Exchange-Transport-Forked: True X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:2512; X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: zLuV4XR6uCCPOtrjhMbRJlHjDN1LswNyr0615mEllV/6W74kPb1/kNEy5ofWQSdWPongPpQ2bqv01cQmACu//rjP+cAAChpg5mMO2v4gFISPKi1VwXgHaFddiPqAjO00DENDT/tmy9NqGCEo4L0IF0b3PJ2W0ycuIfnGvoeEe+LQ0/BSTafzebQ+acA7WrNMGQHmRIZmHMr+Ex3T0CyLD/2lSuayrwhs+OQYQio7uvbQ/PnsnUXyfuInPSQjnzu6/edtHFoe9OjGFHepttrioSJLvmfvMg3gRhiaX1IP2dRA87F6fUsFd3jhwNWPpttJm8XBKsCtSkeGb3XqdzbfB9o+oTwkqGDmjcMPspVadpIzsmVBiuT8BNOtBrHeHKE/ X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:DB6PR0402MB2760.eurprd04.prod.outlook.com; PTR:; CAT:NONE; SFS:(4636009)(39860400002)(346002)(376002)(136003)(396003)(366004)(6506007)(86362001)(8676002)(6486002)(2906002)(478600001)(52116002)(956004)(4326008)(6666004)(34490700002)(1076003)(2616005)(44832011)(36756003)(83380400001)(6512007)(66476007)(8936002)(186003)(316002)(16526019)(66946007)(66556008)(5660300002)(26005); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData: /cX174kWtRwfDRHD4TPFyHjuBcY3PTILc+enDxbbdVoTAylGpvhEFhuqncrLeonPAXqKWuZI+V0Z76zH4Rjjkv2bUsSTbG5kxNLvikfuqeMOj1sPbjnuquC/+YcnBj0LVZ+mrSRCapvE0zkIB79MOSh2Gj2/Lflm6CIaezl6fkXmtZHVz9wH8maLUS8MxDhXA7CDYaR+ihf/lbTyrGM73jCLs1mm/hh8qLHOERByxS+uT8F9wNRI5ihTJHaNZztxKeZzB3gFpWRWitv2678e8qhB5IWT+KjFCJrm+/jrbW1hFgvvA5pPtz8QzWBqFkWW5XCDel2vnpacALJkuLfQNvLLWMoLy7tmJQzkQpi81b5vix8dNeJjxMVqrcITxW/I6cbH9lGCV9h/FOy+zoCK/cLyVZolMGHVTLon8NdfvrCg4Ni8VOu+2BB0OBcAbN5iAobfZlPJQ7qxM0vTw+iw4+RhbmuCCPhETp3xvBfMxCY8kU4jer38s0QtT+9XJHxsco81YkAQlv3TwaNbS2Q3TWC9SS0nneJjF6aZiUMpCSGjLo1sUbOvqZ7UfwZAz0giw0nvsAPAtusTnsci6LZiPrTBFU5FNmKWzhL7VRRqEqZExlCQOb5IBoYIIMQi9CWTBdLbnwDJfyB2n33iR6AKXA== X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: 4ea8b71a-64a4-483c-2e9d-08d870ee484b X-MS-Exchange-CrossTenant-AuthSource: DB6PR0402MB2760.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 15 Oct 2020 09:39:59.3857 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 686ea1d3-bc2b-4c6f-a92c-d99c5c301635 X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: ueORJxtcL5wLcpPxxbH9+mgh09UaLaCn3Otqhmq20xzyR9mV32qIU9D/UaaXnzb5LpiEDT9REa8qzjnNHBgH+Q== X-MS-Exchange-Transport-CrossTenantHeadersStamped: DB8PR04MB7050 X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.34 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.102.3 at phobos.denx.de X-Virus-Status: Clean Add dummy helper to enabling the header could be included when DM REGULATOR not enabled. Signed-off-by: Peng Fan --- include/power/regulator.h | 114 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 114 insertions(+) -- 2.28.0 diff --git a/include/power/regulator.h b/include/power/regulator.h index 74938dd61e..7f278e8c7d 100644 --- a/include/power/regulator.h +++ b/include/power/regulator.h @@ -264,6 +264,7 @@ struct dm_regulator_ops { int (*set_mode)(struct udevice *dev, int mode_id); }; +#if CONFIG_IS_ENABLED(DM_REGULATOR) /** * regulator_mode: returns a pointer to the array of regulator mode info * @@ -524,5 +525,118 @@ int regulator_get_by_platname(const char *platname, struct udevice **devp); */ int device_get_supply_regulator(struct udevice *dev, const char *supply_name, struct udevice **devp); +#else +static inline int regulator_mode(struct udevice *dev, struct dm_regulator_mode **modep) +{ + return -ENOSYS; +} + +static inline int regulator_get_value(struct udevice *dev) +{ + return -ENOSYS; +} + +static inline int regulator_set_value(struct udevice *dev, int uV) +{ + return -ENOSYS; +} + +static inline int regulator_set_suspend_value(struct udevice *dev, int uV) +{ + return -ENOSYS; +} + +static inline int regulator_get_suspend_value(struct udevice *dev) +{ + return -ENOSYS; +} + +static inline int regulator_set_value_force(struct udevice *dev, int uV) +{ + return -ENOSYS; +} + +static inline int regulator_get_current(struct udevice *dev) +{ + return -ENOSYS; +} + +static inline int regulator_set_current(struct udevice *dev, int uA) +{ + return -ENOSYS; +} + +static inline int regulator_get_enable(struct udevice *dev) +{ + return -ENOSYS; +} + +static inline int regulator_set_enable(struct udevice *dev, bool enable) +{ + return -ENOSYS; +} + +static inline int regulator_set_enable_if_allowed(struct udevice *dev, bool enable) +{ + return -ENOSYS; +} + +static inline int regulator_set_suspend_enable(struct udevice *dev, bool enable) +{ + return -ENOSYS; +} + +static inline int regulator_get_suspend_enable(struct udevice *dev) +{ + return -ENOSYS; +} + +static inline int regulator_get_mode(struct udevice *dev) +{ + return -ENOSYS; +} + +static inline int regulator_set_mode(struct udevice *dev, int mode_id) +{ + return -ENOSYS; +} + +static inline int regulators_enable_boot_on(bool verbose) +{ + return -ENOSYS; +} + +static inline int regulator_autoset(struct udevice *dev) +{ + return -ENOSYS; +} + +static inline int regulator_autoset_by_name(const char *platname, struct udevice **devp) +{ + return -ENOSYS; +} + +static inline int regulator_list_autoset(const char *list_platname[], struct udevice *list_devp[], + bool verbose) +{ + return -ENOSYS; +} + +static inline int regulator_get_by_devname(const char *devname, struct udevice **devp) +{ + return -ENOSYS; +} + +static inline int regulator_get_by_platname(const char *platname, struct udevice **devp) +{ + return -ENOSYS; +} + +static inline int device_get_supply_regulator(struct udevice *dev, const char *supply_name, + struct udevice **devp) +{ + return -ENOSYS; +} +#endif #endif /* _INCLUDE_REGULATOR_H_ */