Lines Matching refs:ibm

242 #define TPACPI_URL "http://ibm-acpi.sf.net/"
243 #define TPACPI_MAIL "ibm-acpi-devel@lists.sourceforge.net"
245 #define TPACPI_PROC_DIR "ibm"
246 #define TPACPI_ACPI_EVENT_PREFIX "ibm"
788 struct ibm_struct *ibm = data;
793 if (!ibm || !ibm->acpi || !ibm->acpi->notify)
796 ibm->acpi->notify(ibm, event);
799 static int __init setup_acpi_notify(struct ibm_struct *ibm)
803 BUG_ON(!ibm->acpi);
805 if (!*ibm->acpi->handle)
809 "setting up ACPI notify for %s\n", ibm->name);
811 ibm->acpi->device = acpi_fetch_acpi_dev(*ibm->acpi->handle);
812 if (!ibm->acpi->device) {
813 pr_err("acpi_fetch_acpi_dev(%s) failed\n", ibm->name);
817 ibm->acpi->device->driver_data = ibm;
818 sprintf(acpi_device_class(ibm->acpi->device), "%s/%s",
820 ibm->name);
822 status = acpi_install_notify_handler(*ibm->acpi->handle,
823 ibm->acpi->type, dispatch_acpi_notify, ibm);
827 ibm->name);
830 ibm->name, acpi_format_exception(status));
834 ibm->flags.acpi_notify_installed = 1;
843 static int __init register_tpacpi_subdriver(struct ibm_struct *ibm)
848 "registering %s as an ACPI driver\n", ibm->name);
850 BUG_ON(!ibm->acpi);
852 ibm->acpi->driver = kzalloc(sizeof(struct acpi_driver), GFP_KERNEL);
853 if (!ibm->acpi->driver) {
854 pr_err("failed to allocate memory for ibm->acpi->driver\n");
858 sprintf(ibm->acpi->driver->name, "%s_%s", TPACPI_NAME, ibm->name);
859 ibm->acpi->driver->ids = ibm->acpi->hid;
861 ibm->acpi->driver->ops.add = &tpacpi_device_add;
863 rc = acpi_bus_register_driver(ibm->acpi->driver);
866 ibm->name, rc);
867 kfree(ibm->acpi->driver);
868 ibm->acpi->driver = NULL;
870 ibm->flags.acpi_driver_registered = 1;
886 struct ibm_struct *ibm = m->private;
888 if (!ibm || !ibm->read)
890 return ibm->read(m);
902 struct ibm_struct *ibm = pde_data(file_inode(file));
906 if (!ibm || !ibm->write)
914 ret = ibm->write(kernbuf);
949 struct ibm_struct *ibm, *itmp;
951 list_for_each_entry_safe(ibm, itmp,
954 if (ibm->suspend)
955 (ibm->suspend)();
963 struct ibm_struct *ibm, *itmp;
965 list_for_each_entry_safe(ibm, itmp,
968 if (ibm->resume)
969 (ibm->resume)();
981 struct ibm_struct *ibm, *itmp;
983 list_for_each_entry_safe(ibm, itmp,
986 if (ibm->shutdown)
987 (ibm->shutdown)();
3153 * ibm-acpi-devel mailing lists, and you should read the
3996 static void hotkey_notify(struct ibm_struct *ibm, u32 event)
4007 ibm->acpi->device->pnp.device_class,
4008 dev_name(&ibm->acpi->device->dev),
4093 ibm->acpi->device->pnp.device_class,
4094 dev_name(&ibm->acpi->device->dev),
9900 static int __init tpacpi_battery_init(struct ibm_init_struct *ibm)
11066 static void ibm_exit(struct ibm_struct *ibm)
11068 dbg_printk(TPACPI_DBG_EXIT, "removing %s\n", ibm->name);
11070 list_del_init(&ibm->all_drivers);
11072 if (ibm->flags.acpi_notify_installed) {
11074 "%s: acpi_remove_notify_handler\n", ibm->name);
11075 BUG_ON(!ibm->acpi);
11076 acpi_remove_notify_handler(*ibm->acpi->handle,
11077 ibm->acpi->type,
11079 ibm->flags.acpi_notify_installed = 0;
11082 if (ibm->flags.proc_created) {
11084 "%s: remove_proc_entry\n", ibm->name);
11085 remove_proc_entry(ibm->name, proc_dir);
11086 ibm->flags.proc_created = 0;
11089 if (ibm->flags.acpi_driver_registered) {
11091 "%s: acpi_bus_unregister_driver\n", ibm->name);
11092 BUG_ON(!ibm->acpi);
11093 acpi_bus_unregister_driver(ibm->acpi->driver);
11094 kfree(ibm->acpi->driver);
11095 ibm->acpi->driver = NULL;
11096 ibm->flags.acpi_driver_registered = 0;
11099 if (ibm->flags.init_called && ibm->exit) {
11100 ibm->exit();
11101 ibm->flags.init_called = 0;
11104 dbg_printk(TPACPI_DBG_INIT, "finished removing %s\n", ibm->name);
11110 struct ibm_struct *ibm = iibm->data;
11113 BUG_ON(ibm == NULL);
11115 INIT_LIST_HEAD(&ibm->all_drivers);
11117 if (ibm->flags.experimental && !experimental)
11121 "probing for %s\n", ibm->name);
11130 ibm->flags.init_called = 1;
11133 if (ibm->acpi) {
11134 if (ibm->acpi->hid) {
11135 ret = register_tpacpi_subdriver(ibm);
11140 if (ibm->acpi->notify) {
11141 ret = setup_acpi_notify(ibm);
11144 ibm->name);
11154 "%s installed\n", ibm->name);
11156 if (ibm->read) {
11161 if (ibm->write)
11163 entry = proc_create_data(ibm->name, mode, proc_dir,
11164 &dispatch_proc_ops, ibm);
11166 pr_err("unable to create proc entry %s\n", ibm->name);
11170 ibm->flags.proc_created = 1;
11173 list_add_tail(&ibm->all_drivers, &tpacpi_all_drivers);
11180 ibm->name, ret);
11182 ibm_exit(ibm);
11498 struct ibm_struct *ibm;
11504 ibm = ibms_init[i].data;
11505 if (!ibm || !ibm->name)
11508 if (strcmp(ibm->name, kp->name) == 0 && ibm->write) {
11615 struct ibm_struct *ibm, *itmp;
11626 list_for_each_entry_safe_reverse(ibm, itmp,
11629 ibm_exit(ibm);