Skip to content

Commit

Permalink
i2c/isp1301_omap: Build fixes, whitespace
Browse files Browse the repository at this point in the history
Build fixes for isp1301_omap driver.  I think an earlier version
of this must have gotten lost somewhere, or maybe it only went
into the Linux-OMAP tree.

Also, some whitespace fixes to bring this more into sync with the
version of this found in the Linux-OMAP tree.  (That version has
updates for the OTG controller on the OMAP 1710 which break that
functionality on OMAP 161x boards like the H2, so merging all of
it is not currently an option.)

Signed-off-by: David Brownell <[email protected]>
Signed-off-by: Jean Delvare <[email protected]>
  • Loading branch information
David Brownell authored and Jean Delvare committed Aug 14, 2007
1 parent 322454a commit 25da383
Showing 1 changed file with 21 additions and 21 deletions.
42 changes: 21 additions & 21 deletions drivers/i2c/chips/isp1301_omap.c
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,6 @@
* along with this program; if not, write to the Free Software
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
#undef DEBUG
#undef VERBOSE

#include <linux/kernel.h>
#include <linux/module.h>
Expand All @@ -44,7 +42,7 @@


#define DRIVER_VERSION "24 August 2004"
#define DRIVER_NAME (isp1301_driver.name)
#define DRIVER_NAME (isp1301_driver.driver.name)

MODULE_DESCRIPTION("ISP1301 USB OTG Transceiver Driver");
MODULE_LICENSE("GPL");
Expand All @@ -55,6 +53,7 @@ struct isp1301 {
void (*i2c_release)(struct device *dev);

int irq;
int irq_type;

u32 last_otg_ctrl;
unsigned working:1;
Expand All @@ -63,7 +62,7 @@ struct isp1301 {

/* use keventd context to change the state for us */
struct work_struct work;

unsigned long todo;
# define WORK_UPDATE_ISP 0 /* update ISP from OTG */
# define WORK_UPDATE_OTG 1 /* update OTG from ISP */
Expand Down Expand Up @@ -94,7 +93,7 @@ struct isp1301 {

/* board-specific PM hooks */

#include <asm/arch/gpio.h>
#include <asm/gpio.h>
#include <asm/arch/mux.h>
#include <asm/mach-types.h>

Expand Down Expand Up @@ -291,7 +290,7 @@ static void power_up(struct isp1301 *isp)
{
// isp1301_clear_bits(isp, ISP1301_MODE_CONTROL_2, MC2_GLOBAL_PWR_DN);
isp1301_clear_bits(isp, ISP1301_MODE_CONTROL_1, MC1_SUSPEND_REG);

/* do this only when cpu is driving transceiver,
* so host won't see a low speed device...
*/
Expand Down Expand Up @@ -799,7 +798,7 @@ static irqreturn_t omap_otg_irq(int irq, void *_isp)
/* role is host */
} else {
if (!(otg_ctrl & OTG_ID)) {
otg_ctrl &= OTG_CTRL_MASK & ~OTG_XCEIV_INPUTS;
otg_ctrl &= OTG_CTRL_MASK & ~OTG_XCEIV_INPUTS;
OTG_CTRL_REG = otg_ctrl | OTG_A_BUSREQ;
}

Expand Down Expand Up @@ -1100,9 +1099,9 @@ static u8 isp1301_clear_latch(struct isp1301 *isp)
}

static void
isp1301_work(void *data)
isp1301_work(struct work_struct *work)
{
struct isp1301 *isp = data;
struct isp1301 *isp = container_of(work, struct isp1301, work);
int stop;

/* implicit lock: we're the only task using this device */
Expand Down Expand Up @@ -1244,7 +1243,7 @@ static int isp1301_detach_client(struct i2c_client *i2c)
* - DEVICE mode, for when there's a B/Mini-B (device) connector
*
* As a rule, you won't have an isp1301 chip unless it's there to
* support the OTG mode. Other modes help testing USB controllers
* support the OTG mode. Other modes help testing USB controllers
* in isolation from (full) OTG support, or maybe so later board
* revisions can help to support those feature.
*/
Expand All @@ -1260,9 +1259,9 @@ static int isp1301_otg_enable(struct isp1301 *isp)
* a few more interrupts than are strictly needed.
*/
isp1301_set_bits(isp, ISP1301_INTERRUPT_RISING,
INTR_VBUS_VLD | INTR_SESS_VLD | INTR_ID_GND);
INTR_VBUS_VLD | INTR_SESS_VLD | INTR_ID_GND);
isp1301_set_bits(isp, ISP1301_INTERRUPT_FALLING,
INTR_VBUS_VLD | INTR_SESS_VLD | INTR_ID_GND);
INTR_VBUS_VLD | INTR_SESS_VLD | INTR_ID_GND);

dev_info(&isp->client.dev, "ready for dual-role USB ...\n");

Expand Down Expand Up @@ -1306,9 +1305,9 @@ isp1301_set_host(struct otg_transceiver *otg, struct usb_bus *host)

dev_info(&isp->client.dev, "A-Host sessions ok\n");
isp1301_set_bits(isp, ISP1301_INTERRUPT_RISING,
INTR_ID_GND);
INTR_ID_GND);
isp1301_set_bits(isp, ISP1301_INTERRUPT_FALLING,
INTR_ID_GND);
INTR_ID_GND);

/* If this has a Mini-AB connector, this mode is highly
* nonstandard ... but can be handy for testing, especially with
Expand Down Expand Up @@ -1368,9 +1367,9 @@ isp1301_set_peripheral(struct otg_transceiver *otg, struct usb_gadget *gadget)
isp1301_set_bits(isp, ISP1301_MODE_CONTROL_1, MC1_DAT_SE0);

isp1301_set_bits(isp, ISP1301_INTERRUPT_RISING,
INTR_SESS_VLD);
INTR_SESS_VLD);
isp1301_set_bits(isp, ISP1301_INTERRUPT_FALLING,
INTR_VBUS_VLD);
INTR_VBUS_VLD);
dev_info(&isp->client.dev, "B-Peripheral sessions ok\n");
dump_regs(isp, __FUNCTION__);

Expand Down Expand Up @@ -1494,7 +1493,7 @@ static int isp1301_probe(struct i2c_adapter *bus, int address, int kind)
if (!isp)
return 0;

INIT_WORK(&isp->work, isp1301_work, isp);
INIT_WORK(&isp->work, isp1301_work);
init_timer(&isp->timer);
isp->timer.function = isp1301_timer;
isp->timer.data = (unsigned long) isp;
Expand Down Expand Up @@ -1572,13 +1571,14 @@ static int isp1301_probe(struct i2c_adapter *bus, int address, int kind)
/* IRQ wired at M14 */
omap_cfg_reg(M14_1510_GPIO2);
isp->irq = OMAP_GPIO_IRQ(2);
omap_request_gpio(2);
omap_set_gpio_direction(2, 1);
omap_set_gpio_edge_ctrl(2, OMAP_GPIO_FALLING_EDGE);
if (gpio_request(2, "isp1301") == 0)
gpio_direction_input(2);
isp->irq_type = IRQF_TRIGGER_FALLING;
}

isp->irq_type |= IRQF_SAMPLE_RANDOM;
status = request_irq(isp->irq, isp1301_irq,
IRQF_SAMPLE_RANDOM, DRIVER_NAME, isp);
isp->irq_type, DRIVER_NAME, isp);
if (status < 0) {
dev_dbg(&i2c->dev, "can't get IRQ %d, err %d\n",
isp->irq, status);
Expand Down

0 comments on commit 25da383

Please sign in to comment.