Print this page
4823 don't open-code NSEC2MSEC and MSEC2NSEC


 141         0,                              /* refcnt */
 142         ds1287_getinfo,                 /* getinfo */
 143         nulldev,                        /* identify */
 144         nulldev,                        /* probe */
 145         ds1287_attach,                  /* attach */
 146         ds1287_detach,                  /* detach */
 147         nodev,                          /* reset */
 148         &ds1287_cbops,                      /* cb_ops */
 149         (struct bus_ops *)NULL,         /* bus_ops */
 150         NULL,                           /* power */
 151         ddi_quiesce_not_supported,      /* devo_quiesce */
 152 };
 153 
 154 
 155 static void     *ds1287_state;
 156 static int      instance = -1;
 157 
 158 /* Driver Tunables */
 159 static int      ds1287_interrupt_priority = 15;
 160 static int      ds1287_softint_priority = 2;
 161 static hrtime_t power_button_debounce = NANOSEC/MILLISEC*10;
 162 static hrtime_t power_button_abort_interval = 1.5 * NANOSEC;
 163 static int      power_button_abort_presses = 3;
 164 static int      power_button_abort_enable = 1;
 165 static int      power_button_enable = 1;
 166 
 167 static int      power_button_pressed = 0;
 168 static int      power_button_cancel = 0;
 169 static int      power_button_timeouts = 0;
 170 static int      timeout_cancel = 0;
 171 static int      additional_presses = 0;
 172 
 173 static ddi_iblock_cookie_t ds1287_lo_iblock;
 174 static ddi_iblock_cookie_t ds1287_hi_iblock;
 175 static ddi_softintr_t   ds1287_softintr_id;
 176 static kmutex_t ds1287_reg_mutex;       /* Protects ds1287 Registers */
 177 
 178 static struct modldrv modldrv = {
 179         &mod_driverops,     /* Type of module. This one is a driver */
 180         "ds1287 clock driver",  /* Name of the module. */
 181         &ds1287_ops,                /* driver ops */




 141         0,                              /* refcnt */
 142         ds1287_getinfo,                 /* getinfo */
 143         nulldev,                        /* identify */
 144         nulldev,                        /* probe */
 145         ds1287_attach,                  /* attach */
 146         ds1287_detach,                  /* detach */
 147         nodev,                          /* reset */
 148         &ds1287_cbops,                      /* cb_ops */
 149         (struct bus_ops *)NULL,         /* bus_ops */
 150         NULL,                           /* power */
 151         ddi_quiesce_not_supported,      /* devo_quiesce */
 152 };
 153 
 154 
 155 static void     *ds1287_state;
 156 static int      instance = -1;
 157 
 158 /* Driver Tunables */
 159 static int      ds1287_interrupt_priority = 15;
 160 static int      ds1287_softint_priority = 2;
 161 static hrtime_t power_button_debounce = MSEC2NSEC(10);
 162 static hrtime_t power_button_abort_interval = 1.5 * NANOSEC;
 163 static int      power_button_abort_presses = 3;
 164 static int      power_button_abort_enable = 1;
 165 static int      power_button_enable = 1;
 166 
 167 static int      power_button_pressed = 0;
 168 static int      power_button_cancel = 0;
 169 static int      power_button_timeouts = 0;
 170 static int      timeout_cancel = 0;
 171 static int      additional_presses = 0;
 172 
 173 static ddi_iblock_cookie_t ds1287_lo_iblock;
 174 static ddi_iblock_cookie_t ds1287_hi_iblock;
 175 static ddi_softintr_t   ds1287_softintr_id;
 176 static kmutex_t ds1287_reg_mutex;       /* Protects ds1287 Registers */
 177 
 178 static struct modldrv modldrv = {
 179         &mod_driverops,     /* Type of module. This one is a driver */
 180         "ds1287 clock driver",  /* Name of the module. */
 181         &ds1287_ops,                /* driver ops */