Lines Matching defs:index
58 #define WPG_READATADDR_MASK 0x00010000 // read,bytes,I2C shifted,index
59 #define WPG_WRITEATADDR_MASK 0x40010000 // write,bytes,I2C shifted,index
75 // command index
77 #define WPG_1ST_SLOT_INDEX 0x01 // index - 1st slot for ctlr
78 #define WPG_CTLR_INDEX 0x0F // index - ctlr
79 #define WPG_1ST_EXTSLOT_INDEX 0x10 // index - 1st ext slot for ctlr
80 #define WPG_1ST_BUS_INDEX 0x1F // index - 1st bus for ctlr
118 static u8 i2c_ctrl_read(struct controller *ctlr_ptr, void __iomem *WPGBbar, u8 index)
127 debug_polling("%s - Entry WPGBbar[%p] index[%x] \n", __func__, WPGBbar, index);
131 // read at address, byte length, I2C address (shifted), index
132 // or read direct, byte length, index
140 // fill in index
141 data |= (unsigned long)index;
145 // fill in index
146 ultemp = (unsigned long)index;
214 debug_polling("%s - Exit index[%x] status[%x]\n", __func__, index, status);
226 static u8 i2c_ctrl_write(struct controller *ctlr_ptr, void __iomem *WPGBbar, u8 index, u8 cmd)
235 debug_polling("%s - Entry WPGBbar[%p] index[%x] cmd[%x]\n", __func__, WPGBbar, index, cmd);
240 // write at address, byte length, I2C address (shifted), index
241 // or write direct, byte length, index
251 // fill in index
252 data |= (unsigned long)index;
256 // fill in index
257 ultemp = (unsigned long)index;
410 * Action: convert a write command to proper index within a controller
412 * Return index, HPC_ERROR
414 static u8 hpc_writecmdtoindex(u8 cmd, u8 index)
434 rc = index;
442 rc = index + WPG_1ST_BUS_INDEX - 1;
456 * Action: convert a read command to proper index within a controller
458 * Return index, HPC_ERROR
460 static u8 hpc_readcmdtoindex(u8 cmd, u8 index)
470 rc = index;
473 rc = index + WPG_1ST_EXTSLOT_INDEX;
476 rc = index + WPG_1ST_BUS_INDEX - 1;
507 u8 index, status;
527 index = (u8) busindex;
529 index = pslot->ctlr_index;
531 index = hpc_readcmdtoindex(cmd, index);
533 if (index == HPC_ERROR) {
535 err("%s - Exit Error:invalid index, rc[%d]\n", __func__, rc);
558 pslot->status = ctrl_read(ctlr_ptr, wpg_bbar, index);
562 pslot->ext_status = ctrl_read(ctlr_ptr, wpg_bbar, index + WPG_1ST_EXTSLOT_INDEX);
568 *pstatus = ctrl_read(ctlr_ptr, wpg_bbar, index);
573 *pstatus = ctrl_read(ctlr_ptr, wpg_bbar, index);
582 pslot->busstatus = ctrl_read(ctlr_ptr, wpg_bbar, index);
585 *pstatus = ctrl_read(ctlr_ptr, wpg_bbar, index);
588 *pstatus = ctrl_read(ctlr_ptr, wpg_bbar, index);
592 *pstatus = ctrl_read(ctlr_ptr, wpg_bbar, index);
599 index = pslot->ctlr_index;
603 pslot->status = ctrl_read(ctlr_ptr, wpg_bbar, index);
609 index + WPG_1ST_EXTSLOT_INDEX);
645 u8 index, status;
667 index = (u8) busindex;
669 index = pslot->ctlr_index;
671 index = hpc_writecmdtoindex(cmd, index);
673 if (index == HPC_ERROR) {
699 ctrl_write(ctlr_ptr, wpg_bbar, index, cmd);