+static irqreturn_t at32_wm97xx_channel_b_interrupt(int irq, void *dev_id)
+{
+ struct at32_wm97xx *at32_wm97xx = dev_id;
+ struct wm97xx *wm = at32_wm97xx->wm;
+ int status = ac97c_readl(at32_wm97xx, CBSR);
+ int retval = IRQ_NONE;
+static int __init at32_wm97xx_probe(struct platform_device *pdev)
+{
+ struct wm97xx *wm = platform_get_drvdata(pdev);
+ struct at32_wm97xx *at32_wm97xx;
+ int ret;
+
+ at32_wm97xx = kzalloc(sizeof(struct at32_wm97xx), GFP_KERNEL);
+ if (!at32_wm97xx) {
+ dev_dbg(&pdev->dev, "out of memory\n");
+ return -ENOMEM;
+ }
+
+ at32_wm97xx->wm = wm;
+ at32_wm97xx->regs = (void *)AT32_WM97XX_AC97C_IOMEM;
+ at32_wm97xx->ac97c_irq = AT32_WM97XX_AC97C_IRQ;
+ at32_wm97xx->gpio_pen = at32_gpio_line;
+ at32_wm97xx->gpio_irq = gpio_to_irq(at32_wm97xx->gpio_pen);
+
+ setup_timer(&at32_wm97xx->pen_timer, at32_wm97xx_pen_timer,
+ (unsigned long)at32_wm97xx);
+
+ ret = request_irq(at32_wm97xx->ac97c_irq,
+ at32_wm97xx_channel_b_interrupt,
+ IRQF_SHARED, "at32-wm97xx-ch-b", at32_wm97xx);
+ if (ret) {
+ dev_dbg(&pdev->dev, "could not request ac97c irq\n");
+ return ret;
+ }
+
+ platform_set_drvdata(pdev, at32_wm97xx);
+
+ return wm97xx_register_mach_ops(wm,&at32_mach_ops);