From mboxrd@z Thu Jan 1 00:00:00 1970 From: Marek Vasut Date: Fri, 28 Jun 2013 23:46:47 +0200 Subject: [U-Boot] [PATCH v3 11/16] dm: Add a demonstration/example driver In-Reply-To: <1371613960-28678-12-git-send-email-sjg@chromium.org> References: <1371613960-28678-1-git-send-email-sjg@chromium.org> <1371613960-28678-12-git-send-email-sjg@chromium.org> Message-ID: <201306282346.47659.marex@denx.de> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de Dear Simon Glass, > As an example of how to write a uclass and a driver, provide a demo version > of each, accessible through the 'demo' command. > > To use these with driver model, define CONFIG_CMD_DEMO and CONFIG_DM_DEMO. > > The two demo drivers are enabled with CONFIG_DM_DEMO_SIMPLE and > CONFIG_DM_DEMO_SHAPE. > > Signed-off-by: Simon Glass > Signed-off-by: Marek Vasut > Signed-off-by: Pavel Herrmann > Signed-off-by: Viktor K?iv?k > Signed-off-by: Tomas Hlavacek > --- > Changes in v3: > - Fix up demo command help > - Update demo driver to use device tree > > Changes in v2: None [...] > +U_BOOT_DEVICE(demo4) = { > + .name = "demo_shape_drv", > + .platform_data = &yellow_hexagon, > +}; So this is static instantiation of the drivers? [...] > +U_BOOT_DRIVER(demo_simple_drv) = { > + .name = "demo_simple_drv", > + .of_match = demo_shape_id, > + .id = UCLASS_DEMO, > + .probe = demo_shape_probe, > + .ops = &simple_ops, > + .ops = &simple_ops, This .ops is here twice ;-) > + .platform_data_auto_alloc_size = sizeof(struct dm_demo_pdata), > +}; [...] Best regards, Marek Vasut