lkml.org 
[lkml]   [2021]   [Nov]   [2]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH v6 7/9] PCI: brcmstb: Add control of subdevice voltage regulators
On Fri, Oct 29, 2021 at 04:03:15PM -0400, Jim Quinlan wrote:
> This Broadcom STB PCIe RC driver has one port and connects directly to one
> device, be it a switch or an endpoint. We want to be able to turn on/off
> any regulators for that device. Control of regulators is needed because of
> the chicken-and-egg situation: although the regulator is "owned" by the
> device and would be best handled by its driver, the device cannot be
> discovered and probed unless its regulator is already turned on.

I think this can be done in a much more simple way that avoids the
prior patches using the pci_ops.add_bus() (and remove_bus()) hook.
add_bus is called before the core scans a child bus. In the handler, you
just need to get the bridge device, then the bridge DT node, and then
get the regulators and enable.

Given we're talking about standard properties in a standard (bridge)
node, I think the implementation for .add_bus should be common
(drivers/pci/of.c). It doesn't scale to be doing this in every host
bridge driver.

Rob

\
 
 \ /
  Last update: 2021-11-02 17:01    [W:0.171 / U:1.084 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site