Commit 7ee139bd authored by Povilas Kanapickas's avatar Povilas Kanapickas

genesys: Pass device to sanei_genesys_write_ahb() as ptr not number

parent d7bff42c
......@@ -568,8 +568,7 @@ gl124_send_slope_table (Genesys_Device * dev, int table_nr,
}
/* slope table addresses are fixed */
status =
sanei_genesys_write_ahb(dev->dn, 0x10000000 + 0x4000 * table_nr, steps * 2, table);
status = sanei_genesys_write_ahb(dev, 0x10000000 + 0x4000 * table_nr, steps * 2, table);
if (status != SANE_STATUS_GOOD)
{
DBG (DBG_error,
......@@ -2809,7 +2808,7 @@ gl124_send_shading_data (Genesys_Device * dev, uint8_t * data, int size)
}
RIE (sanei_genesys_read_register (dev, 0xd0+i, &val));
addr = val * 8192 + 0x10000000;
status = sanei_genesys_write_ahb(dev->dn, addr, pixels*dev->segnb, buffer);
status = sanei_genesys_write_ahb(dev, addr, pixels*dev->segnb, buffer);
if (status != SANE_STATUS_GOOD)
{
DBG(DBG_error, "%s; write to AHB failed (%s)\n", __func__, sane_strstatus(status));
......
......@@ -477,7 +477,7 @@ gl846_send_slope_table (Genesys_Device * dev, int table_nr,
}
/* slope table addresses are fixed */
status = sanei_genesys_write_ahb(dev->dn, 0x10000000 + 0x4000 * table_nr, steps * 2, table);
status = sanei_genesys_write_ahb(dev, 0x10000000 + 0x4000 * table_nr, steps * 2, table);
if (status != SANE_STATUS_GOOD)
{
DBG(DBG_error, "%s: write to AHB failed writing slope table %d (%s)\n", __func__, table_nr,
......@@ -2389,7 +2389,7 @@ gl846_send_shading_data (Genesys_Device * dev, uint8_t * data, int size)
RIEF (sanei_genesys_read_register (dev, 0xd0+i, &val), buffer);
addr = val * 8192 + 0x10000000;
status = sanei_genesys_write_ahb(dev->dn, addr, pixels, buffer);
status = sanei_genesys_write_ahb(dev, addr, pixels, buffer);
if (status != SANE_STATUS_GOOD)
{
DBG(DBG_error, "%s; write to AHB failed (%s)\n", __func__, sane_strstatus(status));
......
......@@ -500,8 +500,7 @@ gl847_send_slope_table (Genesys_Device * dev, int table_nr,
}
/* slope table addresses are fixed */
status =
sanei_genesys_write_ahb(dev->dn, 0x10000000 + 0x4000 * table_nr, steps * 2, table);
status = sanei_genesys_write_ahb(dev, 0x10000000 + 0x4000 * table_nr, steps * 2, table);
if (status != SANE_STATUS_GOOD)
{
DBG(DBG_error, "%s: write to AHB failed writing slope table %d (%s)\n", __func__, table_nr,
......@@ -2455,7 +2454,7 @@ gl847_send_shading_data (Genesys_Device * dev, uint8_t * data, int size)
RIE (sanei_genesys_read_register (dev, 0xd0+i, &val));
addr = val * 8192 + 0x10000000;
status = sanei_genesys_write_ahb(dev->dn, addr, pixels, buffer);
status = sanei_genesys_write_ahb(dev, addr, pixels, buffer);
if (status != SANE_STATUS_GOOD)
{
DBG(DBG_error, "%s; write to AHB failed (%s)\n", __func__, sane_strstatus(status));
......
......@@ -1261,7 +1261,7 @@ sanei_genesys_bulk_write_register (Genesys_Device * dev,
* @param data pointer to the data to write
*/
SANE_Status
sanei_genesys_write_ahb (SANE_Int dn, uint32_t addr, uint32_t size, uint8_t * data)
sanei_genesys_write_ahb(Genesys_Device* dev, uint32_t addr, uint32_t size, uint8_t * data)
{
uint8_t outdata[8];
size_t written,blksize;
......@@ -1290,8 +1290,8 @@ sanei_genesys_write_ahb (SANE_Int dn, uint32_t addr, uint32_t size, uint8_t * da
/* write addr and size for AHB */
status =
sanei_usb_control_msg (dn, REQUEST_TYPE_OUT, REQUEST_BUFFER, VALUE_BUFFER,
0x01, 8, outdata);
sanei_usb_control_msg(dev->dn, REQUEST_TYPE_OUT, REQUEST_BUFFER, VALUE_BUFFER,
0x01, 8, outdata);
if (status != SANE_STATUS_GOOD)
{
DBG(DBG_error, "%s: failed while setting addr and size: %s\n", __func__,
......@@ -1311,7 +1311,7 @@ sanei_genesys_write_ahb (SANE_Int dn, uint32_t addr, uint32_t size, uint8_t * da
{
blksize = size - written;
}
status = sanei_usb_write_bulk (dn, data + written, &blksize);
status = sanei_usb_write_bulk(dev->dn, data + written, &blksize);
if (status != SANE_STATUS_GOOD)
{
DBG (DBG_error,
......@@ -1457,7 +1457,7 @@ sanei_genesys_send_gamma_table (Genesys_Device * dev)
RIEF (sanei_genesys_write_register (dev, 0xc5+2*i, gamma[size*2*i+1]), gamma);
RIEF (sanei_genesys_write_register (dev, 0xc6+2*i, gamma[size*2*i]), gamma);
status = sanei_genesys_write_ahb(dev->dn, 0x01000000 + 0x200 * i, (size-1) * 2, gamma + i * size * 2+2);
status = sanei_genesys_write_ahb(dev, 0x01000000 + 0x200 * i, (size-1) * 2, gamma + i * size * 2+2);
if (status != SANE_STATUS_GOOD)
{
DBG (DBG_error,
......
......@@ -1005,7 +1005,7 @@ extern SANE_Status sanei_genesys_get_status (Genesys_Device * dev, uint8_t * sta
extern void sanei_genesys_print_status (uint8_t val);
extern SANE_Status
sanei_genesys_write_ahb(SANE_Int dn, uint32_t addr, uint32_t size, uint8_t * data);
sanei_genesys_write_ahb(Genesys_Device* dev, uint32_t addr, uint32_t size, uint8_t * data);
extern void sanei_genesys_init_fe (Genesys_Device * dev);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment