|
8 | 8 | #include <linux/bug.h> |
9 | 9 | #include <linux/completion.h> |
10 | 10 | #include <linux/device.h> |
| 11 | +#include <linux/idr.h> |
11 | 12 | #include <linux/irq.h> |
12 | 13 | #include <linux/irqdomain.h> |
13 | 14 | #include <linux/lockdep_types.h> |
@@ -50,6 +51,7 @@ struct sdw_slave; |
50 | 51 |
|
51 | 52 | #define SDW_FRAME_CTRL_BITS 48 |
52 | 53 | #define SDW_MAX_DEVICES 11 |
| 54 | +#define SDW_FW_MAX_DEVICES 16 |
53 | 55 |
|
54 | 56 | #define SDW_MAX_PORTS 15 |
55 | 57 | #define SDW_VALID_PORT_RANGE(n) ((n) < SDW_MAX_PORTS && (n) >= 1) |
@@ -630,6 +632,7 @@ struct sdw_slave_ops { |
630 | 632 | * struct sdw_slave - SoundWire Slave |
631 | 633 | * @id: MIPI device ID |
632 | 634 | * @dev: Linux device |
| 635 | + * @index: internal ID for this slave |
633 | 636 | * @irq: IRQ number |
634 | 637 | * @status: Status reported by the Slave |
635 | 638 | * @bus: Bus handle |
@@ -661,6 +664,7 @@ struct sdw_slave_ops { |
661 | 664 | struct sdw_slave { |
662 | 665 | struct sdw_slave_id id; |
663 | 666 | struct device dev; |
| 667 | + int index; |
664 | 668 | int irq; |
665 | 669 | enum sdw_slave_status status; |
666 | 670 | struct sdw_bus *bus; |
@@ -968,6 +972,7 @@ struct sdw_stream_runtime { |
968 | 972 | * @md: Master device |
969 | 973 | * @bus_lock_key: bus lock key associated to @bus_lock |
970 | 974 | * @bus_lock: bus lock |
| 975 | + * @slave_ida: IDA for allocating internal slave IDs |
971 | 976 | * @slaves: list of Slaves on this bus |
972 | 977 | * @msg_lock_key: message lock key associated to @msg_lock |
973 | 978 | * @msg_lock: message lock |
@@ -1010,6 +1015,7 @@ struct sdw_bus { |
1010 | 1015 | struct sdw_master_device *md; |
1011 | 1016 | struct lock_class_key bus_lock_key; |
1012 | 1017 | struct mutex bus_lock; |
| 1018 | + struct ida slave_ida; |
1013 | 1019 | struct list_head slaves; |
1014 | 1020 | struct lock_class_key msg_lock_key; |
1015 | 1021 | struct mutex msg_lock; |
|
0 commit comments