From 6f68a6d739a950f1a9083d053c7981aa2de95978 Mon Sep 17 00:00:00 2001 From: Marek Belisko Date: Thu, 3 Feb 2011 11:07:40 +0100 Subject: [PATCH] --- yaml --- r: 235787 b: refs/heads/master c: c5d680c0585271593b66b2274658d4b81ff1eb4b h: refs/heads/master i: 235785: a5f3ecb1946223ae425e710c91d3258df0fb40cf 235783: 084be3647bff8c11ffc32f651ac9101ea53233bb v: v3 --- [refs] | 2 +- .../ft1000/ft1000-usb/ft1000_download.c | 85 +++++++++---------- 2 files changed, 41 insertions(+), 46 deletions(-) diff --git a/[refs] b/[refs] index df6f95356626..c43c76085a42 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: 165d290f8a315b8af950aa15b23665c7950f8843 +refs/heads/master: c5d680c0585271593b66b2274658d4b81ff1eb4b diff --git a/trunk/drivers/staging/ft1000/ft1000-usb/ft1000_download.c b/trunk/drivers/staging/ft1000/ft1000-usb/ft1000_download.c index 0ee80b58a97b..03694db72096 100644 --- a/trunk/drivers/staging/ft1000/ft1000-usb/ft1000_download.c +++ b/trunk/drivers/staging/ft1000/ft1000-usb/ft1000_download.c @@ -125,53 +125,48 @@ struct dsp_image_info { //--------------------------------------------------------------------------- static u32 check_usb_db (struct ft1000_device *ft1000dev) { - int loopcnt; - u16 temp; - u32 status; - - loopcnt = 0; - while (loopcnt < 10) - { - - status = ft1000_read_register (ft1000dev, &temp, FT1000_REG_DOORBELL); - DEBUG("check_usb_db: read FT1000_REG_DOORBELL value is %x\n", temp); - if (temp & 0x0080) - { - DEBUG("FT1000:Got checkusb doorbell\n"); - status = ft1000_write_register (ft1000dev, 0x0080, FT1000_REG_DOORBELL); - status = ft1000_write_register (ft1000dev, 0x0100, FT1000_REG_DOORBELL); - status = ft1000_write_register (ft1000dev, 0x8000, FT1000_REG_DOORBELL); - break; - } - else - { - loopcnt++; - msleep (10); - } - - } //end of while - - - loopcnt = 0; - while (loopcnt < 20) - { - - status = ft1000_read_register (ft1000dev, &temp, FT1000_REG_DOORBELL); - DEBUG("FT1000:check_usb_db:Doorbell = 0x%x\n", temp); - if (temp & 0x8000) - { - loopcnt++; - msleep (10); - } - else - { - DEBUG("check_usb_db: door bell is cleared, return 0\n"); - return 0; - } - } + int loopcnt; + u16 temp; + u32 status; + + loopcnt = 0; + + while (loopcnt < 10) { + status = ft1000_read_register(ft1000dev, &temp, + FT1000_REG_DOORBELL); + DEBUG("check_usb_db: read FT1000_REG_DOORBELL value is %x\n", + temp); + if (temp & 0x0080) { + DEBUG("FT1000:Got checkusb doorbell\n"); + status = ft1000_write_register(ft1000dev, 0x0080, + FT1000_REG_DOORBELL); + status = ft1000_write_register(ft1000dev, 0x0100, + FT1000_REG_DOORBELL); + status = ft1000_write_register(ft1000dev, 0x8000, + FT1000_REG_DOORBELL); + break; + } else { + loopcnt++; + msleep(10); + } - return HANDSHAKE_MAG_TIMEOUT_VALUE; + } + + loopcnt = 0; + while (loopcnt < 20) { + status = ft1000_read_register(ft1000dev, &temp, + FT1000_REG_DOORBELL); + DEBUG("FT1000:check_usb_db:Doorbell = 0x%x\n", temp); + if (temp & 0x8000) { + loopcnt++; + msleep(10); + } else { + DEBUG("check_usb_db: door bell is cleared, return 0\n"); + return 0; + } + } + return HANDSHAKE_MAG_TIMEOUT_VALUE; } //---------------------------------------------------------------------------