Lines Matching +full:slave +full:- +full:addr
1 /* SPDX-License-Identifier: (GPL-2.0 OR BSD-3-Clause) */
2 /* Copyright(c) 2015-17 Intel Corporation. */
75 * enum sdw_slave_status - Slave status
76 * @SDW_SLAVE_UNATTACHED: Slave is not attached with the bus.
77 * @SDW_SLAVE_ATTACHED: Slave is attached with bus.
78 * @SDW_SLAVE_ALERT: Some alert condition on the Slave
93 * @SDW_CLK_PRE_DEPREPARE: pre clock stop de-prepare
94 * @SDW_CLK_POST_DEPREPARE: post clock stop de-prepare
104 * enum sdw_command_response - Command response as defined by SDW spec
190 * enum sdw_p15_behave - Slave Port 15 behaviour when the Master attempts a
201 * enum sdw_dpn_type - Data port types
216 * enum sdw_clk_stop_mode - Clock Stop modes
217 * @SDW_CLK_STOP_MODE0: Slave can continue operation seamlessly on clock
219 * @SDW_CLK_STOP_MODE1: Slave may have entered a deeper power-saving mode,
228 * struct sdw_dp0_prop - DP0 properties
235 * @BRA_flow_controlled: Slave implementation results in an OK_NotReady
238 * @ch_prep_timeout: Port-specific timeout value, in milliseconds
240 * implementation-defined interrupts
258 * struct sdw_dpn_audio_mode - Audio mode properties for DPn
290 * struct sdw_dpn_prop - Data Port DPn properties
303 * @ch_prep_timeout: Port-specific timeout value, in milliseconds
305 * implementation-defined interrupts
346 * struct sdw_slave_prop - SoundWire Slave properties
348 * @wake_capable: Wake-up events are supported
350 * @clk_stop_mode1: Clock-Stop Mode 1 is supported
352 * @clk_stop_timeout: Worst-case latency of the Clock Stop Prepare State
354 * @ch_prep_timeout: Worst-case latency of the Channel Prepare State Machine
356 * @reset_behave: Slave keeps the status of the SlaveStopClockPrepare
357 * state machine (P=1 SCSP_SM) after exit from clock-stop mode1
358 * @high_PHY_capable: Slave is HighPHY capable
359 * @paging_support: Slave implements paging registers SCP_AddrPage1 and
361 * @bank_delay_support: Slave implements bank delay/bridge support registers
363 * @p15_behave: Slave behavior when the Master attempts a read to the Port15
365 * @lane_control_support: Slave supports lane control
366 * @master_count: Number of Masters present on this Slave
377 * @use_domain_irq: call actual IRQ handler on slave, as well as callback
408 * struct sdw_master_prop - Master properties
410 * @clk_stop_modes: Bitmap, bit N set when clock-stop-modeN supported
423 * @hw_disabled: if true, the Master is not functional, typically due to pin-mux
455 * Some Slave devices have known issues with incorrect parity errors
457 * parity errors can be reported by Slave devices, possibly due to electrical
465 int sdw_slave_read_prop(struct sdw_slave *slave);
468 * SDW Slave Structures and APIs
474 * struct sdw_slave_id - Slave ID
497 * Helper macros to extract the MIPI-defined IDs
518 #define SDW_DISCO_LINK_ID(addr) FIELD_GET(SDW_DISCO_LINK_ID_MASK, addr) argument
519 #define SDW_VERSION(addr) FIELD_GET(SDW_VERSION_MASK, addr) argument
520 #define SDW_UNIQUE_ID(addr) FIELD_GET(SDW_UNIQUE_ID_MASK, addr) argument
521 #define SDW_MFG_ID(addr) FIELD_GET(SDW_MFG_ID_MASK, addr) argument
522 #define SDW_PART_ID(addr) FIELD_GET(SDW_PART_ID_MASK, addr) argument
523 #define SDW_CLASS_ID(addr) FIELD_GET(SDW_CLASS_ID_MASK, addr) argument
526 * struct sdw_slave_intr_status - Slave interrupt status
527 * @sdca_cascade: set if the Slave device reports an SDCA interrupt
538 * sdw_reg_bank - SoundWire register banks
548 * struct sdw_prepare_ch: Prepare/De-prepare Data Port channel
552 * @prepare: Prepare (true) /de-prepare (false) channel
553 * @bank: Register bank, which bank Slave/Master driver should program for
591 * @s_data_mode: NORMAL, STATIC or PRBS mode for all Slave ports
609 * struct sdw_slave_ops: Slave driver callback ops
611 * @read_prop: Read Slave properties
614 * @update_status: Update Slave status
615 * @bus_config: Update the bus config for Slave
617 * @clk_stop: handle imp-def sequences before and after prepare and de-prepare
621 int (*interrupt_callback)(struct sdw_slave *slave,
623 int (*update_status)(struct sdw_slave *slave,
625 int (*bus_config)(struct sdw_slave *slave,
627 int (*port_prep)(struct sdw_slave *slave,
630 int (*clk_stop)(struct sdw_slave *slave,
637 * struct sdw_slave - SoundWire Slave
641 * @status: Status reported by the Slave
643 * @prop: Slave properties
644 * @debugfs: Slave debugfs
646 * @port_ready: Port ready completion flag for each Slave port
647 * @m_port_map: static Master port map for each Slave port
649 * @dev_num_sticky: one-time static Device Number assigned by Bus
653 * Slave device
656 * @unattach_request: mask field to keep track why the Slave re-attached and
657 * was re-initialized. This is useful to deal with potential race conditions
659 * when the Master triggered a reset the Slave is properly enumerated and
662 * for a Slave happens for the first time after enumeration
694 * struct sdw_master_device - SoundWire 'Master Device' representation
823 * struct sdw_defer - SDW deffered message
835 * struct sdw_master_ops - Master driver ops
846 * @get_device_num: Callback for vendor-specific device_number allocation
847 * @put_device_num: Callback for vendor-specific device_number release
853 (struct sdw_bus *bus, u64 addr);
863 int (*get_device_num)(struct sdw_bus *bus, struct sdw_slave *slave);
864 void (*put_device_num)(struct sdw_bus *bus, struct sdw_slave *slave);
866 struct sdw_slave *slave,
871 * struct sdw_bus - SoundWire bus
872 * @dev: Shortcut to &bus->md->dev to avoid changing the entire code.
874 * @controller_id: system-unique controller ID. If set to -1, the bus @id will be used.
876 * @id: bus system-wide unique id
878 * @assigned: Bitmap for Slave device numbers.
887 * @vendor_specific_prop: pointer to non-standard properties
900 * hardware-based synchronization is required. This value is only
901 * meaningful if multi_link is set. If set to 1, hardware-based
945 * sdw_port_config: Master or Slave Port configuration
956 * sdw_stream_config: Master or Slave stream configuration
980 * @SDW_STREAM_DEPREPARED: Stream de-prepared
1049 int sdw_compare_devid(struct sdw_slave *slave, struct sdw_slave_id id);
1050 void sdw_extract_slave_id(struct sdw_bus *bus, u64 addr, struct sdw_slave_id *id);
1054 int sdw_stream_add_slave(struct sdw_slave *slave,
1059 int sdw_stream_remove_slave(struct sdw_slave *slave,
1063 int sdw_read(struct sdw_slave *slave, u32 addr);
1064 int sdw_write(struct sdw_slave *slave, u32 addr, u8 value);
1065 int sdw_write_no_pm(struct sdw_slave *slave, u32 addr, u8 value);
1066 int sdw_read_no_pm(struct sdw_slave *slave, u32 addr);
1067 int sdw_nread(struct sdw_slave *slave, u32 addr, size_t count, u8 *val);
1068 int sdw_nread_no_pm(struct sdw_slave *slave, u32 addr, size_t count, u8 *val);
1069 int sdw_nwrite(struct sdw_slave *slave, u32 addr, size_t count, const u8 *val);
1070 int sdw_nwrite_no_pm(struct sdw_slave *slave, u32 addr, size_t count, const u8 *val);
1071 int sdw_update(struct sdw_slave *slave, u32 addr, u8 mask, u8 val);
1072 int sdw_update_no_pm(struct sdw_slave *slave, u32 addr, u8 mask, u8 val);
1076 static inline int sdw_stream_add_slave(struct sdw_slave *slave, in sdw_stream_add_slave() argument
1083 return -EINVAL; in sdw_stream_add_slave()
1086 static inline int sdw_stream_remove_slave(struct sdw_slave *slave, in sdw_stream_remove_slave() argument
1090 return -EINVAL; in sdw_stream_remove_slave()
1094 static inline int sdw_read(struct sdw_slave *slave, u32 addr) in sdw_read() argument
1097 return -EINVAL; in sdw_read()
1100 static inline int sdw_write(struct sdw_slave *slave, u32 addr, u8 value) in sdw_write() argument
1103 return -EINVAL; in sdw_write()
1106 static inline int sdw_write_no_pm(struct sdw_slave *slave, u32 addr, u8 value) in sdw_write_no_pm() argument
1109 return -EINVAL; in sdw_write_no_pm()
1112 static inline int sdw_read_no_pm(struct sdw_slave *slave, u32 addr) in sdw_read_no_pm() argument
1115 return -EINVAL; in sdw_read_no_pm()
1118 static inline int sdw_nread(struct sdw_slave *slave, u32 addr, size_t count, u8 *val) in sdw_nread() argument
1121 return -EINVAL; in sdw_nread()
1124 static inline int sdw_nread_no_pm(struct sdw_slave *slave, u32 addr, size_t count, u8 *val) in sdw_nread_no_pm() argument
1127 return -EINVAL; in sdw_nread_no_pm()
1130 static inline int sdw_nwrite(struct sdw_slave *slave, u32 addr, size_t count, const u8 *val) in sdw_nwrite() argument
1133 return -EINVAL; in sdw_nwrite()
1136 static inline int sdw_nwrite_no_pm(struct sdw_slave *slave, u32 addr, size_t count, const u8 *val) in sdw_nwrite_no_pm() argument
1139 return -EINVAL; in sdw_nwrite_no_pm()
1142 static inline int sdw_update(struct sdw_slave *slave, u32 addr, u8 mask, u8 val) in sdw_update() argument
1145 return -EINVAL; in sdw_update()
1148 static inline int sdw_update_no_pm(struct sdw_slave *slave, u32 addr, u8 mask, u8 val) in sdw_update_no_pm() argument
1151 return -EINVAL; in sdw_update_no_pm()