Home
last modified time | relevance | path

Searched refs:capacity (Results 1 – 25 of 149) sorted by relevance

123456

/drivers/gpu/drm/amd/display/dc/basics/
Dvector.c34 uint32_t capacity, in dal_vector_construct() argument
39 if (!struct_size || !capacity) { in dal_vector_construct()
45 vector->container = kcalloc(capacity, struct_size, GFP_KERNEL); in dal_vector_construct()
48 vector->capacity = capacity; in dal_vector_construct()
88 vector->capacity = count; in dal_vector_presized_costruct()
116 uint32_t capacity, in dal_vector_create() argument
124 if (dal_vector_construct(vector, ctx, capacity, struct_size)) in dal_vector_create()
137 vector->capacity = 0; in dal_vector_destruct()
212 if (vector->count == vector->capacity) { in dal_vector_insert_at()
215 calc_increased_capacity(vector->capacity))) in dal_vector_insert_at()
[all …]
/drivers/scsi/
Dscsicam.c61 bool scsi_partsize(struct block_device *bdev, sector_t capacity, int geom[3]) in scsi_partsize() argument
125 geom[2] = (unsigned long)capacity / in scsi_partsize()
176 static int setsize(unsigned long capacity, unsigned int *cyls, unsigned int *hds, in setsize() argument
186 heads = capacity / temp; /* Compute value for number of heads */ in setsize()
187 if (capacity % temp) { /* If no remainder, done! */ in setsize()
190 sectors = capacity / temp; /* Compute value for sectors per in setsize()
192 if (capacity % temp) { /* If no remainder, done! */ in setsize()
195 cylinders = capacity / temp; /* Compute number of cylinders */ in setsize()
219 int scsicam_bios_param(struct block_device *bdev, sector_t capacity, int *ip) in scsicam_bios_param() argument
221 u64 capacity64 = capacity; /* Suppress gcc warning */ in scsicam_bios_param()
[all …]
Dsd_zbc.c62 zone.capacity = zone.len; in sd_zbc_parse_report()
197 sector_t capacity = logical_to_sectors(sdkp->device, sdkp->capacity); in sd_zbc_report_zones() local
208 if (!capacity) in sd_zbc_report_zones()
216 while (zone_idx < nr_zones && sector < capacity) { in sd_zbc_report_zones()
612 if (sdkp->capacity != max_lba + 1) { in sd_zbc_check_capacity()
616 (unsigned long long)sdkp->capacity, in sd_zbc_check_capacity()
618 sdkp->capacity = max_lba + 1; in sd_zbc_check_capacity()
639 if (!sd_is_zoned(sdkp) || !sdkp->capacity) in sd_zbc_print_zones()
642 if (sdkp->capacity & (sdkp->zone_blocks - 1)) in sd_zbc_print_zones()
743 sdkp->capacity = 0; in sd_zbc_revalidate_zones()
[all …]
Dsr.c374 cd->capacity - error_sector < 4 * 75) in sr_done()
761 cd->capacity = 0x1fffff; in sr_probe()
771 cd->cdi.capacity = 1; in sr_probe()
780 set_capacity(disk, cd->capacity); in sr_probe()
843 cd->capacity = 0x1fffff; in get_sectorsize()
848 cd->capacity = 1 + get_unaligned_be32(&buffer[0]); in get_sectorsize()
857 cd->capacity = max_t(long, cd->capacity, last_written); in get_sectorsize()
873 cd->capacity *= 4; in get_sectorsize()
880 cd->capacity = 0; in get_sectorsize()
889 set_capacity(cd->disk, cd->capacity); in get_sectorsize()
[all …]
/drivers/misc/vmw_vmci/
Dvmci_handle_array.c11 static size_t handle_arr_calc_size(u32 capacity) in handle_arr_calc_size() argument
14 capacity * sizeof(struct vmci_handle); in handle_arr_calc_size()
17 struct vmci_handle_arr *vmci_handle_arr_create(u32 capacity, u32 max_capacity) in vmci_handle_arr_create() argument
21 if (max_capacity == 0 || capacity > max_capacity) in vmci_handle_arr_create()
24 if (capacity == 0) in vmci_handle_arr_create()
25 capacity = min((u32)VMCI_HANDLE_ARRAY_DEFAULT_CAPACITY, in vmci_handle_arr_create()
28 array = kmalloc(handle_arr_calc_size(capacity), GFP_ATOMIC); in vmci_handle_arr_create()
32 array->capacity = capacity; in vmci_handle_arr_create()
49 if (unlikely(array->size >= array->capacity)) { in vmci_handle_arr_append_entry()
52 u32 capacity_bump = min(array->max_capacity - array->capacity, in vmci_handle_arr_append_entry()
[all …]
Dvmci_handle_array.h16 u32 capacity; member
32 struct vmci_handle_arr *vmci_handle_arr_create(u32 capacity, u32 max_capacity);
/drivers/power/supply/
Dds2782_battery.c49 int (*get_battery_capacity)(struct ds278x_info *info, int *capacity);
62 int capacity; member
161 static int ds2782_get_capacity(struct ds278x_info *info, int *capacity) in ds2782_get_capacity() argument
169 *capacity = raw; in ds2782_get_capacity()
201 static int ds2786_get_capacity(struct ds278x_info *info, int *capacity) in ds2786_get_capacity() argument
210 *capacity = raw/2 ; in ds2786_get_capacity()
218 int capacity; in ds278x_get_status() local
224 err = info->ops->get_battery_capacity(info, &capacity); in ds278x_get_status()
228 info->capacity = capacity; in ds278x_get_status()
230 if (capacity == 100) in ds278x_get_status()
[all …]
Drx51_battery.c134 int capacity = rx51_battery_read_adc(di->channel_bsi); in rx51_battery_read_capacity() local
136 if (capacity < 0) { in rx51_battery_read_capacity()
137 dev_err(di->dev, "Could not read ADC: %d\n", capacity); in rx51_battery_read_capacity()
138 return capacity; in rx51_battery_read_capacity()
141 return 1280 * (1200 * capacity)/(1024 - capacity); in rx51_battery_read_capacity()
Dda9052-battery.c353 static int da9052_bat_read_capacity(struct da9052_battery *bat, int *capacity) in da9052_bat_read_capacity() argument
377 *capacity = 100; in da9052_bat_read_capacity()
381 *capacity = 0; in da9052_bat_read_capacity()
400 *capacity = da9052_bat_interpolate(vbat_lower, vbat_upper, level_lower, in da9052_bat_read_capacity()
410 int capacity; in da9052_bat_check_health() local
422 ret = da9052_bat_read_capacity(bat, &capacity); in da9052_bat_check_health()
425 if (capacity < DA9052_BAT_LOW_CAP) in da9052_bat_check_health()
/drivers/staging/fwserial/
Ddma_fifo.c61 int capacity; in dma_fifo_alloc() local
67 capacity = size + align * open_limit + align * DMA_FIFO_GUARD; in dma_fifo_alloc()
68 fifo->data = kmalloc(capacity, gfp_mask); in dma_fifo_alloc()
82 fifo->capacity = capacity; in dma_fifo_alloc()
153 ofs = fifo->in % fifo->capacity; in dma_fifo_in()
154 l = min(n, fifo->capacity - ofs); in dma_fifo_in()
202 ofs = fifo->out % fifo->capacity; in dma_fifo_out_pend()
203 l = fifo->capacity - ofs; in dma_fifo_out_pend()
/drivers/ide/
Dide-disk.c300 u64 capacity, set_max; in ide_disk_hpa_get_native_capacity() local
302 capacity = drive->capacity64; in ide_disk_hpa_get_native_capacity()
310 if (set_max == capacity + 1) in ide_disk_hpa_get_native_capacity()
328 u64 capacity, set_max; in idedisk_check_hpa() local
331 capacity = drive->capacity64; in idedisk_check_hpa()
334 if (set_max <= capacity) in idedisk_check_hpa()
343 capacity, sectors_to_MB(capacity), in idedisk_check_hpa()
528 unsigned long long capacity; in update_flush() local
538 capacity = ide_gd_capacity(drive); in update_flush()
542 capacity <= (1ULL << 28) || in update_flush()
[all …]
Dide-floppy.c322 int capacity, lba_capacity; in ide_floppy_get_flexible_disk_page() local
349 capacity = cyls * heads * sectors * sector_size; in ide_floppy_get_flexible_disk_page()
354 drive->name, capacity / 1024, cyls, heads, in ide_floppy_get_flexible_disk_page()
363 if (capacity < lba_capacity) { in ide_floppy_get_flexible_disk_page()
366 drive->name, lba_capacity, capacity); in ide_floppy_get_flexible_disk_page()
368 capacity / floppy->block_size : 0; in ide_floppy_get_flexible_disk_page()
/drivers/gpu/drm/amd/display/dmub/inc/
Ddmub_cmd.h795 uint32_t capacity; member
805 uint32_t capacity; member
824 data_count = rb->capacity - (rb->rptr - rb->wrpt); in dmub_rb_full()
826 return (data_count == (rb->capacity - DMUB_RB_CMD_SIZE)); in dmub_rb_full()
845 if (rb->wrpt >= rb->capacity) in dmub_rb_push_front()
846 rb->wrpt %= rb->capacity; in dmub_rb_push_front()
864 if (rb->wrpt >= rb->capacity) in dmub_rb_out_push_front()
865 rb->wrpt %= rb->capacity; in dmub_rb_out_push_front()
907 if (rb->rptr >= rb->capacity) in dmub_rb_pop_front()
908 rb->rptr %= rb->capacity; in dmub_rb_pop_front()
[all …]
/drivers/usb/storage/
Dsddr55.c87 unsigned long capacity; /* Size of card in bytes */ member
650 if (!info->capacity) in sddr55_read_map()
653 numblocks = info->capacity >> (info->blockshift + info->pageshift); in sddr55_read_map()
788 unsigned long capacity; in sddr55_transport() local
862 capacity = sddr55_get_capacity(us); in sddr55_transport()
864 if (!capacity) { in sddr55_transport()
869 info->capacity = capacity; in sddr55_transport()
875 info->max_log_blks = ((info->capacity >> (info->pageshift + info->blockshift)) / 256) * 250; in sddr55_transport()
881 capacity = (capacity / 256) * 250; in sddr55_transport()
883 capacity /= PAGESIZE; in sddr55_transport()
[all …]
Dalauda.c86 unsigned long capacity; /* total media size in bytes */ member
288 unsigned int num_zones = media_info->capacity >> shift; in alauda_free_maps()
423 MEDIA_INFO(us).capacity = 1 << media_info->chipshift; in alauda_init_media()
425 MEDIA_INFO(us).capacity >> 20); in alauda_init_media()
438 num_zones = MEDIA_INFO(us).capacity >> (MEDIA_INFO(us).zoneshift in alauda_init_media()
943 max_lba = MEDIA_INFO(us).capacity >> (blockshift + pageshift); in alauda_read_data()
1045 max_lba = MEDIA_INFO(us).capacity >> (pageshift + blockshift); in alauda_write_data()
1150 unsigned long capacity; in alauda_transport() local
1156 num_zones = MEDIA_INFO(us).capacity >> (MEDIA_INFO(us).zoneshift in alauda_transport()
1159 capacity = num_zones * MEDIA_INFO(us).uzonesize in alauda_transport()
[all …]
/drivers/gpu/drm/amd/display/include/
Dvector.h33 uint32_t capacity; member
40 uint32_t capacity,
45 uint32_t capacity,
104 bool dal_vector_reserve(struct vector *vector, uint32_t capacity);
/drivers/net/wireless/st/cw1200/
Dqueue.c116 if (queue->num_queued <= (queue->capacity >> 1)) { in __cw1200_queue_gc()
164 size_t capacity, in cw1200_queue_init() argument
171 queue->capacity = capacity; in cw1200_queue_init()
180 queue->pool = kcalloc(capacity, sizeof(struct cw1200_queue_item), in cw1200_queue_init()
193 for (i = 0; i < capacity; ++i) in cw1200_queue_init()
250 queue->capacity = 0; in cw1200_queue_deinit()
316 (queue->capacity - (num_present_cpus() - 1))) { in cw1200_queue_put()
385 } else if (item_id >= (unsigned) queue->capacity) { in cw1200_queue_requeue()
456 } else if (item_id >= (unsigned) queue->capacity) { in cw1200_queue_remove()
476 (queue->num_queued <= (queue->capacity >> 1))) { in cw1200_queue_remove()
[all …]
/drivers/base/
Darch_topology.c66 void topology_set_cpu_scale(unsigned int cpu, unsigned long capacity) in topology_set_cpu_scale() argument
68 per_cpu(cpu_scale, cpu) = capacity; in topology_set_cpu_scale()
153 u64 capacity; in topology_normalize_cpu_scale() local
162 capacity = raw_capacity[cpu] * per_cpu(freq_factor, cpu); in topology_normalize_cpu_scale()
163 capacity_scale = max(capacity, capacity_scale); in topology_normalize_cpu_scale()
168 capacity = raw_capacity[cpu] * per_cpu(freq_factor, cpu); in topology_normalize_cpu_scale()
169 capacity = div64_u64(capacity << SCHED_CAPACITY_SHIFT, in topology_normalize_cpu_scale()
171 topology_set_cpu_scale(cpu, capacity); in topology_normalize_cpu_scale()
/drivers/net/wireless/intel/iwlwifi/dvm/
Dmain.c404 u32 capacity, u32 mode) in iwl_print_cont_event_trace() argument
429 if (WARN_ON(num_events > capacity - start_idx)) in iwl_print_cont_event_trace()
430 num_events = capacity - start_idx; in iwl_print_cont_event_trace()
454 u32 capacity; /* event log capacity in # entries */ in iwl_continuous_event_trace() local
456 u32 capacity; in iwl_continuous_event_trace() member
470 capacity = read.capacity; in iwl_continuous_event_trace()
482 if (unlikely(next_entry == capacity)) in iwl_continuous_event_trace()
500 capacity, mode); in iwl_continuous_event_trace()
516 capacity - priv->event_log.next_entry, in iwl_continuous_event_trace()
517 capacity, mode); in iwl_continuous_event_trace()
[all …]
/drivers/platform/chrome/wilco_ec/
Devent.c96 int capacity; member
106 static struct ec_event_queue *event_queue_new(int capacity) in event_queue_new() argument
110 q = kzalloc(struct_size(q, entries, capacity), GFP_KERNEL); in event_queue_new()
114 q->capacity = capacity; in event_queue_new()
140 q->tail = (q->tail + 1) % q->capacity; in event_queue_pop()
157 q->head = (q->head + 1) % q->capacity; in event_queue_push()
/drivers/scsi/aic7xxx/
Daiclib.h137 aic_sector_div(sector_t capacity, int heads, int sectors) in aic_sector_div() argument
140 sector_div(capacity, (heads * sectors)); in aic_sector_div()
141 return (int)capacity; in aic_sector_div()
/drivers/hid/
Dhid-logitech-hidpp.c143 int capacity; member
699 hidpp->battery.capacity = response.rap.params[0]; in hidpp10_query_battery_mileage()
712 int status, capacity, level; in hidpp10_battery_event() local
720 capacity = hidpp->battery.capacity; in hidpp10_battery_event()
725 capacity = report->rap.params[0]; in hidpp10_battery_event()
733 changed = capacity != hidpp->battery.capacity || in hidpp10_battery_event()
1094 static int hidpp_map_battery_level(int capacity) in hidpp_map_battery_level() argument
1096 if (capacity < 11) in hidpp_map_battery_level()
1102 else if (capacity < 30) in hidpp_map_battery_level()
1104 else if (capacity < 81) in hidpp_map_battery_level()
[all …]
/drivers/block/paride/
Dpd.c227 int capacity; /* Size of this volume in sectors */ member
724 disk->capacity = le32_to_cpu(*(__le32 *) (pd_scratch + 120)); in pd_identify()
726 disk->capacity = disk->sectors * disk->heads * disk->cylinders; in pd_identify()
741 disk->capacity, disk->capacity / 2048, in pd_identify()
745 if (disk->capacity) in pd_identify()
813 geo->cylinders = disk->capacity / (geo->heads * geo->sectors); in pd_getgeo()
866 set_capacity(p, disk->capacity); in pd_revalidate()
949 disk->capacity = 0; in pd_detect()
990 set_capacity(disk->gd, disk->capacity); in pd_detect()
/drivers/firewire/
Dnosy.c60 size_t capacity; member
115 packet_buffer_init(struct packet_buffer *buffer, size_t capacity) in packet_buffer_init() argument
117 buffer->data = kmalloc(capacity, GFP_KERNEL); in packet_buffer_init()
122 buffer->capacity = capacity; in packet_buffer_init()
153 end = buffer->data + buffer->capacity; in packet_buffer_get()
187 if (buffer->capacity < in packet_buffer_put()
193 end = buffer->data + buffer->capacity; in packet_buffer_put()
/drivers/net/ethernet/qlogic/qed/
Dqed_spq.c476 u32 i, capacity; in qed_spq_setup() local
489 capacity = qed_chain_get_capacity(&p_spq->chain); in qed_spq_setup()
490 for (i = 0; i < capacity; i++) { in qed_spq_setup()
547 u32 capacity; in qed_spq_alloc() local
563 capacity = qed_chain_get_capacity(&p_spq->chain); in qed_spq_alloc()
567 capacity * sizeof(struct qed_spq_entry), in qed_spq_alloc()
590 u32 capacity; in qed_spq_free() local
601 capacity = qed_chain_get_capacity(&p_spq->chain); in qed_spq_free()
603 capacity * in qed_spq_free()

123456