Пример #1
0
int __init reconos_init(void) {
	int result;
	dev_t dev = 0;

	PDEBUG("registering device\n");

	if (osif_major) {
		dev = MKDEV(osif_major, osif_minor);
		result = register_chrdev_region(dev, osif_numslots, "osif");
	} else {    // dynamic allocation of device numbers
		result = alloc_chrdev_region(&dev, osif_minor, osif_numslots, "osif");
		osif_major = MAJOR(dev);
	}

	if (result < 0) {
		printk(KERN_WARNING "osif: can't get major %d\n", osif_major);
		return result;
	}

	if (tlb_major) {
		dev = MKDEV(tlb_major, tlb_minor);
		result = register_chrdev_region(dev, tlb_numtlbs, "tlb");
	} else {    // dynamic allocation of device numbers
		result = alloc_chrdev_region(&dev, tlb_minor, tlb_numtlbs, "tlb");
		tlb_major = MAJOR(dev);
	}


	if (result < 0) {
		printk(KERN_WARNING "tlb: can't get major %d\n", osif_major);
		return result;
	}

	//    PDEBUG("registered up to %d char devices with major %d\n", osif_numslots, osif_major);

	result = of_register_platform_driver(&osif_of_driver);
	if (result) {
		printk(KERN_ERR "osif: of_register_platform_driver() failed\n");
		return result;
	}

	result = of_register_platform_driver(&tlb_of_driver);
	if (result) {
		printk(KERN_ERR "tlb: of_register_platform_driver() failed\n");
		return result;
	}

	return result;
}
Пример #2
0
static int __init grlib_apbuart_init(void)
{
	int ret;

	/* Find all APBUARTS in device the tree and initialize their ports */
	ret = grlib_apbuart_configure();
	if (ret)
		return ret;

	printk(KERN_INFO "Serial: GRLIB APBUART driver\n");

	ret = uart_register_driver(&grlib_apbuart_driver);

	if (ret) {
		printk(KERN_ERR "%s: uart_register_driver failed (%i)\n",
		       __FILE__, ret);
		return ret;
	}

	ret = of_register_platform_driver(&grlib_apbuart_of_driver);
	if (ret) {
		printk(KERN_ERR
		       "%s: of_register_platform_driver failed (%i)\n",
		       __FILE__, ret);
		uart_unregister_driver(&grlib_apbuart_driver);
		return ret;
	}

	return ret;
}
Пример #3
0
static int __init sdhci_hlwd_init(void)
{
	drv_printk(KERN_INFO, "%s - version %s\n", DRV_DESCRIPTION,
		   sdhci_hlwd_driver_version);

	return of_register_platform_driver(&sdhci_hlwd_driver);
}
Пример #4
0
static int __init declare_of_platform_devices(void)
{
	of_platform_bus_probe(NULL, of_bus_ids, NULL);
	of_register_platform_driver(&ep8248e_mdio_driver);

	return 0;
}
Пример #5
0
static int __init xps2_init(void)
{
	int status = driver_register(&xps2_driver);
#ifdef CONFIG_OF
	status |= of_register_platform_driver(&xps2_of_driver);
#endif
        return status;
}
Пример #6
0
static int __init tdm_fsl_starlite_init(void)
{
	int ret;
	pr_info(DRV_NAME ": " DRV_DESC ":Init\n");
	ret = of_register_platform_driver(&tdm_fsl_starlite_driver);
	if (ret)
		pr_err(DRV_NAME
			"of_register_platform_driver failed (%i)\n", ret);
	return ret;
}
Пример #7
0
static int __init fsl_i2c_init(void)
{
	int rv;

	rv = of_register_platform_driver(&mpc_i2c_driver);
	if (rv)
		printk(KERN_ERR DRV_NAME 
		       " of_register_platform_driver failed (%i)\n", rv);
	return rv;
}
Пример #8
0
static int __init cpm_uart_init(void)
{
	int ret = uart_register_driver(&cpm_reg);
	if (ret)
		return ret;

	ret = of_register_platform_driver(&cpm_uart_driver);
	if (ret)
		uart_unregister_driver(&cpm_reg);

	return ret;
}
Пример #9
0
static int __init mpc85xx_mc_init(void)
{
	int res = 0;

	printk(KERN_INFO "Freescale(R) MPC85xx EDAC driver, "
	       "(C) 2006 Montavista Software\n");

	/* make sure error reporting method is sane */
	switch (edac_op_state) {
	case EDAC_OPSTATE_POLL:
	case EDAC_OPSTATE_INT:
		break;
	default:
		edac_op_state = EDAC_OPSTATE_INT;
		break;
	}

	res = of_register_platform_driver(&mpc85xx_mc_err_driver);
	if (res)
		printk(KERN_WARNING EDAC_MOD_STR "MC fails to register\n");

	res = of_register_platform_driver(&mpc85xx_l2_err_driver);
	if (res)
		printk(KERN_WARNING EDAC_MOD_STR "L2 fails to register\n");

#ifdef CONFIG_PCI
	res = of_register_platform_driver(&mpc85xx_pci_err_driver);
	if (res)
		printk(KERN_WARNING EDAC_MOD_STR "PCI fails to register\n");
#endif

	/*
	 * need to clear HID1[RFXE] to disable machine check int
	 * so we can catch it
	 */
	if (edac_op_state == EDAC_OPSTATE_INT)
		on_each_cpu(mpc85xx_mc_clear_rfxe, NULL, 0);

	return 0;
}
Пример #10
0
/* Driver initialization and exit */
static int __init labx_dma_driver_init(void)
{
  int returnValue;

#ifdef CONFIG_OF
  returnValue = of_register_platform_driver(&labx_dma_of_driver);
#endif
 
  /* Register as a platform device driver */
  if((returnValue = platform_driver_register(&labx_dma_platform_driver)) < 0) {
    printk(KERN_INFO DRIVER_NAME ": Failed to register platform driver\n");
    return(returnValue);
  }

  return(0);
}
Пример #11
0
static int __init fs_init(void)
{
	int r = setup_immap();
	if (r != 0)
		return r;

	r = of_register_platform_driver(&fs_enet_driver);
	if (r != 0)
		goto out;

	return 0;

out:
	cleanup_immap();
	return r;
}
Пример #12
0
int of_register_driver(struct of_platform_driver *drv, struct bus_type *bus)
{
	/*
	 * Temporary: of_platform_bus used to be distinct from the platform
	 * bus.  It isn't anymore, and so drivers on the platform bus need
	 * to be registered in a special way.
	 *
	 * After all of_platform_bus_type drivers are converted to
	 * platform_drivers, this exception can be removed.
	 */
	if (bus == &platform_bus_type)
		return of_register_platform_driver(drv);

	/* register with core */
	drv->driver.bus = bus;
	return driver_register(&drv->driver);
}
Пример #13
0
int gpio_mdio_init(void)
{
	struct device_node *np;

	np = of_find_compatible_node(NULL, NULL, "1682m-gpio");
	if (!np)
		np = of_find_compatible_node(NULL, NULL,
					     "pasemi,pwrficient-gpio");
	if (!np)
		return -ENODEV;
	gpio_regs = of_iomap(np, 0);
	of_node_put(np);

	if (!gpio_regs)
		return -ENODEV;

	return of_register_platform_driver(&gpio_mdio_driver);
}
Пример #14
0
/* Driver initialization and exit */
static int __devinit aes3_rx_driver_init(void)
{
  int returnValue;
  printk(KERN_INFO DRIVER_NAME ": AES3 Receiver driver\n");
  printk(KERN_INFO DRIVER_NAME ": Copyright(c) Lab X Technologies, LLC\n");

#ifdef CONFIG_OF
  returnValue = of_register_platform_driver(&of_aes3_rx_driver);
#endif
 
  instanceCount = 0;
  /* Register as a platform device driver */
  if((returnValue = platform_driver_register(&aes3_rx_driver)) < 0) {
    printk(KERN_INFO DRIVER_NAME ": Failed to register platform driver\n");
    goto register_failure;
  }
  if((returnValue = register_chrdev_region(MKDEV(DRIVER_MAJOR, 0),MAX_INSTANCES, DRIVER_NAME)) < 0) { 
    printk(KERN_INFO DRIVER_NAME "Failed to allocate character device range\n");
    goto register_failure;
  }
  
  /* Register the Generic Netlink family for use */
  returnValue = genl_register_family(&events_genl_family);
  if(returnValue != 0) {
    printk(KERN_INFO DRIVER_NAME ": Failed to register Generic Netlink family\n");
    goto register_failure;
  }

  /* Register multicast groups */
  returnValue = genl_register_mc_group(&events_genl_family, &labx_aes_mcast);
  if(returnValue != 0) {
    printk(KERN_INFO DRIVER_NAME ": Failed to register Generic Netlink multicast group\n");
    genl_unregister_family(&events_genl_family);
    goto register_failure;
  }

register_failure:
  return(returnValue);
}
Пример #15
0
/* Driver initialization and exit */
static int __init labx_local_audio_driver_init(void)
{
  int returnValue;

  printk(KERN_INFO DRIVER_NAME ": Local Audio Driver\n");
  printk(KERN_INFO DRIVER_NAME ": Copyright (c) Lab X Technologies, LLC\n");

#ifdef CONFIG_OF
  returnValue = of_register_platform_driver(&labx_local_audio_of_driver);
#endif
 
  /* Initialize the instance counter */
  instanceCount = 0;

  /* Register as a platform device driver */
  if((returnValue = platform_driver_register(&labx_local_audio_platform_driver)) < 0) {
    printk(KERN_INFO DRIVER_NAME ": Failed to register platform driver\n");
    return(returnValue);
  }

  return(0);
}
Пример #16
0
/* Driver initialization and exit */
static int __init spi_mailbox_driver_init(void)
{
  int returnValue;
  printk(KERN_INFO DRIVER_NAME ": SPI Mailbox driver\n");
  printk(KERN_INFO DRIVER_NAME ": Copyright(c) Lab X Technologies, LLC\n");

#ifdef CONFIG_OF
  returnValue = of_register_platform_driver(&of_spi_mailbox_driver);
#endif
 
  /* Register as a platform device driver */
  if((returnValue = platform_driver_register(&spi_mailbox_driver)) < 0) {
    printk(KERN_INFO DRIVER_NAME ": Failed to register platform driver\n");
    return(returnValue);
  }

  /* Allocate a range of major / minor device numbers for use */
  instanceCount = 0;
  if((returnValue = register_chrdev_region(MKDEV(DRIVER_MAJOR, 0),MAX_INSTANCES, DRIVER_NAME)) < 0) { 
    printk(KERN_INFO DRIVER_NAME "Failed to allocate character device range\n");
  }
  return(0);
}
Пример #17
0
static int __init isp1760_init(void)
{
	int ret, any_ret = -ENODEV;

	init_kmem_once();

	ret = platform_driver_register(&isp1760_plat_driver);
	if (!ret)
		any_ret = 0;
#ifdef CONFIG_PPC_OF
	ret = of_register_platform_driver(&isp1760_of_driver);
	if (!ret)
		any_ret = 0;
#endif
#ifdef CONFIG_PCI
	ret = pci_register_driver(&isp1761_pci_driver);
	if (!ret)
		any_ret = 0;
#endif

	if (any_ret)
		deinit_kmem_cache();
	return any_ret;
}
Пример #18
0
/* Driver initialization and exit */
static int __init mailbox_driver_init(void)
{
  int returnValue;
  printk(KERN_INFO DRIVER_NAME ": Mailbox Driver\n");
  printk(KERN_INFO DRIVER_NAME ": Copyright (c) Lab X Technologies, LLC\n");

#ifdef CONFIG_OF
  returnValue = of_register_platform_driver(&of_mailbox_driver);
#endif
 
  /* Register as a platform device driver */
  if((returnValue = platform_driver_register(&mailbox_driver)) < 0) {
    printk(KERN_INFO DRIVER_NAME ": Failed to register platform driver\n");
    return(returnValue);
  }

  /* Reset instance count for platform device */
  instanceCount = 0;
  
  /* Initialize the Netlink layer for the driver */
  register_mailbox_netlink();
  
  return(0);
}
Пример #19
0
static inline int __init ulite_of_register(void)
{
	pr_debug("uartlite: calling of_register_platform_driver()\n");
	return of_register_platform_driver(&ulite_of_driver);
}
Пример #20
0
static int __init fs_init(void)
{
	return of_register_platform_driver(&fs_enet_driver);
}
Пример #21
0
int __init uec_mdio_init(void)
{
	return of_register_platform_driver(&uec_mdio_driver);
}
Пример #22
0
static int __init talitos_init(void)
{
	return of_register_platform_driver(&talitos_driver);
}
Пример #23
0
static int __init
mpc52xx_ata_init(void)
{
	printk(KERN_INFO "ata: MPC52xx IDE/ATA libata driver\n");
	return of_register_platform_driver(&mpc52xx_ata_of_platform_driver);
}
Пример #24
0
static __init int of_pci_phb_init(void)
{
	return of_register_platform_driver(&of_pci_phb_driver);
}
static int __init sja1000_ofp_init(void)
{
	return of_register_platform_driver(&sja1000_ofp_driver);
}
Пример #26
0
/* ---------------------------------------------------------------------
 * Module setup and teardown; simply register the of_platform driver
 * for the PSC in I2S mode.
 */
static int __init psc_i2s_init(void)
{
	return of_register_platform_driver(&psc_i2s_driver);
}
Пример #27
0
static int __init fsl_ssi_init(void)
{
	printk(KERN_INFO "Freescale Synchronous Serial Interface (SSI) ASoC Driver\n");

	return of_register_platform_driver(&fsl_ssi_driver);
}
Пример #28
0
static int __init mpc5200_wdt_init(void)
{
	return of_register_platform_driver(&mpc5200_wdt_driver);
}
Пример #29
0
/* Registration helpers to keep the number of #ifdefs to a minimum */
static inline int __init ace_of_register(void)
{
	pr_debug("xsysace: registering OF binding\n");
	return of_register_platform_driver(&ace_of_driver);
}
Пример #30
0
static int __init qe_drv_init(void)
{
	return of_register_platform_driver(&qe_driver);
}