driver: Attach info callback to device, not to driver
Since the info is device specific and not driver specific, attach the callback to the device. This makes it possible to have a info callback for a device which does not have a driver attached. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
This commit is contained in:
parent
4a4f2f20b8
commit
73b0d228e5
|
@ -77,6 +77,9 @@ static int hf_probe(struct device_d *dev)
|
||||||
priv->cdev.size = hf->size;
|
priv->cdev.size = hf->size;
|
||||||
priv->cdev.ops = &hf_fops;
|
priv->cdev.ops = &hf_fops;
|
||||||
priv->cdev.priv = hf;
|
priv->cdev.priv = hf;
|
||||||
|
|
||||||
|
dev->info = hf_info;
|
||||||
|
|
||||||
#ifdef CONFIG_FS_DEVFS
|
#ifdef CONFIG_FS_DEVFS
|
||||||
devfs_create(&priv->cdev);
|
devfs_create(&priv->cdev);
|
||||||
#endif
|
#endif
|
||||||
|
@ -87,7 +90,6 @@ static int hf_probe(struct device_d *dev)
|
||||||
static struct driver_d hf_drv = {
|
static struct driver_d hf_drv = {
|
||||||
.name = "hostfile",
|
.name = "hostfile",
|
||||||
.probe = hf_probe,
|
.probe = hf_probe,
|
||||||
.info = hf_info,
|
|
||||||
};
|
};
|
||||||
device_platform_driver(hf_drv);
|
device_platform_driver(hf_drv);
|
||||||
|
|
||||||
|
@ -111,4 +113,3 @@ int barebox_register_filedev(struct hf_platform_data *hf)
|
||||||
|
|
||||||
return sandbox_add_device(dev);
|
return sandbox_add_device(dev);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -635,6 +635,7 @@ static int ahci_probe(struct device_d *dev)
|
||||||
ahci->dev = dev;
|
ahci->dev = dev;
|
||||||
ahci->mmio_base = regs;
|
ahci->mmio_base = regs;
|
||||||
dev->priv = ahci;
|
dev->priv = ahci;
|
||||||
|
dev->info = ahci_info;
|
||||||
|
|
||||||
ret = ahci_add_host(ahci);
|
ret = ahci_add_host(ahci);
|
||||||
if (ret)
|
if (ret)
|
||||||
|
@ -654,7 +655,6 @@ static __maybe_unused struct of_device_id ahci_dt_ids[] = {
|
||||||
static struct driver_d ahci_driver = {
|
static struct driver_d ahci_driver = {
|
||||||
.name = "ahci",
|
.name = "ahci",
|
||||||
.probe = ahci_probe,
|
.probe = ahci_probe,
|
||||||
.info = ahci_info,
|
|
||||||
.of_compatible = DRV_OF_COMPAT(ahci_dt_ids),
|
.of_compatible = DRV_OF_COMPAT(ahci_dt_ids),
|
||||||
};
|
};
|
||||||
device_platform_driver(ahci_driver);
|
device_platform_driver(ahci_driver);
|
||||||
|
|
|
@ -107,6 +107,7 @@ static int imx_sata_probe(struct device_d *dev)
|
||||||
|
|
||||||
imx_ahci->ahci.dev = dev;
|
imx_ahci->ahci.dev = dev;
|
||||||
dev->priv = &imx_ahci->ahci;
|
dev->priv = &imx_ahci->ahci;
|
||||||
|
dev->info = ahci_info,
|
||||||
|
|
||||||
ret = ahci_add_host(&imx_ahci->ahci);
|
ret = ahci_add_host(&imx_ahci->ahci);
|
||||||
if (ret)
|
if (ret)
|
||||||
|
@ -143,7 +144,6 @@ static struct platform_device_id imx_sata_ids[] = {
|
||||||
static struct driver_d imx_sata_driver = {
|
static struct driver_d imx_sata_driver = {
|
||||||
.name = "imx-sata",
|
.name = "imx-sata",
|
||||||
.probe = imx_sata_probe,
|
.probe = imx_sata_probe,
|
||||||
.info = ahci_info,
|
|
||||||
.id_table = imx_sata_ids,
|
.id_table = imx_sata_ids,
|
||||||
};
|
};
|
||||||
device_platform_driver(imx_sata_driver);
|
device_platform_driver(imx_sata_driver);
|
||||||
|
|
|
@ -201,15 +201,6 @@ struct driver_d *get_driver_by_name(const char *name)
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
static void noinfo(struct device_d *dev)
|
|
||||||
{
|
|
||||||
printf("no info available for %s\n", dev_name(dev));
|
|
||||||
}
|
|
||||||
|
|
||||||
static void noshortinfo(struct device_d *dev)
|
|
||||||
{
|
|
||||||
}
|
|
||||||
|
|
||||||
int register_driver(struct driver_d *drv)
|
int register_driver(struct driver_d *drv)
|
||||||
{
|
{
|
||||||
struct device_d *dev = NULL;
|
struct device_d *dev = NULL;
|
||||||
|
@ -221,11 +212,6 @@ int register_driver(struct driver_d *drv)
|
||||||
list_add_tail(&drv->list, &driver_list);
|
list_add_tail(&drv->list, &driver_list);
|
||||||
list_add_tail(&drv->bus_list, &drv->bus->driver_list);
|
list_add_tail(&drv->bus_list, &drv->bus->driver_list);
|
||||||
|
|
||||||
if (!drv->info)
|
|
||||||
drv->info = noinfo;
|
|
||||||
if (!drv->shortinfo)
|
|
||||||
drv->shortinfo = noshortinfo;
|
|
||||||
|
|
||||||
bus_for_each_device(drv->bus, dev)
|
bus_for_each_device(drv->bus, dev)
|
||||||
match(drv, dev);
|
match(drv, dev);
|
||||||
|
|
||||||
|
@ -489,8 +475,8 @@ static int do_devinfo(int argc, char *argv[])
|
||||||
printf("bus: %s\n\n", dev->bus ?
|
printf("bus: %s\n\n", dev->bus ?
|
||||||
dev->bus->name : "none");
|
dev->bus->name : "none");
|
||||||
|
|
||||||
if (dev->driver)
|
if (dev->info)
|
||||||
dev->driver->info(dev);
|
dev->info(dev);
|
||||||
|
|
||||||
printf("%s\n", list_empty(&dev->parameters) ?
|
printf("%s\n", list_empty(&dev->parameters) ?
|
||||||
"no parameters available" : "Parameters:");
|
"no parameters available" : "Parameters:");
|
||||||
|
|
|
@ -470,7 +470,6 @@ static int atmci_request(struct mci_host *mci, struct mci_cmd *cmd, struct mci_d
|
||||||
return atmci_cmd_done(host, stat);
|
return atmci_cmd_done(host, stat);
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef CONFIG_MCI_INFO
|
|
||||||
static void atmci_info(struct device_d *mci_dev)
|
static void atmci_info(struct device_d *mci_dev)
|
||||||
{
|
{
|
||||||
struct atmel_mci *host = mci_dev->priv;
|
struct atmel_mci *host = mci_dev->priv;
|
||||||
|
@ -493,7 +492,6 @@ static void atmci_info(struct device_d *mci_dev)
|
||||||
gpio_is_valid(pd->detect_pin) ? "yes" : "no");
|
gpio_is_valid(pd->detect_pin) ? "yes" : "no");
|
||||||
|
|
||||||
}
|
}
|
||||||
#endif /* CONFIG_MCI_INFO */
|
|
||||||
/*
|
/*
|
||||||
* HSMCI (High Speed MCI) module is not fully compatible with MCI module.
|
* HSMCI (High Speed MCI) module is not fully compatible with MCI module.
|
||||||
* HSMCI provides DMA support and a new config register but no more supports
|
* HSMCI provides DMA support and a new config register but no more supports
|
||||||
|
@ -603,6 +601,9 @@ static int atmci_probe(struct device_d *hw_dev)
|
||||||
else
|
else
|
||||||
host->sdc_reg = ATMCI_SDCSEL_SLOT_A;
|
host->sdc_reg = ATMCI_SDCSEL_SLOT_A;
|
||||||
|
|
||||||
|
if (IS_ENABLED(CONFIG_MCI_INFO))
|
||||||
|
hw_dev->info = atmci_info;
|
||||||
|
|
||||||
mci_register(&host->mci);
|
mci_register(&host->mci);
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
|
@ -617,8 +618,5 @@ err_gpio_cd_request:
|
||||||
static struct driver_d atmci_driver = {
|
static struct driver_d atmci_driver = {
|
||||||
.name = "atmel_mci",
|
.name = "atmel_mci",
|
||||||
.probe = atmci_probe,
|
.probe = atmci_probe,
|
||||||
#ifdef CONFIG_MCI_INFO
|
|
||||||
.info = atmci_info,
|
|
||||||
#endif
|
|
||||||
};
|
};
|
||||||
device_platform_driver(atmci_driver);
|
device_platform_driver(atmci_driver);
|
||||||
|
|
|
@ -1282,7 +1282,6 @@ static int mci_sd_read(struct block_device *blk, void *buffer, int block,
|
||||||
|
|
||||||
/* ------------------ attach to the device API --------------------------- */
|
/* ------------------ attach to the device API --------------------------- */
|
||||||
|
|
||||||
#ifdef CONFIG_MCI_INFO
|
|
||||||
/**
|
/**
|
||||||
* Extract the Manufacturer ID from the CID
|
* Extract the Manufacturer ID from the CID
|
||||||
* @param mci Instance data
|
* @param mci Instance data
|
||||||
|
@ -1408,7 +1407,6 @@ static void mci_info(struct device_d *mci_dev)
|
||||||
printf(" Manufacturing date: %u.%u\n", extract_mtd_month(mci),
|
printf(" Manufacturing date: %u.%u\n", extract_mtd_month(mci),
|
||||||
extract_mtd_year(mci));
|
extract_mtd_year(mci));
|
||||||
}
|
}
|
||||||
#endif
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Check if the MCI card is already probed
|
* Check if the MCI card is already probed
|
||||||
|
@ -1617,6 +1615,9 @@ static int mci_probe(struct device_d *mci_dev)
|
||||||
goto on_error;
|
goto on_error;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (IS_ENABLED(CONFIG_MCI_INFO))
|
||||||
|
mci_dev->info = mci_info;
|
||||||
|
|
||||||
#ifdef CONFIG_MCI_STARTUP
|
#ifdef CONFIG_MCI_STARTUP
|
||||||
/* if enabled, probe the attached card immediately */
|
/* if enabled, probe the attached card immediately */
|
||||||
mci_card_probe(mci);
|
mci_card_probe(mci);
|
||||||
|
@ -1632,9 +1633,6 @@ on_error:
|
||||||
static struct driver_d mci_driver = {
|
static struct driver_d mci_driver = {
|
||||||
.name = "mci",
|
.name = "mci",
|
||||||
.probe = mci_probe,
|
.probe = mci_probe,
|
||||||
#ifdef CONFIG_MCI_INFO
|
|
||||||
.info = mci_info,
|
|
||||||
#endif
|
|
||||||
};
|
};
|
||||||
|
|
||||||
static int mci_init(void)
|
static int mci_init(void)
|
||||||
|
|
|
@ -536,7 +536,6 @@ static void mxs_mci_set_ios(struct mci_host *host, struct mci_ios *ios)
|
||||||
|
|
||||||
/* ----------------------------------------------------------------------- */
|
/* ----------------------------------------------------------------------- */
|
||||||
|
|
||||||
#ifdef CONFIG_MCI_INFO
|
|
||||||
const unsigned char bus_width[3] = { 1, 4, 8 };
|
const unsigned char bus_width[3] = { 1, 4, 8 };
|
||||||
|
|
||||||
static void mxs_mci_info(struct device_d *hw_dev)
|
static void mxs_mci_info(struct device_d *hw_dev)
|
||||||
|
@ -550,7 +549,6 @@ static void mxs_mci_info(struct device_d *hw_dev)
|
||||||
printf(" Bus width: %u bit\n", bus_width[mxs_mci->bus_width]);
|
printf(" Bus width: %u bit\n", bus_width[mxs_mci->bus_width]);
|
||||||
printf("\n");
|
printf("\n");
|
||||||
}
|
}
|
||||||
#endif
|
|
||||||
|
|
||||||
static int mxs_mci_probe(struct device_d *hw_dev)
|
static int mxs_mci_probe(struct device_d *hw_dev)
|
||||||
{
|
{
|
||||||
|
@ -617,10 +615,11 @@ static int mxs_mci_probe(struct device_d *hw_dev)
|
||||||
host->f_max, mxs_mci_get_unit_clock(mxs_mci) / 2 / 1);
|
host->f_max, mxs_mci_get_unit_clock(mxs_mci) / 2 / 1);
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef CONFIG_MCI_INFO
|
if (IS_ENABLED(CONFIG_MCI_INFO)) {
|
||||||
mxs_mci->f_min = host->f_min;
|
mxs_mci->f_min = host->f_min;
|
||||||
mxs_mci->f_max = host->f_max;
|
mxs_mci->f_max = host->f_max;
|
||||||
#endif
|
hw_dev->info = mxs_mci_info;
|
||||||
|
}
|
||||||
|
|
||||||
return mci_register(host);
|
return mci_register(host);
|
||||||
}
|
}
|
||||||
|
@ -628,8 +627,5 @@ static int mxs_mci_probe(struct device_d *hw_dev)
|
||||||
static struct driver_d mxs_mci_driver = {
|
static struct driver_d mxs_mci_driver = {
|
||||||
.name = "mxs_mci",
|
.name = "mxs_mci",
|
||||||
.probe = mxs_mci_probe,
|
.probe = mxs_mci_probe,
|
||||||
#ifdef CONFIG_MCI_INFO
|
|
||||||
.info = mxs_mci_info,
|
|
||||||
#endif
|
|
||||||
};
|
};
|
||||||
device_platform_driver(mxs_mci_driver);
|
device_platform_driver(mxs_mci_driver);
|
||||||
|
|
|
@ -700,7 +700,6 @@ static void mci_set_ios(struct mci_host *host, struct mci_ios *ios)
|
||||||
|
|
||||||
/* ----------------------------------------------------------------------- */
|
/* ----------------------------------------------------------------------- */
|
||||||
|
|
||||||
#ifdef CONFIG_MCI_INFO
|
|
||||||
static void s3c_info(struct device_d *hw_dev)
|
static void s3c_info(struct device_d *hw_dev)
|
||||||
{
|
{
|
||||||
struct s3c_mci_host *host = hw_dev->priv;
|
struct s3c_mci_host *host = hw_dev->priv;
|
||||||
|
@ -720,7 +719,6 @@ static void s3c_info(struct device_d *hw_dev)
|
||||||
printf("\n Card detection support: %s\n",
|
printf("\n Card detection support: %s\n",
|
||||||
pd->gpio_detect != 0 ? "yes" : "no");
|
pd->gpio_detect != 0 ? "yes" : "no");
|
||||||
}
|
}
|
||||||
#endif
|
|
||||||
|
|
||||||
static int s3c_mci_probe(struct device_d *hw_dev)
|
static int s3c_mci_probe(struct device_d *hw_dev)
|
||||||
{
|
{
|
||||||
|
@ -751,6 +749,9 @@ static int s3c_mci_probe(struct device_d *hw_dev)
|
||||||
s3c_host->host.f_min = pd->f_min == 0 ? s3c_get_pclk() / 256 : pd->f_min;
|
s3c_host->host.f_min = pd->f_min == 0 ? s3c_get_pclk() / 256 : pd->f_min;
|
||||||
s3c_host->host.f_max = pd->f_max == 0 ? s3c_get_pclk() / 2 : pd->f_max;
|
s3c_host->host.f_max = pd->f_max == 0 ? s3c_get_pclk() / 2 : pd->f_max;
|
||||||
|
|
||||||
|
if (IS_ENABLED(iCONFIG_MCI_INFO))
|
||||||
|
hw_dev->info = s3c_info;
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Start the clock to let the engine and the card finishes its startup
|
* Start the clock to let the engine and the card finishes its startup
|
||||||
*/
|
*/
|
||||||
|
@ -763,8 +764,5 @@ static int s3c_mci_probe(struct device_d *hw_dev)
|
||||||
static struct driver_d s3c_mci_driver = {
|
static struct driver_d s3c_mci_driver = {
|
||||||
.name = "s3c_mci",
|
.name = "s3c_mci",
|
||||||
.probe = s3c_mci_probe,
|
.probe = s3c_mci_probe,
|
||||||
#ifdef CONFIG_MCI_INFO
|
|
||||||
.info = s3c_info,
|
|
||||||
#endif
|
|
||||||
};
|
};
|
||||||
device_platform_driver(s3c_mci_driver);
|
device_platform_driver(s3c_mci_driver);
|
||||||
|
|
|
@ -269,6 +269,25 @@ static struct file_operations jtag_operations = {
|
||||||
.ioctl = jtag_ioctl,
|
.ioctl = jtag_ioctl,
|
||||||
};
|
};
|
||||||
|
|
||||||
|
static void jtag_info(struct device_d *pdev)
|
||||||
|
{
|
||||||
|
int dn, ret;
|
||||||
|
struct jtag_rd_id jid;
|
||||||
|
struct jtag_info *info = pdev->priv;
|
||||||
|
|
||||||
|
printf(" JTAG:\n");
|
||||||
|
printf(" Devices found: %d\n", info->devices);
|
||||||
|
for (dn = 0; dn < info->devices; dn++) {
|
||||||
|
jid.device = dn;
|
||||||
|
ret = jtag_ioctl(&info->cdev, JTAG_GET_ID, &jid);
|
||||||
|
printf(" Device number: %d\n", dn);
|
||||||
|
if (ret == -1)
|
||||||
|
printf(" JTAG_GET_ID failed: %s\n", strerror(errno));
|
||||||
|
else
|
||||||
|
printf(" ID: 0x%lX\n", jid.id);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
static int jtag_probe(struct device_d *pdev)
|
static int jtag_probe(struct device_d *pdev)
|
||||||
{
|
{
|
||||||
int i, ret;
|
int i, ret;
|
||||||
|
@ -323,6 +342,7 @@ static int jtag_probe(struct device_d *pdev)
|
||||||
info->devices = i;
|
info->devices = i;
|
||||||
info->pdata = pdata;
|
info->pdata = pdata;
|
||||||
pdev->priv = info;
|
pdev->priv = info;
|
||||||
|
pdev->info = jtag_info;
|
||||||
|
|
||||||
info->cdev.name = JTAG_NAME;
|
info->cdev.name = JTAG_NAME;
|
||||||
info->cdev.dev = pdev;
|
info->cdev.dev = pdev;
|
||||||
|
@ -341,25 +361,6 @@ fail_devfs_create:
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
static void jtag_info(struct device_d *pdev)
|
|
||||||
{
|
|
||||||
int dn, ret;
|
|
||||||
struct jtag_rd_id jid;
|
|
||||||
struct jtag_info *info = pdev->priv;
|
|
||||||
|
|
||||||
printf(" JTAG:\n");
|
|
||||||
printf(" Devices found: %d\n", info->devices);
|
|
||||||
for (dn = 0; dn < info->devices; dn++) {
|
|
||||||
jid.device = dn;
|
|
||||||
ret = jtag_ioctl(&info->cdev, JTAG_GET_ID, &jid);
|
|
||||||
printf(" Device number: %d\n", dn);
|
|
||||||
if (ret == -1)
|
|
||||||
printf(" JTAG_GET_ID failed: %s\n", strerror(errno));
|
|
||||||
else
|
|
||||||
printf(" ID: 0x%lX\n", jid.id);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
static void jtag_remove(struct device_d *pdev)
|
static void jtag_remove(struct device_d *pdev)
|
||||||
{
|
{
|
||||||
struct jtag_info *info = (struct jtag_info *) pdev->priv;
|
struct jtag_info *info = (struct jtag_info *) pdev->priv;
|
||||||
|
@ -374,7 +375,6 @@ static struct driver_d jtag_driver = {
|
||||||
.name = JTAG_NAME,
|
.name = JTAG_NAME,
|
||||||
.probe = jtag_probe,
|
.probe = jtag_probe,
|
||||||
.remove = jtag_remove,
|
.remove = jtag_remove,
|
||||||
.info = jtag_info,
|
|
||||||
};
|
};
|
||||||
device_platform_driver(jtag_driver);
|
device_platform_driver(jtag_driver);
|
||||||
|
|
||||||
|
|
|
@ -972,6 +972,8 @@ static int cfi_probe (struct device_d *dev)
|
||||||
dev_info(dev, "found cfi flash at %p, size %ld\n",
|
dev_info(dev, "found cfi flash at %p, size %ld\n",
|
||||||
info->base, info->size);
|
info->base, info->size);
|
||||||
|
|
||||||
|
dev->info = cfi_info;
|
||||||
|
|
||||||
cfi_init_mtd(info);
|
cfi_init_mtd(info);
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
|
@ -988,7 +990,6 @@ static __maybe_unused struct of_device_id cfi_dt_ids[] = {
|
||||||
static struct driver_d cfi_driver = {
|
static struct driver_d cfi_driver = {
|
||||||
.name = "cfi_flash",
|
.name = "cfi_flash",
|
||||||
.probe = cfi_probe,
|
.probe = cfi_probe,
|
||||||
.info = cfi_info,
|
|
||||||
.of_compatible = DRV_OF_COMPAT(cfi_dt_ids),
|
.of_compatible = DRV_OF_COMPAT(cfi_dt_ids),
|
||||||
};
|
};
|
||||||
device_platform_driver(cfi_driver);
|
device_platform_driver(cfi_driver);
|
||||||
|
|
|
@ -459,6 +459,8 @@ static int cs8900_probe(struct device_d *dev)
|
||||||
edev->set_ethaddr = cs8900_set_ethaddr;
|
edev->set_ethaddr = cs8900_set_ethaddr;
|
||||||
edev->parent = dev;
|
edev->parent = dev;
|
||||||
|
|
||||||
|
dev->info = cs8900_info;
|
||||||
|
|
||||||
eth_register(edev);
|
eth_register(edev);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
@ -466,6 +468,5 @@ static int cs8900_probe(struct device_d *dev)
|
||||||
static struct driver_d cs8900_driver = {
|
static struct driver_d cs8900_driver = {
|
||||||
.name = "cs8900",
|
.name = "cs8900",
|
||||||
.probe = cs8900_probe,
|
.probe = cs8900_probe,
|
||||||
.info = cs8900_info,
|
|
||||||
};
|
};
|
||||||
device_platform_driver(cs8900_driver);
|
device_platform_driver(cs8900_driver);
|
||||||
|
|
|
@ -144,7 +144,6 @@ static void fb_info(struct device_d *dev)
|
||||||
|
|
||||||
static struct driver_d fb_driver = {
|
static struct driver_d fb_driver = {
|
||||||
.name = "fb",
|
.name = "fb",
|
||||||
.info = fb_info,
|
|
||||||
};
|
};
|
||||||
|
|
||||||
static int fb_match(struct device_d *dev, struct driver_d *drv)
|
static int fb_match(struct device_d *dev, struct driver_d *drv)
|
||||||
|
@ -165,6 +164,8 @@ static int fb_probe(struct device_d *dev)
|
||||||
dev_set_param(dev, "mode_name", info->mode_list[0].name);
|
dev_set_param(dev, "mode_name", info->mode_list[0].name);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
dev->info = fb_info;
|
||||||
|
|
||||||
return devfs_create(&info->cdev);
|
return devfs_create(&info->cdev);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -321,7 +321,6 @@ static int s3cfb_activate_var(struct fb_info *fb_info)
|
||||||
* Print some information about the current hardware state
|
* Print some information about the current hardware state
|
||||||
* @param hw_dev S3C video device
|
* @param hw_dev S3C video device
|
||||||
*/
|
*/
|
||||||
#ifdef CONFIG_DRIVER_VIDEO_S3C_VERBOSE
|
|
||||||
static void s3cfb_info(struct device_d *hw_dev)
|
static void s3cfb_info(struct device_d *hw_dev)
|
||||||
{
|
{
|
||||||
uint32_t con1, addr1, addr2, addr3;
|
uint32_t con1, addr1, addr2, addr3;
|
||||||
|
@ -340,7 +339,6 @@ static void s3cfb_info(struct device_d *hw_dev)
|
||||||
printf(" Virtual screen offset size: %u half words\n", GET_OFFSIZE(addr3));
|
printf(" Virtual screen offset size: %u half words\n", GET_OFFSIZE(addr3));
|
||||||
printf(" Virtual screen page width: %u half words\n", GET_PAGE_WIDTH(addr3));
|
printf(" Virtual screen page width: %u half words\n", GET_PAGE_WIDTH(addr3));
|
||||||
}
|
}
|
||||||
#endif
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* There is only one video hardware instance available.
|
* There is only one video hardware instance available.
|
||||||
|
@ -390,6 +388,9 @@ static int s3cfb_probe(struct device_d *hw_dev)
|
||||||
fbi.passive_display = pdata->passive_display;
|
fbi.passive_display = pdata->passive_display;
|
||||||
fbi.enable = pdata->enable;
|
fbi.enable = pdata->enable;
|
||||||
|
|
||||||
|
if (IS_ENABLED(CONFIG_DRIVER_VIDEO_S3C_VERBOSE))
|
||||||
|
hw_dev->info = s3cfb_info;
|
||||||
|
|
||||||
ret = register_framebuffer(&fbi.info);
|
ret = register_framebuffer(&fbi.info);
|
||||||
if (ret != 0) {
|
if (ret != 0) {
|
||||||
dev_err(hw_dev, "Failed to register framebuffer\n");
|
dev_err(hw_dev, "Failed to register framebuffer\n");
|
||||||
|
@ -402,9 +403,6 @@ static int s3cfb_probe(struct device_d *hw_dev)
|
||||||
static struct driver_d s3cfb_driver = {
|
static struct driver_d s3cfb_driver = {
|
||||||
.name = "s3c_fb",
|
.name = "s3c_fb",
|
||||||
.probe = s3cfb_probe,
|
.probe = s3cfb_probe,
|
||||||
#ifdef CONFIG_DRIVER_VIDEO_S3C_VERBOSE
|
|
||||||
.info = s3cfb_info,
|
|
||||||
#endif
|
|
||||||
};
|
};
|
||||||
device_platform_driver(s3cfb_driver);
|
device_platform_driver(s3cfb_driver);
|
||||||
|
|
||||||
|
|
|
@ -502,6 +502,8 @@ static int stmfb_probe(struct device_d *hw_dev)
|
||||||
else
|
else
|
||||||
fbi.info.bits_per_pixel = 16;
|
fbi.info.bits_per_pixel = 16;
|
||||||
|
|
||||||
|
hw_dev->info = stmfb_info;
|
||||||
|
|
||||||
ret = register_framebuffer(&fbi.info);
|
ret = register_framebuffer(&fbi.info);
|
||||||
if (ret != 0) {
|
if (ret != 0) {
|
||||||
dev_err(hw_dev, "Failed to register framebuffer\n");
|
dev_err(hw_dev, "Failed to register framebuffer\n");
|
||||||
|
@ -514,7 +516,6 @@ static int stmfb_probe(struct device_d *hw_dev)
|
||||||
static struct driver_d stmfb_driver = {
|
static struct driver_d stmfb_driver = {
|
||||||
.name = "stmfb",
|
.name = "stmfb",
|
||||||
.probe = stmfb_probe,
|
.probe = stmfb_probe,
|
||||||
.info = stmfb_info,
|
|
||||||
};
|
};
|
||||||
device_platform_driver(stmfb_driver);
|
device_platform_driver(stmfb_driver);
|
||||||
|
|
||||||
|
|
|
@ -107,6 +107,8 @@ struct device_d {
|
||||||
struct device_node *device_node;
|
struct device_node *device_node;
|
||||||
|
|
||||||
struct of_device_id *of_id_entry;
|
struct of_device_id *of_id_entry;
|
||||||
|
|
||||||
|
void (*info) (struct device_d *);
|
||||||
};
|
};
|
||||||
|
|
||||||
/** @brief Describes a driver present in the system */
|
/** @brief Describes a driver present in the system */
|
||||||
|
@ -124,9 +126,6 @@ struct driver_d {
|
||||||
/*! Called if an instance of a device is gone. */
|
/*! Called if an instance of a device is gone. */
|
||||||
void (*remove)(struct device_d *);
|
void (*remove)(struct device_d *);
|
||||||
|
|
||||||
void (*info) (struct device_d *);
|
|
||||||
void (*shortinfo) (struct device_d *);
|
|
||||||
|
|
||||||
struct bus_type *bus;
|
struct bus_type *bus;
|
||||||
|
|
||||||
struct platform_device_id *id_table;
|
struct platform_device_id *id_table;
|
||||||
|
|
Loading…
Reference in New Issue