if (IS_ERR(priv->clk)) { dev_err(dev, "unable to get UART clock\n"); return PTR_ERR(priv->clk); } uart_cs = (AR933X_UART_CS_IF_MODE_DCE << AR933X_UART_CS_IF_MODE_S) | AR933X_UART_CS_TX_READY_ORIDE | AR933X_UART_CS_RX_READY_ORIDE; ar933x_serial_writel(cdev, uart_cs, AR933X_UART_CS_REG); /* FIXME: need ar933x_serial_init_port(cdev); */ console_register(cdev); return 0; } static struct of_device_id ar933x_serial_dt_ids[] = { { .compatible = "qca,ar9330-uart", }, { /* sentinel */ }, }; static struct driver_d ar933x_serial_driver = { .name = "ar933x_serial", .probe = ar933x_serial_probe, .of_compatible = DRV_OF_COMPAT(ar933x_serial_dt_ids), }; console_platform_driver(ar933x_serial_driver);
if (ret) goto out; return 0; out: free(pcs); return ret; } static __maybe_unused struct of_device_id pcs_dt_ids[] = { { .compatible = "pinctrl-single", }, { /* sentinel */ } }; static struct driver_d pcs_driver = { .name = "pinctrl-single", .probe = pcs_probe, .of_compatible = DRV_OF_COMPAT(pcs_dt_ids), }; static int pcs_init(void) { return platform_driver_register(&pcs_driver); } postcore_initcall(pcs_init);
dev_info(dev, "am_usbphy %p enabled\n", &am_usbphy->phy); return 0; err_free: free(am_usbphy); return ret; }; static __maybe_unused struct of_device_id am335x_phy_dt_ids[] = { { .compatible = "ti,am335x-usb-phy", }, { /* sentinel */ }, }; static struct driver_d am335x_phy_driver = { .name = "am335x-phy-driver", .probe = am335x_phy_probe, .of_compatible = DRV_OF_COMPAT(am335x_phy_dt_ids), }; static int am335x_phy_init(void) { return platform_driver_register(&am335x_phy_driver); } fs_initcall(am335x_phy_init);
ci->data.hccr = base + 0x100; ci->data.hcor = base + 0x140; ci->data.flags = EHCI_HAS_TT; if (ci->mode == IMX_USB_MODE_HOST && IS_ENABLED(CONFIG_USB_EHCI)) { ret = ehci_register(dev, &ci->data); } else if (ci->mode == IMX_USB_MODE_DEVICE && IS_ENABLED(CONFIG_USB_GADGET_DRIVER_ARC)) { ret = ci_udc_register(dev, base); } else { dev_err(dev, "No supported role\n"); ret = -ENODEV; } return ret; }; static __maybe_unused struct of_device_id imx_chipidea_dt_ids[] = { { .compatible = "fsl,imx27-usb", }, { /* sentinel */ }, }; static struct driver_d imx_chipidea_driver = { .name = "imx-usb", .probe = imx_chipidea_probe, .of_compatible = DRV_OF_COMPAT(imx_chipidea_dt_ids), }; device_platform_driver(imx_chipidea_driver);
at91_stop_clock(ohci_at91); if (pdata) { bool active_low; int i, gpio; at91_for_each_port(i) { gpio = pdata->vbus_pin[i]; active_low = pdata->vbus_pin_active_low[i]; if (gpio_is_valid(gpio)) { gpio_set_value(gpio, active_low); gpio_free(gpio); } } } } static const struct of_device_id at91_ohci_dt_ids[] = { { .compatible = "atmel,at91rm9200-ohci" }, { /* sentinel */ } }; static struct driver_d at91_ohci_driver = { .name = "at91_ohci", .probe = at91_ohci_probe, .remove = at91_ohci_remove, .of_compatible = DRV_OF_COMPAT(at91_ohci_dt_ids), }; device_platform_driver(at91_ohci_driver);
priv->miibus.dev.device_node = dev->device_node; priv->miibus.priv = priv; priv->miibus.parent = dev; priv->miibus.read = mvebu_mdio_read; priv->miibus.write = mvebu_mdio_write; return mdiobus_register(&priv->miibus); } static void mvebu_mdio_remove(struct device_d *dev) { struct mdio_priv *priv = dev->priv; mdiobus_unregister(&priv->miibus); clk_disable(priv->clk); } static struct of_device_id mvebu_mdio_dt_ids[] = { { .compatible = "marvell,orion-mdio" }, { } }; static struct driver_d mvebu_mdio_driver = { .name = "mvebu-mdio", .probe = mvebu_mdio_probe, .remove = mvebu_mdio_remove, .of_compatible = DRV_OF_COMPAT(mvebu_mdio_dt_ids), }; device_platform_driver(mvebu_mdio_driver);
iores = dev_request_mem_resource(dev, 0); if (IS_ERR(iores)) return PTR_ERR(iores); regs = IOMEM(iores->start); mx1_clocks_init(regs, 32000); return 0; } static __maybe_unused struct of_device_id imx1_ccm_dt_ids[] = { { .compatible = "fsl,imx1-ccm", }, { /* sentinel */ } }; static struct driver_d imx1_ccm_driver = { .probe = imx1_ccm_probe, .name = "imx1-ccm", .of_compatible = DRV_OF_COMPAT(imx1_ccm_dt_ids), }; static int imx1_ccm_init(void) { return platform_driver_register(&imx1_ccm_driver); } core_initcall(imx1_ccm_init);
of_property_read_string_index(np, "clock-output-names", 2+n, &rclk_name); desc->get_clk_ratio(base, desc->ratios[n].id, &mult, &div); clk_data.clks[2+n] = clk_fixed_factor(rclk_name, cpuclk_name, mult, div, 0); WARN_ON(IS_ERR(clk_data.clks[2+n])); }; return of_clk_add_provider(np, of_clk_src_onecell_get, &clk_data); } static struct driver_d mvebu_coreclk_driver = { .probe = mvebu_coreclk_probe, .name = "mvebu-core-clk", .of_compatible = DRV_OF_COMPAT(mvebu_coreclk_ids), }; static int mvebu_coreclk_init(void) { return platform_driver_register(&mvebu_coreclk_driver); } core_initcall(mvebu_coreclk_init); /* * Clock Gating Control */ struct gate { struct clk *clk; int bit_idx;
dev_err(dev, "Cannot find regulator\n"); return PTR_ERR(pwm_backlight->power); } pwm_backlight->period = pwm_get_period(pwm_backlight->pwm); pwm_backlight->backlight.brightness_set = backlight_pwm_set; pwm_backlight->backlight.node = dev->device_node; ret = backlight_register(&pwm_backlight->backlight); if (ret) return ret; return 0; } static struct of_device_id backlight_pwm_of_ids[] = { { .compatible = "pwm-backlight", }, { /* sentinel */ } }; static struct driver_d backlight_pwm_of_driver = { .name = "pwm-backlight", .probe = backlight_pwm_of_probe, .of_compatible = DRV_OF_COMPAT(backlight_pwm_of_ids), }; device_platform_driver(backlight_pwm_of_driver);
static const struct fsl_i2c_hwdata imx21_i2c_hwdata = { .regshift = IMX_I2C_REGSHIFT, .clk_div = imx_i2c_clk_div, .ndivs = ARRAY_SIZE(imx_i2c_clk_div), .i2sr_clr_opcode = I2SR_CLR_OPCODE_W0C, .i2cr_ien_opcode = I2CR_IEN_OPCODE_1, }; static const struct fsl_i2c_hwdata vf610_i2c_hwdata = { .regshift = VF610_I2C_REGSHIFT, .clk_div = vf610_i2c_clk_div, .ndivs = ARRAY_SIZE(vf610_i2c_clk_div), .i2sr_clr_opcode = I2SR_CLR_OPCODE_W1C, .i2cr_ien_opcode = I2CR_IEN_OPCODE_0, }; static __maybe_unused struct of_device_id imx_i2c_dt_ids[] = { { .compatible = "fsl,imx21-i2c", .data = &imx21_i2c_hwdata, }, { .compatible = "fsl,vf610-i2c", .data = &vf610_i2c_hwdata, }, { /* sentinel */ } }; static struct driver_d i2c_fsl_driver = { .probe = i2c_fsl_probe, .name = DRIVER_NAME, #ifndef CONFIG_PPC .of_compatible = DRV_OF_COMPAT(imx_i2c_dt_ids), #endif }; coredevice_platform_driver(i2c_fsl_driver);
static __maybe_unused struct of_device_id tegra20_pmc_dt_ids[] = { { .compatible = "nvidia,tegra20-pmc", }, { .compatible = "nvidia,tegra30-pmc", }, { .compatible = "nvidia,tegra124-pmc", }, { /* sentinel */ } }; static struct driver_d tegra20_pmc_driver = { .probe = tegra20_pmc_probe, .name = "tegra20-pmc", .of_compatible = DRV_OF_COMPAT(tegra20_pmc_dt_ids), }; static int tegra20_pmc_init(void) { return platform_driver_register(&tegra20_pmc_driver); } coredevice_initcall(tegra20_pmc_init); BAREBOX_CMD_HELP_START(tegrarcm) BAREBOX_CMD_HELP_TEXT("Get into recovery mode without using a physical switch\n") BAREBOX_CMD_HELP_END BAREBOX_CMD_START(tegrarcm) .cmd = do_tegrarcm, BAREBOX_CMD_DESC("Usage: tegrarcm")
struct imx_usb_misc_data *devtype; int ret; ret = dev_get_drvdata(dev, (unsigned long *)&devtype); if (ret) return ret; usbmisc_base = dev_request_mem_region(dev, 0); if (!usbmisc_base) return -ENOMEM; imxusbmisc_data = devtype; return 0; } static struct driver_d imx_usbmisc_driver = { .name = "imx-usbmisc", .probe = imx_usbmisc_probe, .id_table = imx_usbmisc_ids, .of_compatible = DRV_OF_COMPAT(imx_usbmisc_dt_ids), }; static int imx_usbmisc_init(void) { platform_driver_register(&imx_usbmisc_driver); return 0; } coredevice_initcall(imx_usbmisc_init);
}; static __maybe_unused struct of_device_id imx_ocotp_dt_ids[] = { { .compatible = "fsl,imx6q-ocotp", .data = &imx6q_ocotp_data, }, { .compatible = "fsl,imx6sx-ocotp", .data = &imx6q_ocotp_data, }, { .compatible = "fsl,imx6sl-ocotp", .data = &imx6sl_ocotp_data, }, { /* sentinel */ } }; static struct driver_d imx_ocotp_driver = { .name = "imx_ocotp", .probe = imx_ocotp_probe, .of_compatible = DRV_OF_COMPAT(imx_ocotp_dt_ids), }; static int imx_ocotp_init(void) { platform_driver_register(&imx_ocotp_driver); return 0; } coredevice_initcall(imx_ocotp_init);
err = console_register(&s->cdev); out_err: if (err) free(s); return err; } static void clps711x_remove(struct device_d *dev) { struct clps711x_uart *s = dev->priv; clps711x_flush(&s->cdev); console_unregister(&s->cdev); free(s); } static struct of_device_id __maybe_unused clps711x_uart_dt_ids[] = { { .compatible = "cirrus,clps711x-uart", }, }; static struct driver_d clps711x_driver = { .name = "clps711x-uart", .probe = clps711x_probe, .remove = clps711x_remove, .of_compatible = DRV_OF_COMPAT(clps711x_uart_dt_ids), }; console_platform_driver(clps711x_driver);
}, { } }; static struct of_device_id __maybe_unused bgpio_of_match[] = { { .compatible = "wd,mbl-gpio", }, { /* sentinel */ } }; static struct driver_d bgpio_driver = { .name = "basic-mmio-gpio", .id_table = bgpio_id_table, .of_compatible = DRV_OF_COMPAT(bgpio_of_match), .probe = bgpio_dev_probe, .remove = bgpio_dev_remove, }; static int bgpio_register(void) { return platform_driver_register(&bgpio_driver); } coredevice_initcall(bgpio_register); #endif MODULE_DESCRIPTION("Driver for basic memory-mapped GPIO controllers"); MODULE_AUTHOR("Anton Vorontsov <*****@*****.**>"); MODULE_LICENSE("GPL");
dev_err(dev, "Cannot register IDE interface: %s\n", strerror(-ret)); goto out_free_clk; } return 0; out_free_clk: clk_put(clk); out_free: free(ide); return ret; } static __maybe_unused struct of_device_id imx_pata_dt_ids[] = { { .compatible = "fsl,imx27-pata", }, { /* sentinel */ }, }; static struct driver_d imx_pata_driver = { .name = "imx-pata", .probe = imx_pata_probe, .of_compatible = DRV_OF_COMPAT(imx_pata_dt_ids), }; device_platform_driver(imx_pata_driver);
bgc->gc.ngpio = 3; break; default: break; } err = gpiochip_add(&bgc->gc); out_err: if (err) free(bgc); return err; } static struct of_device_id __maybe_unused clps711x_gpio_dt_ids[] = { { .compatible = "cirrus,clps711x-gpio", }, }; static struct driver_d clps711x_gpio_driver = { .name = "clps711x-gpio", .probe = clps711x_gpio_probe, .of_compatible = DRV_OF_COMPAT(clps711x_gpio_dt_ids), }; static __init int clps711x_gpio_register(void) { return platform_driver_register(&clps711x_gpio_driver); } coredevice_initcall(clps711x_gpio_register);
mode |= TIMER_CTRL_ENABLE; __raw_writel(mode, timer_base + TIMER_CONTROL); clocks_calc_mult_shift(&uemd_cs.mult, &uemd_cs.shift, clk_get_rate(timer_clk), NSEC_PER_SEC, 10); init_clock(&uemd_cs); return 0; } static __maybe_unused struct of_device_id uemd_timer_dt_ids[] = { { .compatible = "module,uemd-timer", }, { /* sentinel */ } }; static struct driver_d uemd_timer_driver = { .probe = uemd_timer_probe, .name = "uemd-timer", .of_compatible = DRV_OF_COMPAT(uemd_timer_dt_ids), }; static int uemd_timer_init(void) { return platform_driver_register(&uemd_timer_driver); } coredevice_initcall(uemd_timer_init);
reg = 0; dev_warn(dev, "unknown timer clock rate\n"); break; } writel(reg, timer_base + TIMERUS_USEC_CFG); cs.mult = clocksource_hz2mult(1000000, cs.shift); return init_clock(&cs); } static __maybe_unused struct of_device_id tegra20_timer_dt_ids[] = { { .compatible = "nvidia,tegra20-timer", }, { /* sentinel */ } }; static struct driver_d tegra20_timer_driver = { .probe = tegra20_timer_probe, .name = "tegra20-timer", .of_compatible = DRV_OF_COMPAT(tegra20_timer_dt_ids), }; static int tegra20_timer_init(void) { return platform_driver_register(&tegra20_timer_driver); } core_initcall(tegra20_timer_init);
.drvvbus = 8, .txep_shift = 0, .txep_mask = 0xffff, .txep_bitmap = (0xffff << 0), .rxep_shift = 16, .rxep_mask = 0xfffe, .rxep_bitmap = (0xfffe << 16), .poll_seconds = 2, }; static __maybe_unused struct of_device_id musb_dsps_dt_ids[] = { { .compatible = "ti,musb-am33xx", .data = (unsigned long) &am33xx_driver_data, }, { /* sentinel */ }, }; static struct driver_d dsps_usbss_driver = { .name = "musb-dsps", .probe = dsps_probe, .of_compatible = DRV_OF_COMPAT(musb_dsps_dt_ids), }; device_platform_driver(dsps_usbss_driver); MODULE_DESCRIPTION("TI DSPS MUSB Glue Layer"); MODULE_AUTHOR("Ravi B <*****@*****.**>"); MODULE_AUTHOR("Ajay Kumar Gupta <*****@*****.**>"); MODULE_LICENSE("GPL v2");
TEGRA124_LANE("pcie-3", 0x134, 22, 0x3, 4, pci, 4), TEGRA124_LANE("pcie-4", 0x134, 24, 0x3, 5, pci, 4), TEGRA124_LANE("sata-0", 0x134, 26, 0x3, 6, pci, 4), }; static const struct tegra_xusb_padctl_soc tegra124_soc = { .num_lanes = ARRAY_SIZE(tegra124_lanes), .lanes = tegra124_lanes, }; static __maybe_unused struct of_device_id pinctrl_tegra_xusb_dt_ids[] = { { .compatible = "nvidia,tegra124-xusb-padctl", .data = &tegra124_soc, }, { /* sentinel */ } }; static struct driver_d pinctrl_tegra_xusb_driver = { .name = "pinctrl-tegra-xusb", .probe = pinctrl_tegra_xusb_probe, .of_compatible = DRV_OF_COMPAT(pinctrl_tegra_xusb_dt_ids), }; static int pinctrl_tegra_xusb_init(void) { return platform_driver_register(&pinctrl_tegra_xusb_driver); } postcore_initcall(pinctrl_tegra_xusb_init);
return 0; } static __maybe_unused struct of_device_id mxs_ocotp_compatible[] = { { .compatible = "fsl,ocotp", }, { /* sentinel */ } }; static struct driver_d mxs_ocotp_driver = { .name = DRIVERNAME, .probe = mxs_ocotp_probe, .of_compatible = DRV_OF_COMPAT(mxs_ocotp_compatible), }; static int mxs_ocotp_init(void) { platform_driver_register(&mxs_ocotp_driver); return 0; } coredevice_initcall(mxs_ocotp_init); int mxs_ocotp_read(void *buf, int count, int offset) { struct cdev *cdev; int ret;
if (gpio_is_valid(panel->enable_gpio)) { if (!(flags & OF_GPIO_ACTIVE_LOW)) panel->enable_active_high = 1; } panel->ddc_node = of_parse_phandle(node, "ddc-i2c-bus", 0); of_property_read_u32(node, "enable-delay", &panel->enable_delay); panel->backlight_node = of_parse_phandle(node, "backlight", 0); ret = vpl_register(&panel->vpl); if (ret) return ret; return 0; } static struct of_device_id simple_panel_of_ids[] = { { .compatible = "simple-panel", }, { } }; static struct driver_d simple_panel_driver = { .name = "simple-panel", .probe = simple_panel_probe, .of_compatible = DRV_OF_COMPAT(simple_panel_of_ids), }; device_platform_driver(simple_panel_driver);
}; static int mc34704_probe(struct device_d *dev) { if (mc34704_dev) return -EBUSY; mc34704_dev = xzalloc(sizeof(struct mc34704)); mc34704_dev->cdev.name = DRIVERNAME; mc34704_dev->client = to_i2c_client(dev); mc34704_dev->cdev.size = 256; mc34704_dev->cdev.dev = dev; mc34704_dev->cdev.ops = &mc34704_fops; devfs_create(&mc34704_dev->cdev); return 0; } static __maybe_unused struct of_device_id mc34704_dt_ids[] = { { .compatible = "fsl,mc34704", }, { } }; static struct driver_d mc34704_driver = { .name = DRIVERNAME, .probe = mc34704_probe, .of_compatible = DRV_OF_COMPAT(mc34704_dt_ids), }; device_i2c_driver(mc34704_driver);
host->clkrate = clk_get_rate(host->clk_ciu); host->mci.f_min = host->clkrate / 510 / host->ciu_div; if (host->mci.f_min < 200000) host->mci.f_min = 200000; host->mci.f_max = host->clkrate / host->ciu_div; mci_of_parse(&host->mci); dev->priv = host; return mci_register(&host->mci); } static __maybe_unused struct of_device_id dw_mmc_compatible[] = { { .compatible = "altr,socfpga-dw-mshc", }, { .compatible = "rockchip,rk2928-dw-mshc", }, { /* sentinel */ } }; static struct driver_d dw_mmc_driver = { .name = "dw_mmc", .probe = dw_mmc_probe, .of_compatible = DRV_OF_COMPAT(dw_mmc_compatible), }; device_platform_driver(dw_mmc_driver);
gc->ngpio = 32; regs = gpio2regs(gpio_base, base); chips[i].regs = regs; chips[i].set_data = ®s->set_data; chips[i].clr_data = ®s->clr_data; chips[i].in_data = ®s->in_data; gpiochip_add(gc); } return 0; } static struct of_device_id davinci_gpio_ids[] = { { .compatible = "ti,dm6441-gpio", }, { /* sentinel */ }, }; static struct driver_d davinci_gpio_driver = { .name = "davinci_gpio", .probe = davinci_gpio_probe, .of_compatible = DRV_OF_COMPAT(davinci_gpio_ids), }; static int davinci_gpio_drv_reg(void) { return platform_driver_register(&davinci_gpio_driver); } coredevice_initcall(davinci_gpio_drv_reg);
} static __maybe_unused struct of_device_id imx_iomux_dt_ids[] = { { .compatible = "fsl,imx31-iomux", }, { /* sentinel */ } }; static struct platform_device_id imx_iomux_ids[] = { { .name = "imx31-iomux", }, { /* sentinel */ }, }; static struct driver_d imx_iomux_driver = { .name = "imx-iomuxv2", .probe = imx_iomux_probe, .of_compatible = DRV_OF_COMPAT(imx_iomux_dt_ids), .id_table = imx_iomux_ids, }; static int imx_iomux_init(void) { return platform_driver_register(&imx_iomux_driver); } postcore_initcall(imx_iomux_init);
dev_info(dev, "probed gpiochip%d with base %d\n", dev->id, chip->gc.base); return 0; err: kfree(chip); return ret; } static __maybe_unused struct of_device_id digic_gpio_dt_ids[] = { { .compatible = "canon,digic-gpio", }, { /* sentinel */ } }; static struct driver_d digic_gpio_driver = { .name = "digic-gpio", .probe = digic_gpio_probe, .of_compatible = DRV_OF_COMPAT(digic_gpio_dt_ids), }; static int digic_gpio_init(void) { return platform_driver_register(&digic_gpio_driver); } coredevice_initcall(digic_gpio_init);
clk_register_clkdev(clks[uart0], NULL, "zynq_serial0"); clk_register_clkdev(clks[uart1], NULL, "zynq_serial1"); clk_register_clkdev(clks[gem0], NULL, "macb0"); clk_register_clkdev(clks[gem1], NULL, "macb1"); clkdev_add_physbase(clks[cpu_3x2x], CORTEXA9_SCU_TIMER_BASE_ADDR, NULL); clkdev_add_physbase(clks[uart1], ZYNQ_UART1_BASE_ADDR, NULL); return 0; } static __maybe_unused struct of_device_id zynq_clock_dt_ids[] = { { .compatible = "xlnx,zynq-clock", }, { /* sentinel */ } }; static struct driver_d zynq_clock_driver = { .probe = zynq_clock_probe, .name = "zynq-clock", .of_compatible = DRV_OF_COMPAT(zynq_clock_dt_ids), }; static int zynq_clock_init(void) { return platform_driver_register(&zynq_clock_driver); } postcore_initcall(zynq_clock_init);
__raw_writel(0xffffffff, timer_base + TIMER0_RELOAD_OFF); val = __raw_readl(timer_base + TIMER_CTRL_OFF); val |= TIMER0_EN | TIMER0_RELOAD_EN; __raw_writel(val, timer_base + TIMER_CTRL_OFF); cs.mult = clocksource_hz2mult(rate, cs.shift); init_clock(&cs); return 0; } static struct of_device_id mvebu_timer_dt_ids[] = { { .compatible = "marvell,armada-370-timer", }, { .compatible = "marvell,armada-xp-timer", }, { } }; static struct driver_d mvebu_timer_driver = { .name = "mvebu-timer", .probe = mvebu_timer_probe, .of_compatible = DRV_OF_COMPAT(mvebu_timer_dt_ids), }; static int mvebu_timer_init(void) { return platform_driver_register(&mvebu_timer_driver); } postcore_initcall(mvebu_timer_init);