Lines Matching refs:ip_hw_instance

736 struct ip_hw_instance {  struct
762 ssize_t (*show)(struct ip_hw_instance *ip_hw_instance, char *buf);
765 static ssize_t hw_id_show(struct ip_hw_instance *ip_hw_instance, char *buf) in hw_id_show() argument
767 return sysfs_emit(buf, "%d\n", ip_hw_instance->hw_id); in hw_id_show()
770 static ssize_t num_instance_show(struct ip_hw_instance *ip_hw_instance, char *buf) in num_instance_show() argument
772 return sysfs_emit(buf, "%d\n", ip_hw_instance->num_instance); in num_instance_show()
775 static ssize_t major_show(struct ip_hw_instance *ip_hw_instance, char *buf) in major_show() argument
777 return sysfs_emit(buf, "%d\n", ip_hw_instance->major); in major_show()
780 static ssize_t minor_show(struct ip_hw_instance *ip_hw_instance, char *buf) in minor_show() argument
782 return sysfs_emit(buf, "%d\n", ip_hw_instance->minor); in minor_show()
785 static ssize_t revision_show(struct ip_hw_instance *ip_hw_instance, char *buf) in revision_show() argument
787 return sysfs_emit(buf, "%d\n", ip_hw_instance->revision); in revision_show()
790 static ssize_t harvest_show(struct ip_hw_instance *ip_hw_instance, char *buf) in harvest_show() argument
792 return sysfs_emit(buf, "0x%01X\n", ip_hw_instance->harvest); in harvest_show()
795 static ssize_t num_base_addresses_show(struct ip_hw_instance *ip_hw_instance, char *buf) in num_base_addresses_show() argument
797 return sysfs_emit(buf, "%d\n", ip_hw_instance->num_base_addresses); in num_base_addresses_show()
800 static ssize_t base_addr_show(struct ip_hw_instance *ip_hw_instance, char *buf) in base_addr_show() argument
805 for (res = at = ii = 0; ii < ip_hw_instance->num_base_addresses; ii++) { in base_addr_show()
811 ip_hw_instance->base_addr[ii]); in base_addr_show()
832 ATTRIBUTE_GROUPS(ip_hw_instance);
834 #define to_ip_hw_instance(x) container_of(x, struct ip_hw_instance, kobj)
841 struct ip_hw_instance *ip_hw_instance = to_ip_hw_instance(kobj); in ip_hw_instance_attr_show() local
847 return ip_hw_attr->show(ip_hw_instance, buf); in ip_hw_instance_attr_show()
856 struct ip_hw_instance *ip_hw_instance = to_ip_hw_instance(kobj); in ip_hw_instance_release() local
858 kfree(ip_hw_instance); in ip_hw_instance_release()
1032 struct ip_hw_instance *ip_hw_instance; in amdgpu_discovery_sysfs_ips() local
1073 ip_hw_instance = kzalloc(struct_size(ip_hw_instance, in amdgpu_discovery_sysfs_ips()
1077 if (!ip_hw_instance) { in amdgpu_discovery_sysfs_ips()
1081 ip_hw_instance->hw_id = le16_to_cpu(ip->hw_id); /* == ii */ in amdgpu_discovery_sysfs_ips()
1082 ip_hw_instance->num_instance = ip->instance_number; in amdgpu_discovery_sysfs_ips()
1083 ip_hw_instance->major = ip->major; in amdgpu_discovery_sysfs_ips()
1084 ip_hw_instance->minor = ip->minor; in amdgpu_discovery_sysfs_ips()
1085 ip_hw_instance->revision = ip->revision; in amdgpu_discovery_sysfs_ips()
1086 ip_hw_instance->harvest = in amdgpu_discovery_sysfs_ips()
1088 adev, ip_hw_instance->hw_id, in amdgpu_discovery_sysfs_ips()
1089 ip_hw_instance->num_instance); in amdgpu_discovery_sysfs_ips()
1090 ip_hw_instance->num_base_addresses = ip->num_base_address; in amdgpu_discovery_sysfs_ips()
1092 for (kk = 0; kk < ip_hw_instance->num_base_addresses; kk++) { in amdgpu_discovery_sysfs_ips()
1094 ip_hw_instance->base_addr[kk] = in amdgpu_discovery_sysfs_ips()
1097 ip_hw_instance->base_addr[kk] = ip->base_address[kk]; in amdgpu_discovery_sysfs_ips()
1100 kobject_init(&ip_hw_instance->kobj, &ip_hw_instance_ktype); in amdgpu_discovery_sysfs_ips()
1101 ip_hw_instance->kobj.kset = &ip_hw_id->hw_id_kset; in amdgpu_discovery_sysfs_ips()
1102 res = kobject_add(&ip_hw_instance->kobj, NULL, in amdgpu_discovery_sysfs_ips()
1103 "%d", ip_hw_instance->num_instance); in amdgpu_discovery_sysfs_ips()