Lines Matching +full:5 +full:- +full:inch

1 /*-
2 * SPDX-License-Identifier: BSD-2-Clause
186 "MacBookPro1,1", "Apple SMC MacBook Pro Core Duo (15-inch)",
192 "MacBookPro1,2", "Apple SMC MacBook Pro Core Duo (17-inch)",
198 "MacBookPro2,1", "Apple SMC MacBook Pro Core 2 Duo (17-inch)",
204 "MacBookPro2,2", "Apple SMC MacBook Pro Core 2 Duo (15-inch)",
210 "MacBookPro3,1", "Apple SMC MacBook Pro Core 2 Duo (15-inch LED)",
216 "MacBookPro3,2", "Apple SMC MacBook Pro Core 2 Duo (17-inch HD)",
234 "MacBookPro5,5", "Apple SMC MacBook Pro Core 2 Duo (Mid 2009)",
240 "MacBookPro6,2", "Apple SMC MacBook Pro (Mid 2010, 15-inch)",
246 "MacBookPro8,1", "Apple SMC MacBook Pro (early 2011, 13-inch)",
258 "MacBookPro9,1", "Apple SMC MacBook Pro (mid 2012, 15-inch)",
264 "MacBookPro9,2", "Apple SMC MacBook Pro (mid 2012, 13-inch)",
282 "MacBookPro11,4", "Apple SMC MacBook Pro Retina Core i7 (mid 2015, 15-inch)",
314 /* The Mac Mini 4,1 (Mid-2010) has no SMS */
316 "Macmini4,1", "Apple SMC Mac mini 4,1 (Mid-2010)",
323 /* The Mac Mini 5,1 has no SMS */
324 /* - same sensors as Mac Mini 5,2 */
326 "Macmini5,1", "Apple SMC Mac Mini 5,1",
333 /* The Mac Mini 5,2 has no SMS */
335 "Macmini5,2", "Apple SMC Mac Mini 5,2",
342 /* The Mac Mini 5,3 has no SMS */
343 /* - same sensors as Mac Mini 5,2 */
345 "Macmini5,3", "Apple SMC Mac Mini 5,3",
370 /* Idem for the Mac Pro (8-core) */
372 "MacPro2", "Apple SMC Mac Pro (8-core)",
410 "MacBookAir4,1", "Apple SMC Macbook Air 11-inch (Mid 2011)",
418 "MacBookAir4,2", "Apple SMC Macbook Air 13-inch (Mid 2011)",
426 "MacBookAir5,1", "Apple SMC MacBook Air 11-inch (Mid 2012)",
434 "MacBookAir5,2", "Apple SMC MacBook Air 13-inch (Mid 2012)",
441 "MacBookAir6,1", "Apple SMC MacBook Air 11-inch (Early 2013)",
448 "MacBookAir6,2", "Apple SMC MacBook Air 13-inch (Early 2013)",
455 "MacBookAir7,1", "Apple SMC MacBook Air 11-inch (Early 2015)",
462 "MacBookAir7,2", "Apple SMC MacBook Air 13-inch (Early 2015)",
551 device_set_desc(dev, model->smc_desc); in asmc_probe()
567 sc->sc_ioport = bus_alloc_resource_any(dev, SYS_RES_IOPORT, in asmc_attach()
568 &sc->sc_rid_port, RF_ACTIVE); in asmc_attach()
569 if (sc->sc_ioport == NULL) { in asmc_attach()
579 mtx_init(&sc->sc_mtx, "asmc", NULL, MTX_SPIN); in asmc_attach()
581 sc->sc_model = model; in asmc_attach()
587 sc->sc_fan_tree[0] = SYSCTL_ADD_NODE(sysctlctx, in asmc_attach()
591 for (i = 1; i <= sc->sc_nfan; i++) { in asmc_attach()
592 j = i - 1; in asmc_attach()
595 sc->sc_fan_tree[i] = SYSCTL_ADD_NODE(sysctlctx, in asmc_attach()
596 SYSCTL_CHILDREN(sc->sc_fan_tree[0]), in asmc_attach()
601 SYSCTL_CHILDREN(sc->sc_fan_tree[i]), in asmc_attach()
604 dev, j, model->smc_fan_id, "I", in asmc_attach()
608 SYSCTL_CHILDREN(sc->sc_fan_tree[i]), in asmc_attach()
611 dev, j, model->smc_fan_speed, "I", in asmc_attach()
615 SYSCTL_CHILDREN(sc->sc_fan_tree[i]), in asmc_attach()
618 dev, j, model->smc_fan_safespeed, "I", in asmc_attach()
622 SYSCTL_CHILDREN(sc->sc_fan_tree[i]), in asmc_attach()
625 dev, j, model->smc_fan_minspeed, "I", in asmc_attach()
629 SYSCTL_CHILDREN(sc->sc_fan_tree[i]), in asmc_attach()
632 dev, j, model->smc_fan_maxspeed, "I", in asmc_attach()
636 SYSCTL_CHILDREN(sc->sc_fan_tree[i]), in asmc_attach()
639 dev, j, model->smc_fan_targetspeed, "I", in asmc_attach()
646 sc->sc_temp_tree = SYSCTL_ADD_NODE(sysctlctx, in asmc_attach()
650 for (i = 0; model->smc_temps[i]; i++) { in asmc_attach()
652 SYSCTL_CHILDREN(sc->sc_temp_tree), in asmc_attach()
653 OID_AUTO, model->smc_tempnames[i], in asmc_attach()
656 model->smc_tempdescs[i]); in asmc_attach()
662 if (model->smc_light_left) { in asmc_attach()
663 sc->sc_light_tree = SYSCTL_ADD_NODE(sysctlctx, in asmc_attach()
669 SYSCTL_CHILDREN(sc->sc_light_tree), in asmc_attach()
672 dev, 0, model->smc_light_left, "I", in asmc_attach()
676 SYSCTL_CHILDREN(sc->sc_light_tree), in asmc_attach()
679 dev, 0, model->smc_light_right, "I", in asmc_attach()
683 SYSCTL_CHILDREN(sc->sc_light_tree), in asmc_attach()
687 model->smc_light_control, "I", in asmc_attach()
691 if (model->smc_sms_x == NULL) in asmc_attach()
697 sc->sc_sms_tree = SYSCTL_ADD_NODE(sysctlctx, in asmc_attach()
702 SYSCTL_CHILDREN(sc->sc_sms_tree), in asmc_attach()
705 dev, 0, model->smc_sms_x, "I", in asmc_attach()
709 SYSCTL_CHILDREN(sc->sc_sms_tree), in asmc_attach()
712 dev, 0, model->smc_sms_y, "I", in asmc_attach()
716 SYSCTL_CHILDREN(sc->sc_sms_tree), in asmc_attach()
719 dev, 0, model->smc_sms_z, "I", in asmc_attach()
732 sc->sc_sms_tq = NULL; in asmc_attach()
733 TASK_INIT(&sc->sc_sms_task, 0, asmc_sms_task, sc); in asmc_attach()
734 sc->sc_sms_tq = taskqueue_create_fast("asmc_taskq", M_WAITOK, in asmc_attach()
735 taskqueue_thread_enqueue, &sc->sc_sms_tq); in asmc_attach()
736 taskqueue_start_threads(&sc->sc_sms_tq, 1, PI_REALTIME, "%s sms taskq", in asmc_attach()
741 sc->sc_rid_irq = 0; in asmc_attach()
742 sc->sc_irq = bus_alloc_resource_any(dev, SYS_RES_IRQ, in asmc_attach()
743 &sc->sc_rid_irq, RF_ACTIVE); in asmc_attach()
744 if (sc->sc_irq == NULL) { in asmc_attach()
750 ret = bus_setup_intr(dev, sc->sc_irq, in asmc_attach()
753 dev, &sc->sc_cookie); in asmc_attach()
762 bus_release_resource(dev, SYS_RES_IRQ, sc->sc_rid_irq, sc->sc_irq); in asmc_attach()
764 bus_release_resource(dev, SYS_RES_IOPORT, sc->sc_rid_port, in asmc_attach()
765 sc->sc_ioport); in asmc_attach()
766 mtx_destroy(&sc->sc_mtx); in asmc_attach()
767 if (sc->sc_sms_tq) in asmc_attach()
768 taskqueue_free(sc->sc_sms_tq); in asmc_attach()
778 if (sc->sc_sms_tq) { in asmc_detach()
779 taskqueue_drain(sc->sc_sms_tq, &sc->sc_sms_task); in asmc_detach()
780 taskqueue_free(sc->sc_sms_tq); in asmc_detach()
782 if (sc->sc_cookie) in asmc_detach()
783 bus_teardown_intr(dev, sc->sc_irq, sc->sc_cookie); in asmc_detach()
784 if (sc->sc_irq) in asmc_detach()
785 bus_release_resource(dev, SYS_RES_IRQ, sc->sc_rid_irq, in asmc_detach()
786 sc->sc_irq); in asmc_detach()
787 if (sc->sc_ioport) in asmc_detach()
788 bus_release_resource(dev, SYS_RES_IOPORT, sc->sc_rid_port, in asmc_detach()
789 sc->sc_ioport); in asmc_detach()
790 mtx_destroy(&sc->sc_mtx); in asmc_detach()
823 if (sc->sc_model->smc_sms_x == NULL) in asmc_init()
868 sc->sc_sms_intr_works = 0; in asmc_init()
878 sc->sc_sms_intr_works = 1; in asmc_init()
892 sc->sc_nfan = asmc_fan_count(dev); in asmc_init()
893 if (sc->sc_nfan > ASMC_MAXFANS) { in asmc_init()
896 sc->sc_nfan = ASMC_MAXFANS; in asmc_init()
990 mtx_lock_spin(&sc->sc_mtx); in asmc_key_read()
1018 mtx_unlock_spin(&sc->sc_mtx); in asmc_key_read()
1028 char key[5] = { 0 }; in asmc_key_dump()
1035 mtx_lock_spin(&sc->sc_mtx); in asmc_key_dump()
1084 mtx_unlock_spin(&sc->sc_mtx); in asmc_key_dump()
1089 mtx_unlock_spin(&sc->sc_mtx); in asmc_key_dump()
1092 type[5] = 0; in asmc_key_dump()
1120 int i, error = -1, try = 0; in asmc_key_write()
1123 mtx_lock_spin(&sc->sc_mtx); in asmc_key_write()
1154 mtx_unlock_spin(&sc->sc_mtx); in asmc_key_write()
1169 return (-1); in asmc_fan_count()
1179 char fankey[5]; in asmc_fan_getvalue()
1183 return (-1); in asmc_fan_getvalue()
1192 char fankey[5]; in asmc_fan_getstring()
1207 char fankey[5]; in asmc_fan_setvalue()
1216 return (-1); in asmc_fan_setvalue()
1277 if (error == 0 && req->newptr != NULL) { in asmc_mb_sysctl_fanminspeed()
1296 if (error == 0 && req->newptr != NULL) { in asmc_mb_sysctl_fanmaxspeed()
1315 if (error == 0 && req->newptr != NULL) { in asmc_mb_sysctl_fantargetspeed()
1335 return (-1); in asmc_temp_getvalue()
1347 val = asmc_temp_getvalue(dev, sc->sc_model->smc_temps[arg2]); in asmc_temp_sysctl()
1385 asmc_sms_read(dev, ASMC_KEY_SMS_X, &sc->sms_rest_x); in asmc_sms_calibrate()
1386 asmc_sms_read(dev, ASMC_KEY_SMS_Y, &sc->sms_rest_y); in asmc_sms_calibrate()
1387 asmc_sms_read(dev, ASMC_KEY_SMS_Z, &sc->sms_rest_z); in asmc_sms_calibrate()
1396 if (!sc->sc_sms_intr_works) in asmc_sms_intrfast()
1399 mtx_lock_spin(&sc->sc_mtx); in asmc_sms_intrfast()
1401 mtx_unlock_spin(&sc->sc_mtx); in asmc_sms_intrfast()
1403 sc->sc_sms_intrtype = type; in asmc_sms_intrfast()
1406 taskqueue_enqueue(sc->sc_sms_tq, &sc->sc_sms_task); in asmc_sms_intrfast()
1430 if (strcmp(sc->sc_model->smc_model, "MacBookPro5,5") == 0 || in asmc_sms_printintr()
1431 strcmp(sc->sc_model->smc_model, "MacBookPro6,2") == 0) in asmc_sms_printintr()
1446 switch (sc->sc_sms_intrtype) { in asmc_sms_task()
1550 if (error == 0 && req->newptr != NULL) { in asmc_mbp_sysctl_light_control()
1572 * This seems to be a 32 bit big endian value from buf[6] -> buf[9]. in asmc_mbp_sysctl_light_left_10byte()