Tom Rini | 83d290c | 2018-05-06 17:58:06 -0400 | [diff] [blame] | 1 | // SPDX-License-Identifier: GPL-2.0+ |
Simon Glass | 39f7611 | 2014-02-26 15:59:23 -0700 | [diff] [blame] | 2 | /* |
| 3 | * Copyright (c) 2013 Google, Inc |
Simon Glass | 39f7611 | 2014-02-26 15:59:23 -0700 | [diff] [blame] | 4 | */ |
| 5 | |
| 6 | #include <common.h> |
| 7 | #include <dm.h> |
| 8 | #include <dm-demo.h> |
| 9 | |
| 10 | static const struct dm_demo_pdata red_square = { |
| 11 | .colour = "red", |
| 12 | .sides = 4. |
| 13 | }; |
| 14 | static const struct dm_demo_pdata green_triangle = { |
| 15 | .colour = "green", |
| 16 | .sides = 3. |
| 17 | }; |
| 18 | static const struct dm_demo_pdata yellow_hexagon = { |
| 19 | .colour = "yellow", |
| 20 | .sides = 6. |
| 21 | }; |
| 22 | |
Simon Glass | 20e442a | 2020-12-28 20:34:54 -0700 | [diff] [blame^] | 23 | U_BOOT_DRVINFO(demo0) = { |
Simon Glass | 39f7611 | 2014-02-26 15:59:23 -0700 | [diff] [blame] | 24 | .name = "demo_shape_drv", |
Simon Glass | caa4daa | 2020-12-03 16:55:18 -0700 | [diff] [blame] | 25 | .plat = &red_square, |
Simon Glass | 39f7611 | 2014-02-26 15:59:23 -0700 | [diff] [blame] | 26 | }; |
| 27 | |
Simon Glass | 20e442a | 2020-12-28 20:34:54 -0700 | [diff] [blame^] | 28 | U_BOOT_DRVINFO(demo1) = { |
Simon Glass | 39f7611 | 2014-02-26 15:59:23 -0700 | [diff] [blame] | 29 | .name = "demo_simple_drv", |
Simon Glass | caa4daa | 2020-12-03 16:55:18 -0700 | [diff] [blame] | 30 | .plat = &red_square, |
Simon Glass | 39f7611 | 2014-02-26 15:59:23 -0700 | [diff] [blame] | 31 | }; |
| 32 | |
Simon Glass | 20e442a | 2020-12-28 20:34:54 -0700 | [diff] [blame^] | 33 | U_BOOT_DRVINFO(demo2) = { |
Simon Glass | 39f7611 | 2014-02-26 15:59:23 -0700 | [diff] [blame] | 34 | .name = "demo_shape_drv", |
Simon Glass | caa4daa | 2020-12-03 16:55:18 -0700 | [diff] [blame] | 35 | .plat = &green_triangle, |
Simon Glass | 39f7611 | 2014-02-26 15:59:23 -0700 | [diff] [blame] | 36 | }; |
| 37 | |
Simon Glass | 20e442a | 2020-12-28 20:34:54 -0700 | [diff] [blame^] | 38 | U_BOOT_DRVINFO(demo3) = { |
Simon Glass | 39f7611 | 2014-02-26 15:59:23 -0700 | [diff] [blame] | 39 | .name = "demo_simple_drv", |
Simon Glass | caa4daa | 2020-12-03 16:55:18 -0700 | [diff] [blame] | 40 | .plat = &yellow_hexagon, |
Simon Glass | 39f7611 | 2014-02-26 15:59:23 -0700 | [diff] [blame] | 41 | }; |
| 42 | |
Simon Glass | 20e442a | 2020-12-28 20:34:54 -0700 | [diff] [blame^] | 43 | U_BOOT_DRVINFO(demo4) = { |
Simon Glass | 39f7611 | 2014-02-26 15:59:23 -0700 | [diff] [blame] | 44 | .name = "demo_shape_drv", |
Simon Glass | caa4daa | 2020-12-03 16:55:18 -0700 | [diff] [blame] | 45 | .plat = &yellow_hexagon, |
Simon Glass | 39f7611 | 2014-02-26 15:59:23 -0700 | [diff] [blame] | 46 | }; |