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;
412 * Action: convert a write command to proper index within a controller
414 * Return index, HPC_ERROR
416 static u8 hpc_writecmdtoindex(u8 cmd, u8 index)
436 rc = index;
444 rc = index + WPG_1ST_BUS_INDEX - 1;
458 * Action: convert a read command to proper index within a controller
460 * Return index, HPC_ERROR
462 static u8 hpc_readcmdtoindex(u8 cmd, u8 index)
472 rc = index;
475 rc = index + WPG_1ST_EXTSLOT_INDEX;
478 rc = index + WPG_1ST_BUS_INDEX - 1;
509 u8 index, status;
529 index = (u8) busindex;
531 index = pslot->ctlr_index;
533 index = hpc_readcmdtoindex(cmd, index);
535 if (index == HPC_ERROR) {
537 err("%s - Exit Error:invalid index, rc[%d]\n", __func__, rc);
560 pslot->status = ctrl_read(ctlr_ptr, wpg_bbar, index);
564 pslot->ext_status = ctrl_read(ctlr_ptr, wpg_bbar, index + WPG_1ST_EXTSLOT_INDEX);
570 *pstatus = ctrl_read(ctlr_ptr, wpg_bbar, index);
575 *pstatus = ctrl_read(ctlr_ptr, wpg_bbar, index);
584 pslot->busstatus = ctrl_read(ctlr_ptr, wpg_bbar, index);
587 *pstatus = ctrl_read(ctlr_ptr, wpg_bbar, index);
590 *pstatus = ctrl_read(ctlr_ptr, wpg_bbar, index);
594 *pstatus = ctrl_read(ctlr_ptr, wpg_bbar, index);
601 index = pslot->ctlr_index;
605 pslot->status = ctrl_read(ctlr_ptr, wpg_bbar, index);
611 index + WPG_1ST_EXTSLOT_INDEX);
647 u8 index, status;
669 index = (u8) busindex;
671 index = pslot->ctlr_index;
673 index = hpc_writecmdtoindex(cmd, index);
675 if (index == HPC_ERROR) {
701 ctrl_write(ctlr_ptr, wpg_bbar, index, cmd);