@@ -855,79 +855,6 @@ struct sdw_master_ops {
855
855
int dev_num );
856
856
};
857
857
858
- /**
859
- * struct sdw_bus - SoundWire bus
860
- * @dev: Shortcut to &bus->md->dev to avoid changing the entire code.
861
- * @md: Master device
862
- * @bus_lock_key: bus lock key associated to @bus_lock
863
- * @bus_lock: bus lock
864
- * @slaves: list of Slaves on this bus
865
- * @msg_lock_key: message lock key associated to @msg_lock
866
- * @msg_lock: message lock
867
- * @m_rt_list: List of Master instance of all stream(s) running on Bus. This
868
- * is used to compute and program bus bandwidth, clock, frame shape,
869
- * transport and port parameters
870
- * @defer_msg: Defer message
871
- * @params: Current bus parameters
872
- * @stream_refcount: number of streams currently using this bus
873
- * @ops: Master callback ops
874
- * @port_ops: Master port callback ops
875
- * @prop: Master properties
876
- * @vendor_specific_prop: pointer to non-standard properties
877
- * @hw_sync_min_links: Number of links used by a stream above which
878
- * hardware-based synchronization is required. This value is only
879
- * meaningful if multi_link is set. If set to 1, hardware-based
880
- * synchronization will be used even if a stream only uses a single
881
- * SoundWire segment.
882
- * @controller_id: system-unique controller ID. If set to -1, the bus @id will be used.
883
- * @link_id: Link id number, can be 0 to N, unique for each Controller
884
- * @id: bus system-wide unique id
885
- * @compute_params: points to Bus resource management implementation
886
- * @assigned: Bitmap for Slave device numbers.
887
- * Bit set implies used number, bit clear implies unused number.
888
- * @clk_stop_timeout: Clock stop timeout computed
889
- * @bank_switch_timeout: Bank switch timeout computed
890
- * @domain: IRQ domain
891
- * @irq_chip: IRQ chip
892
- * @debugfs: Bus debugfs (optional)
893
- * @multi_link: Store bus property that indicates if multi links
894
- * are supported. This flag is populated by drivers after reading
895
- * appropriate firmware (ACPI/DT).
896
- * @lane_used_bandwidth: how much bandwidth in bits per second is used by each lane
897
- */
898
- struct sdw_bus {
899
- struct device * dev ;
900
- struct sdw_master_device * md ;
901
- struct lock_class_key bus_lock_key ;
902
- struct mutex bus_lock ;
903
- struct list_head slaves ;
904
- struct lock_class_key msg_lock_key ;
905
- struct mutex msg_lock ;
906
- struct list_head m_rt_list ;
907
- struct sdw_defer defer_msg ;
908
- struct sdw_bus_params params ;
909
- int stream_refcount ;
910
- const struct sdw_master_ops * ops ;
911
- const struct sdw_master_port_ops * port_ops ;
912
- struct sdw_master_prop prop ;
913
- void * vendor_specific_prop ;
914
- int hw_sync_min_links ;
915
- int controller_id ;
916
- unsigned int link_id ;
917
- int id ;
918
- int (* compute_params )(struct sdw_bus * bus );
919
- DECLARE_BITMAP (assigned , SDW_MAX_DEVICES );
920
- unsigned int clk_stop_timeout ;
921
- u32 bank_switch_timeout ;
922
- struct irq_chip irq_chip ;
923
- struct irq_domain * domain ;
924
- #ifdef CONFIG_DEBUG_FS
925
- struct dentry * debugfs ;
926
- #endif
927
- bool multi_link ;
928
- unsigned int lane_used_bandwidth [SDW_MAX_LANES ];
929
- };
930
-
931
858
int sdw_bus_master_add (struct sdw_bus * bus , struct device * parent ,
932
859
struct fwnode_handle * fwnode );
933
860
void sdw_bus_master_delete (struct sdw_bus * bus );
@@ -1017,10 +944,83 @@ struct sdw_stream_runtime {
1017
944
struct list_head master_list ;
1018
945
};
1019
946
947
+ /**
948
+ * struct sdw_bus - SoundWire bus
949
+ * @dev: Shortcut to &bus->md->dev to avoid changing the entire code.
950
+ * @md: Master device
951
+ * @bus_lock_key: bus lock key associated to @bus_lock
952
+ * @bus_lock: bus lock
953
+ * @slaves: list of Slaves on this bus
954
+ * @msg_lock_key: message lock key associated to @msg_lock
955
+ * @msg_lock: message lock
956
+ * @m_rt_list: List of Master instance of all stream(s) running on Bus. This
957
+ * is used to compute and program bus bandwidth, clock, frame shape,
958
+ * transport and port parameters
959
+ * @defer_msg: Defer message
960
+ * @params: Current bus parameters
961
+ * @stream_refcount: number of streams currently using this bus
962
+ * @ops: Master callback ops
963
+ * @port_ops: Master port callback ops
964
+ * @prop: Master properties
965
+ * @vendor_specific_prop: pointer to non-standard properties
966
+ * @hw_sync_min_links: Number of links used by a stream above which
967
+ * hardware-based synchronization is required. This value is only
968
+ * meaningful if multi_link is set. If set to 1, hardware-based
969
+ * synchronization will be used even if a stream only uses a single
970
+ * SoundWire segment.
971
+ * @controller_id: system-unique controller ID. If set to -1, the bus @id will be used.
972
+ * @link_id: Link id number, can be 0 to N, unique for each Controller
973
+ * @id: bus system-wide unique id
974
+ * @compute_params: points to Bus resource management implementation
975
+ * @assigned: Bitmap for Slave device numbers.
976
+ * Bit set implies used number, bit clear implies unused number.
977
+ * @clk_stop_timeout: Clock stop timeout computed
978
+ * @bank_switch_timeout: Bank switch timeout computed
979
+ * @domain: IRQ domain
980
+ * @irq_chip: IRQ chip
981
+ * @debugfs: Bus debugfs (optional)
982
+ * @multi_link: Store bus property that indicates if multi links
983
+ * are supported. This flag is populated by drivers after reading
984
+ * appropriate firmware (ACPI/DT).
985
+ * @lane_used_bandwidth: how much bandwidth in bits per second is used by each lane
986
+ */
987
+ struct sdw_bus {
988
+ struct device * dev ;
989
+ struct sdw_master_device * md ;
990
+ struct lock_class_key bus_lock_key ;
991
+ struct mutex bus_lock ;
992
+ struct list_head slaves ;
993
+ struct lock_class_key msg_lock_key ;
994
+ struct mutex msg_lock ;
995
+ struct list_head m_rt_list ;
996
+ struct sdw_defer defer_msg ;
997
+ struct sdw_bus_params params ;
998
+ int stream_refcount ;
999
+ const struct sdw_master_ops * ops ;
1000
+ const struct sdw_master_port_ops * port_ops ;
1001
+ struct sdw_master_prop prop ;
1002
+ void * vendor_specific_prop ;
1003
+ int hw_sync_min_links ;
1004
+ int controller_id ;
1005
+ unsigned int link_id ;
1006
+ int id ;
1007
+ int (* compute_params )(struct sdw_bus * bus , struct sdw_stream_runtime * stream );
1008
+ DECLARE_BITMAP (assigned , SDW_MAX_DEVICES );
1009
+ unsigned int clk_stop_timeout ;
1010
+ u32 bank_switch_timeout ;
1011
+ struct irq_chip irq_chip ;
1012
+ struct irq_domain * domain ;
1013
+ #ifdef CONFIG_DEBUG_FS
1014
+ struct dentry * debugfs ;
1015
+ #endif
1016
+ bool multi_link ;
1017
+ unsigned int lane_used_bandwidth [SDW_MAX_LANES ];
1018
+ };
1019
+
1020
1020
struct sdw_stream_runtime * sdw_alloc_stream (const char * stream_name );
1021
1021
void sdw_release_stream (struct sdw_stream_runtime * stream );
1022
1022
1023
- int sdw_compute_params (struct sdw_bus * bus );
1023
+ int sdw_compute_params (struct sdw_bus * bus , struct sdw_stream_runtime * stream );
1024
1024
1025
1025
int sdw_stream_add_master (struct sdw_bus * bus ,
1026
1026
struct sdw_stream_config * stream_config ,
0 commit comments