1 // SPDX-License-Identifier: GPL-2.0+
3 * Copyright (c) 2013 Google, Inc
6 * Pavel Herrmann <morpheus.ibis@gmail.com>
15 static int simple_hello(struct udevice *dev, int ch)
17 const struct dm_demo_pdata *pdata = dev_get_platdata(dev);
19 printf("Hello from %08x: %s %d\n", (uint)map_to_sysmem(dev), pdata->colour,
25 static const struct demo_ops simple_ops = {
26 .hello = simple_hello,
29 static int demo_shape_ofdata_to_platdata(struct udevice *dev)
31 /* Parse the data that is common with all demo devices */
32 return demo_parse_dt(dev);
35 static const struct udevice_id demo_shape_id[] = {
40 U_BOOT_DRIVER(demo_simple_drv) = {
41 .name = "demo_simple_drv",
42 .of_match = demo_shape_id,
44 .ofdata_to_platdata = demo_shape_ofdata_to_platdata,
46 .platdata_auto_alloc_size = sizeof(struct dm_demo_pdata),