On 26/03/13 06:03, Kishon Vijay Abraham I wrote:Because I was not a fan of tightly coupling the child devices to the+static int palmas_usb_read(struct palmas *palmas, unsigned int reg,Graeme,
+ unsigned int *dest)
+{
+ unsigned int addr;
+ int slave;
+
+ slave = PALMAS_BASE_TO_SLAVE(PALMAS_USB_OTG_BASE);
+ addr = PALMAS_BASE_TO_REG(PALMAS_USB_OTG_BASE, reg);
+
+ return regmap_read(palmas->regmap[slave], addr, dest);
Please use the generic api for palmas_read()/palmas_write(0 as it will
be ease on debugging on register access.
Direct regmap_read() does not help much on this.
Any reason why you dint use palmas_read()/palmas_write here?
Btw palmas_read()/palmas_write() internally uses regmap APIs.
parent MFD. palmas_read/write were added by Laxman.
Kishon,No. It can be obtained from regmap too.+ palmas_usb->dev = &pdev->dev;Should be come from platform_get_irq() through platform driver.
+
+ palmas_usb->irq1 = regmap_irq_get_virq(palmas->irq_data,
+ PALMAS_ID_OTG_IRQ);
+ palmas_usb->irq2 = regmap_irq_get_virq(palmas->irq_data,
+ PALMAS_ID_IRQ);
+ palmas_usb->irq3 = regmap_irq_get_virq(palmas->irq_data,
+ PALMAS_VBUS_OTG_IRQ);
+ palmas_usb->irq4 = regmap_irq_get_virq(palmas->irq_data,
+ PALMAS_VBUS_IRQ);