Lines Matching refs:ibm

225 #define TPACPI_URL "http://ibm-acpi.sf.net/"
226 #define TPACPI_MAIL "ibm-acpi-devel@lists.sourceforge.net"
228 #define TPACPI_PROC_DIR "ibm"
229 #define TPACPI_ACPI_EVENT_PREFIX "ibm"
767 struct ibm_struct *ibm = data;
772 if (!ibm || !ibm->acpi || !ibm->acpi->notify)
775 ibm->acpi->notify(ibm, event);
778 static int __init setup_acpi_notify(struct ibm_struct *ibm)
783 BUG_ON(!ibm->acpi);
785 if (!*ibm->acpi->handle)
789 "setting up ACPI notify for %s\n", ibm->name);
791 rc = acpi_bus_get_device(*ibm->acpi->handle, &ibm->acpi->device);
793 pr_err("acpi_bus_get_device(%s) failed: %d\n", ibm->name, rc);
797 ibm->acpi->device->driver_data = ibm;
798 sprintf(acpi_device_class(ibm->acpi->device), "%s/%s",
800 ibm->name);
802 status = acpi_install_notify_handler(*ibm->acpi->handle,
803 ibm->acpi->type, dispatch_acpi_notify, ibm);
807 ibm->name);
810 ibm->name, acpi_format_exception(status));
814 ibm->flags.acpi_notify_installed = 1;
823 static int __init register_tpacpi_subdriver(struct ibm_struct *ibm)
828 "registering %s as an ACPI driver\n", ibm->name);
830 BUG_ON(!ibm->acpi);
832 ibm->acpi->driver = kzalloc(sizeof(struct acpi_driver), GFP_KERNEL);
833 if (!ibm->acpi->driver) {
834 pr_err("failed to allocate memory for ibm->acpi->driver\n");
838 sprintf(ibm->acpi->driver->name, "%s_%s", TPACPI_NAME, ibm->name);
839 ibm->acpi->driver->ids = ibm->acpi->hid;
841 ibm->acpi->driver->ops.add = &tpacpi_device_add;
843 rc = acpi_bus_register_driver(ibm->acpi->driver);
846 ibm->name, rc);
847 kfree(ibm->acpi->driver);
848 ibm->acpi->driver = NULL;
850 ibm->flags.acpi_driver_registered = 1;
866 struct ibm_struct *ibm = m->private;
868 if (!ibm || !ibm->read)
870 return ibm->read(m);
882 struct ibm_struct *ibm = PDE_DATA(file_inode(file));
886 if (!ibm || !ibm->write)
901 ret = ibm->write(kernbuf);
936 struct ibm_struct *ibm, *itmp;
938 list_for_each_entry_safe(ibm, itmp,
941 if (ibm->suspend)
942 (ibm->suspend)();
950 struct ibm_struct *ibm, *itmp;
952 list_for_each_entry_safe(ibm, itmp,
955 if (ibm->resume)
956 (ibm->resume)();
968 struct ibm_struct *ibm, *itmp;
970 list_for_each_entry_safe(ibm, itmp,
973 if (ibm->shutdown)
974 (ibm->shutdown)();
3256 * ibm-acpi-devel mailing lists, and you should read the
4104 static void hotkey_notify(struct ibm_struct *ibm, u32 event)
4115 ibm->acpi->device->pnp.device_class,
4116 dev_name(&ibm->acpi->device->dev),
4201 ibm->acpi->device->pnp.device_class,
4202 dev_name(&ibm->acpi->device->dev),
9730 static int __init tpacpi_battery_init(struct ibm_init_struct *ibm)
10029 static void ibm_exit(struct ibm_struct *ibm)
10031 dbg_printk(TPACPI_DBG_EXIT, "removing %s\n", ibm->name);
10033 list_del_init(&ibm->all_drivers);
10035 if (ibm->flags.acpi_notify_installed) {
10037 "%s: acpi_remove_notify_handler\n", ibm->name);
10038 BUG_ON(!ibm->acpi);
10039 acpi_remove_notify_handler(*ibm->acpi->handle,
10040 ibm->acpi->type,
10042 ibm->flags.acpi_notify_installed = 0;
10045 if (ibm->flags.proc_created) {
10047 "%s: remove_proc_entry\n", ibm->name);
10048 remove_proc_entry(ibm->name, proc_dir);
10049 ibm->flags.proc_created = 0;
10052 if (ibm->flags.acpi_driver_registered) {
10054 "%s: acpi_bus_unregister_driver\n", ibm->name);
10055 BUG_ON(!ibm->acpi);
10056 acpi_bus_unregister_driver(ibm->acpi->driver);
10057 kfree(ibm->acpi->driver);
10058 ibm->acpi->driver = NULL;
10059 ibm->flags.acpi_driver_registered = 0;
10062 if (ibm->flags.init_called && ibm->exit) {
10063 ibm->exit();
10064 ibm->flags.init_called = 0;
10067 dbg_printk(TPACPI_DBG_INIT, "finished removing %s\n", ibm->name);
10073 struct ibm_struct *ibm = iibm->data;
10076 BUG_ON(ibm == NULL);
10078 INIT_LIST_HEAD(&ibm->all_drivers);
10080 if (ibm->flags.experimental && !experimental)
10084 "probing for %s\n", ibm->name);
10093 ibm->flags.init_called = 1;
10096 if (ibm->acpi) {
10097 if (ibm->acpi->hid) {
10098 ret = register_tpacpi_subdriver(ibm);
10103 if (ibm->acpi->notify) {
10104 ret = setup_acpi_notify(ibm);
10107 ibm->name);
10117 "%s installed\n", ibm->name);
10119 if (ibm->read) {
10124 if (ibm->write)
10126 entry = proc_create_data(ibm->name, mode, proc_dir,
10127 &dispatch_proc_ops, ibm);
10129 pr_err("unable to create proc entry %s\n", ibm->name);
10133 ibm->flags.proc_created = 1;
10136 list_add_tail(&ibm->all_drivers, &tpacpi_all_drivers);
10143 ibm->name, ret);
10145 ibm_exit(ibm);
10449 struct ibm_struct *ibm;
10455 ibm = ibms_init[i].data;
10456 WARN_ON(ibm == NULL);
10458 if (!ibm || !ibm->name)
10461 if (strcmp(ibm->name, kp->name) == 0 && ibm->write) {
10565 struct ibm_struct *ibm, *itmp;
10569 list_for_each_entry_safe_reverse(ibm, itmp,
10572 ibm_exit(ibm);