Received: by 2002:a05:6a10:1d13:0:0:0:0 with SMTP id pp19csp2870034pxb; Sun, 29 Aug 2021 06:14:07 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyRTLe/IaiSds/U6mz66uou9gEMYitNmRb5EQytSLULudhl5+j8E9eTY9If6NQuxaoQFMFK X-Received: by 2002:a92:ca89:: with SMTP id t9mr13504630ilo.178.1630242847718; Sun, 29 Aug 2021 06:14:07 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1630242847; cv=none; d=google.com; s=arc-20160816; b=tGUUBL8YvPTmNV+52la96aajpSe2SL73mCKMOlhuXKWg2sM5KI7Zv5YFY5kO0Cd0+h 0lXBjDbiPVcYtKV4tb800Mbj4QmFDL9BPeS2T5BSr1sV9taB3FGAnX7PiyziA5f9h5Ch TnfXHEj7wtYLDUjHz0ZMdzA5I5nZY/QQQ4Fz4xbqaRqGzb3UnqsCpRFWL7L5VOwX/eBq JPJc7PsvfK+hrO62EFd7XB5uj0b7hsNI7QSaKy0l6Bm7RUkxw7gEt/qJ+QYygeQLEFUo 1y+NdtOhwm/Nt/iqWH79QwI56k0acpRQNx91vTaC9CYxMMk/gv4T6SrHZ/0SP1i4VRH7 6AUw== 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=VaIELk3aejG928b4attVmLHeHooVAXSsVOw7u++6ic8=; b=TBXCpj6Rxf2qnW/nwjJwC+fDCmA3MqWj+ozOvPyLZ0/fdnppN/XG0n5xPfo71uFtR9 zof2VLbzXUj7zGavoL4eoFYnfqBPHpfTXQa6F9nmRfnd0Vr1b3tFOq3Z5Xik8DA+2VP+ i26RXSNN3iXh4Nxte5Sx+jNxyllQeiaLVfAgo8dmt1Ol2WCtwbe2zNSbaFKA44IU/XW8 KdJCM+AAbUUw0Gx+8qHwj5rP0tJHMrx7e+HT4tLXvWDYoGO+MKxrQdsq14eF6rKHBLK3 MFG111o++gGWAotwPab+RxXhYlaQfCeyPuaBeHygI+kZKzDeL9TRl+g6DeJuZaqgFp08 HmBA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=NBuVmcUE; spf=pass (google.com: domain of linux-wireless-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-wireless-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 u13si13622327jak.109.2021.08.29.06.13.18; Sun, 29 Aug 2021 06:14:07 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-wireless-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=NBuVmcUE; spf=pass (google.com: domain of linux-wireless-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-wireless-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 S235385AbhH2NOE (ORCPT + 99 others); Sun, 29 Aug 2021 09:14:04 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46956 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235350AbhH2NOD (ORCPT ); Sun, 29 Aug 2021 09:14:03 -0400 Received: from mail-lf1-x129.google.com (mail-lf1-x129.google.com [IPv6:2a00:1450:4864:20::129]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 8D8AEC06175F for ; Sun, 29 Aug 2021 06:13:11 -0700 (PDT) Received: by mail-lf1-x129.google.com with SMTP id b4so25203262lfo.13 for ; Sun, 29 Aug 2021 06:13:11 -0700 (PDT) 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=VaIELk3aejG928b4attVmLHeHooVAXSsVOw7u++6ic8=; b=NBuVmcUEZj+2izFzWo7km7GIur/VKIWIdCygLu4Gtd5j+RVmNsWMrgh04N2TZuSMfU qOCfcwDEjE8ZtdKrslnPtXszndze+62w2XWwb6xGVsH1q3jBWtuTLCb9KuSLNbPPRhlK IbpDOICgqNbLc24No+PMG8DhLUM2mN/elJS0GRGV4rFr6iSEdeGZxaI/ykar8IBYY9uy Mctoi0prxcBGI+UT9DvbqIAUUP2Iz4yWSGuhWEeXcrakwQ1fy45teTG3uj0aqnye2YP6 lXtLTZX24wvaqQuWHyNbc/msMLpxxBuORKzKEUoSATLWOgQ2fAAvsiPWesmAzPXBNpqI WsVQ== 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=VaIELk3aejG928b4attVmLHeHooVAXSsVOw7u++6ic8=; b=W1dRmX6PfYehIEmf3vrtSXW0zMnZvXPBbl8kMtMRxFn9AG4mAf8ryKYqnavYRHMsWr w4FrEOb5+2k7AXXqXvEZbEqfxAU7dMdobc+8Ez3J6K1hiwmwFEB+/g5Xm3GBLIBugHfb sBJjtaFAjAMyNbG95LqdS58ty1a+nm/4u9YPPRxGCZd725TF53A34m0nyP8YZK+Exata 7POFxmyPmY3MLbDSb1gVMoNAqtiXEOy/aB8anW8jeMjpoXmhmtcCzQ1USoQVvpnDcGp8 0PvIvkI/eIQvrp+DcawLhmVTo60w7hKiYbn9PC5v/GNAvoeO2o5DSYLrcRwXOUOyTu8t 8ufw== X-Gm-Message-State: AOAM533ng0VUqOD5bLL8AK3rilfKUEGL9JJ66ae+rRODRx9Qrr/lr7Xd 73PHMakMs7Gj1zoueF2chQHMzg== X-Received: by 2002:a05:6512:6cd:: with SMTP id u13mr13935373lff.184.1630242789821; Sun, 29 Aug 2021 06:13:09 -0700 (PDT) Received: from eriador.lan ([37.153.55.125]) by smtp.gmail.com with ESMTPSA id x13sm712503lfq.262.2021.08.29.06.13.09 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 29 Aug 2021 06:13:09 -0700 (PDT) From: Dmitry Baryshkov To: Andy Gross , Bjorn Andersson , Ulf Hansson , Marcel Holtmann , Johan Hedberg , Luiz Augusto von Dentz , Kalle Valo , "David S. Miller" , Jakub Kicinski , Stanimir Varbanov Cc: linux-arm-msm@vger.kernel.org, linux-mmc@vger.kernel.org, linux-kernel@vger.kernel.org, linux-bluetooth@vger.kernel.org, ath10k@lists.infradead.org, linux-wireless@vger.kernel.org, netdev@vger.kernel.org Subject: [RFC v2 00/13] create power sequencing subsystem Date: Sun, 29 Aug 2021 16:12:52 +0300 Message-Id: <20210829131305.534417-1-dmitry.baryshkov@linaro.org> X-Mailer: git-send-email 2.33.0 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org This is the second RFC on the proposed power sequencer subsystem. This is a generification of the MMC pwrseq code. The subsystem tries to abstract the idea of complex power-up/power-down/reset of the devices. To ease migration to pwrseq and to provide compatibility with older device trees, while keeping drivers simple, this iteration of RFC introduces pwrseq fallback support: pwrseq driver can register fallback providers. If another device driver requests pwrseq instance and none was declared, the pwrseq fallback code would go through the list of fallback providers and if the match is found, driver would return a crafted pwrseq instance. For now this mechanism is limited to the OF device matching, but it can be extended further to use any combination of device IDs. The primary set of devices that promted me to create this patchset is the Qualcomm BT+WiFi family of chips. They reside on serial+platform or serial + SDIO interfaces (older generations) or on serial+PCIe (newer generations). They require a set of external voltage regulators to be powered on and (some of them) have separate WiFi and Bluetooth enable GPIOs. This patchset being an RFC tries to demonstrate the approach, design and usage of the pwrseq subsystem. Following issues are present in the RFC at this moment but will be fixed later if the overall approach would be viewed as acceptable: - No documentation While the code tries to be self-documenting proper documentation would be required. - Minimal device tree bindings changes There are no proper updates for the DT bindings (thus neither Rob Herring nor devicetree are included in the To/Cc lists). The dt schema changes would be a part of v1. - Lack of proper PCIe integration At this moment support for PCIe is hacked up to be able to test the PCIe part of qca6390. Proper PCIe support would require automatically powering up the devices before the bus scan depending on the proper device structure in the device tree. Changes since RFC v1: - Provider pwrseq fallback support - Implement fallback support in pwrseq_qca. - Mmove susclk handling to pwrseq_qca. - Significantly simplify hci_qca.c changes, by dropping all legacy code. Now hci_qca uses only pwrseq calls to power up/down bluetooth parts of the chip.