From mboxrd@z Thu Jan 1 00:00:00 1970 From: Marek Vasut Date: Fri, 3 May 2019 11:57:03 +0200 Subject: [U-Boot] [PATCH v1 03/18] dm: Add a No-op uclass In-Reply-To: <1f71a842-5bd3-d1e2-078c-701b833e1e6f@ti.com> References: <20190405125554.18070-1-jjhiblot@ti.com> <20190405125554.18070-4-jjhiblot@ti.com> <87a23ab4-c03d-c005-b00c-b0e08eca3ba7@gmail.com> <1f71a842-5bd3-d1e2-078c-701b833e1e6f@ti.com> Message-ID: List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 8bit To: u-boot@lists.denx.de On 5/3/19 11:30 AM, Jean-Jacques Hiblot wrote: > > On 29/04/2019 11:56, Marek Vasut wrote: >> On 4/5/19 2:55 PM, Jean-Jacques Hiblot wrote: >>> This uclass is intended for devices that do not need any features >>> from the >>> uclass, including binding children. >>> This will typically be used by devices that are used to bind child >>> devices >>> but do not use dm_scan_fdt_dev() to do it. That is for example the >>> case of >>> several USB wrappers that have 2 child devices (1 for device and 1 for >>> host) but bind only one at a any given time. >>> >>> Signed-off-by: Jean-Jacques Hiblot >> Could this be UCLASS_BUS or some sort of simple bus ? > > The reason we need a new UCLASS is that MISC or SIMPLE_BUS bind all > their child devices. The dwc3 wrapper and maybe others too, need to bind > only one of its 2 children (host or device) You can return -ENODEV from bind for one of the two devices, but maybe that's not helping you ? >> Anyway, +CC Simon. >> >>> --- >>> >>>   drivers/core/uclass.c  | 5 +++++ >>>   include/dm/uclass-id.h | 1 + >>>   2 files changed, 6 insertions(+) >>> >>> diff --git a/drivers/core/uclass.c b/drivers/core/uclass.c >>> index fc3157de39..dc9eb62893 100644 >>> --- a/drivers/core/uclass.c >>> +++ b/drivers/core/uclass.c >>> @@ -757,3 +757,8 @@ int uclass_pre_remove_device(struct udevice *dev) >>>       return 0; >>>   } >>>   #endif >>> + >>> +UCLASS_DRIVER(nop) = { >>> +    .id        = UCLASS_NOP, >>> +    .name        = "nop", >>> +}; >>> diff --git a/include/dm/uclass-id.h b/include/dm/uclass-id.h >>> index 86e59781b0..3797cd48f6 100644 >>> --- a/include/dm/uclass-id.h >>> +++ b/include/dm/uclass-id.h >>> @@ -61,6 +61,7 @@ enum uclass_id { >>>       UCLASS_MMC,        /* SD / MMC card or chip */ >>>       UCLASS_MOD_EXP,        /* RSA Mod Exp device */ >>>       UCLASS_MTD,        /* Memory Technology Device (MTD) device */ >>> +    UCLASS_NOP,        /* No-op devices */ >>>       UCLASS_NORTHBRIDGE,    /* Intel Northbridge / SDRAM controller */ >>>       UCLASS_NVME,        /* NVM Express device */ >>>       UCLASS_PANEL,        /* Display panel, such as an LCD */ >>> >> -- Best regards, Marek Vasut