Lines Matching defs:ds

97  * @ds: The dock station
103 add_dock_dependent_device(struct dock_station *ds, acpi_handle handle)
115 spin_lock(&ds->dd_lock);
116 list_add_tail(&dd->list, &ds->dependent_devices);
117 spin_unlock(&ds->dd_lock);
124 * @ds: The dock station
130 dock_add_hotplug_device(struct dock_station *ds,
133 mutex_lock(&ds->hp_lock);
134 list_add_tail(&dd->hotplug_list, &ds->hotplug_devices);
135 mutex_unlock(&ds->hp_lock);
140 * @ds: The dock station
146 dock_del_hotplug_device(struct dock_station *ds,
149 mutex_lock(&ds->hp_lock);
151 mutex_unlock(&ds->hp_lock);
156 * @ds: the dock station
163 find_dock_dependent_device(struct dock_station *ds, acpi_handle handle)
167 spin_lock(&ds->dd_lock);
168 list_for_each_entry(dd, &ds->dependent_devices, list) {
170 spin_unlock(&ds->dd_lock);
174 spin_unlock(&ds->dd_lock);
280 * @ds: the dock station
285 static int dock_present(struct dock_station *ds)
290 if (ds) {
291 status = acpi_evaluate_integer(ds->handle, "_STA", NULL, &sta);
356 * @ds: the dock station
364 static void hotplug_dock_devices(struct dock_station *ds, u32 event)
368 mutex_lock(&ds->hp_lock);
373 list_for_each_entry(dd, &ds->hotplug_devices, hotplug_list)
383 list_for_each_entry(dd, &ds->dependent_devices, list) {
389 mutex_unlock(&ds->hp_lock);
392 static void dock_event(struct dock_station *ds, u32 event, int num)
394 struct device *dev = &ds->dock_device->dev;
411 list_for_each_entry(dd, &ds->hotplug_devices, hotplug_list)
421 * @ds: the dock station
426 static void eject_dock(struct dock_station *ds)
434 status = acpi_get_handle(ds->handle, "_EJ0", &tmp);
445 status = acpi_evaluate_object(ds->handle, "_EJ0", &arg_list, NULL);
452 * @ds: the dock station
457 static void handle_dock(struct dock_station *ds, int dock)
465 acpi_get_name(ds->handle, ACPI_FULL_PATHNAME, &name_buffer);
475 status = acpi_evaluate_object(ds->handle, "_DCK", &arg_list, &buffer);
484 static inline void dock(struct dock_station *ds)
486 handle_dock(ds, 1);
489 static inline void undock(struct dock_station *ds)
491 handle_dock(ds, 0);
494 static inline void begin_dock(struct dock_station *ds)
496 ds->flags |= DOCK_DOCKING;
499 static inline void complete_dock(struct dock_station *ds)
501 ds->flags &= ~(DOCK_DOCKING);
502 ds->last_dock_time = jiffies;
505 static inline void begin_undock(struct dock_station *ds)
507 ds->flags |= DOCK_UNDOCKING;
510 static inline void complete_undock(struct dock_station *ds)
512 ds->flags &= ~(DOCK_UNDOCKING);
515 static void dock_lock(struct dock_station *ds, int lock)
525 status = acpi_evaluate_object(ds->handle, "_LCK", &arg_list, NULL);
536 * @ds: the dock station
542 static int dock_in_progress(struct dock_station *ds)
544 if ((ds->flags & DOCK_DOCKING) ||
545 time_before(jiffies, (ds->last_dock_time + HZ)))
651 static int handle_eject_request(struct dock_station *ds, u32 event)
653 if (dock_in_progress(ds))
663 dock_event(ds, event, UNDOCK_EVENT);
665 hotplug_dock_devices(ds, ACPI_NOTIFY_EJECT_REQUEST);
666 undock(ds);
667 dock_lock(ds, 0);
668 eject_dock(ds);
669 if (dock_present(ds)) {
673 complete_undock(ds);
689 struct dock_station *ds = data;
698 if ((ds->flags & DOCK_IS_DOCK) && event == ACPI_NOTIFY_DEVICE_CHECK)
713 if (!dock_in_progress(ds) && acpi_bus_get_device(ds->handle,
715 begin_dock(ds);
716 dock(ds);
717 if (!dock_present(ds)) {
719 complete_dock(ds);
724 hotplug_dock_devices(ds, event);
725 complete_dock(ds);
726 dock_event(ds, event, DOCK_EVENT);
727 dock_lock(ds, 1);
731 if (dock_present(ds) || dock_in_progress(ds))
738 begin_undock(ds);
739 if ((immediate_undock && !(ds->flags & DOCK_IS_ATA))
741 handle_eject_request(ds, event);
743 dock_event(ds, event, UNDOCK_EVENT);
753 struct dock_station *ds;
760 dock_notify(data->handle, data->event, data->ds);
782 dd->ds = dock_station;
810 struct dock_station *ds = context;
824 if (tmp == ds->handle)
825 add_dock_dependent_device(ds, handle);
936 struct dock_station ds, *dock_station;
940 memset(&ds, 0, sizeof(ds));
941 dd = platform_device_register_data(NULL, "dock", id, &ds, sizeof(ds));
997 static int dock_remove(struct dock_station *ds)
1000 struct platform_device *dock_device = ds->dock_device;
1006 list_for_each_entry_safe(dd, tmp, &ds->dependent_devices, list)
1009 list_del(&ds->sibling);